# Screw Thread API
> Screw-thread geometry as an API, computed locally and deterministically for the 60° ISO metric and Unified (UTS) thread form. The pitch endpoint converts between the thread pitch in millimetres and threads per inch (TPI = 25.4 ÷ pitch) and works out the lead — the distance the thread advances in one turn — from the pitch and the number of starts. The dimensions endpoint takes a nominal (major) diameter and a pitch and returns the full set of thread diameters and heights: the fundamental triangle height, the external thread height, the pitch diameter (D − 0.6495·P), the external minor diameter (D − 1.2269·P) and the internal minor diameter (D − 1.0825·P), in both millimetres and inches. The tapdrill endpoint gives the drill size for cutting an internal thread: the standard metric rule of nominal diameter minus pitch (about 75–83% thread), the resulting thread engagement, and — for a target engagement percentage — the matching drill size. Diameters accept millimetres or inches, and threads can be specified by pitch or by TPI. Everything is computed locally and deterministically, so it is instant and private. Ideal for machining and CNC tools, mechanical-design and CAD apps, maker and 3D-printing projects, and hardware and fastener catalogues. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is screw-thread geometry; for the torque to tighten a bolt use a torque API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/thread-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 25,000 calls/Mo, 5 req/s
- **Pro** ($24/Mo) — 150,000 calls/Mo, 15 req/s
- **Mega** ($74/Mo) — 759,000 calls/Mo, 40 req/s

## Endpoints

### Thread

#### `GET /v1/dimensions` — Thread diameters & heights

**Parameters:**
- `diameter` (query, required, string) — Nominal (major) diameter Example: `10`
- `pitch` (query, optional, string) — Pitch in mm (or tpi) Example: `1.5`
- `tpi` (query, optional, string) — Or threads per inch
- `unit` (query, optional, string) — mm|in (default mm) Example: `mm`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/thread-api/v1/dimensions?diameter=10&pitch=1.5&unit=mm"
```

**Response:**
```json
{
    "data": {
        "tpi": 16.9333,
        "note": "60° ISO/UTS thread. Pitch dia = D − 0.6495·P; external minor = D − 1.2269·P; internal minor = D − 1.0825·P.",
        "pitch_mm": 1.5,
        "pitch_diameter": {
            "in": 0.35534,
            "mm": 9.0257,
            "value": 9.0257
        },
        "nominal_diameter": {
            "in": 0.3937,
            "mm": 10,
            "value": 10
        },
        "fundamental_height_H": {
            "in": 0.05114,
            "mm": 1.299,
            "value": 1.299
        },
        "thread_height_external": {
            "in": 0.03623,
            "mm": 0.9202,
            "value": 0.9202
        },
        "minor_diameter_external": {
            "in": 0.32125,
            "mm": 8.1597,
            "value": 8.1597
        },
        "minor_diameter_internal": {
            "in": 0.32977,
            "mm": 8.3762,
            "value": 8.3762
        }
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:07.231Z",
        "request_id": "0386a03c-7409-48fc-b247-169450d4d77d"
    },
    "status": "ok",
    "message": "Thread diameters & heights",
    "success": true
}
```

#### `GET /v1/pitch` — Pitch / TPI / lead

**Parameters:**
- `pitch` (query, optional, string) — Pitch in mm Example: `1.5`
- `tpi` (query, optional, string) — Or threads per inch
- `starts` (query, optional, string) — Number of starts (default 1) Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/thread-api/v1/pitch?pitch=1.5&starts=1"
```

**Response:**
```json
{
    "data": {
        "tpi": 16.9333,
        "note": "TPI = 25.4 / pitch(mm). Lead = pitch × number of starts (distance advanced per turn).",
        "starts": 1,
        "lead_in": 0.059055,
        "lead_mm": 1.5,
        "pitch_in": 0.059055,
        "pitch_mm": 1.5
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:07.324Z",
        "request_id": "5d53e1b6-2f5c-4099-a5ff-0482bd1b5cf6"
    },
    "status": "ok",
    "message": "Pitch / TPI / lead",
    "success": true
}
```

#### `GET /v1/tapdrill` — Tap drill size

**Parameters:**
- `diameter` (query, required, string) — Nominal (major) diameter Example: `10`
- `pitch` (query, optional, string) — Pitch in mm (or tpi) Example: `1.5`
- `tpi` (query, optional, string) — Or threads per inch
- `unit` (query, optional, string) — mm|in Example: `mm`
- `thread_percent` (query, optional, string) — Target thread engagement % Example: `75`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/thread-api/v1/tapdrill?diameter=10&pitch=1.5&unit=mm&thread_percent=75"
```

**Response:**
```json
{
    "data": {
        "note": "Standard metric tap drill = nominal diameter − pitch, giving roughly 75–83% thread. Pass thread_percent for a target engagement.",
        "pitch_mm": 1.5,
        "nominal_diameter": {
            "in": 0.3937,
            "mm": 10,
            "value": 10
        },
        "tap_drill_standard": {
            "in": 0.33465,
            "mm": 8.5,
            "value": 8.5
        },
        "tap_drill_for_percent": {
            "in": 0.33616,
            "mm": 8.5386,
            "value": 8.5386
        },
        "standard_thread_percent": 77,
        "requested_thread_percent": 75
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:07.411Z",
        "request_id": "47c56489-3870-439e-9e3c-0b9f4542e2b0"
    },
    "status": "ok",
    "message": "Tap drill size",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/thread-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "api": "thread",
        "note": "Screw-thread geometry — computed locally and deterministically, no key, no third-party service.",
        "endpoints": [
            "/v1/pitch",
            "/v1/dimensions",
            "/v1/tapdrill",
            "/v1/meta"
        ],
        "thread_form": "60° ISO metric / Unified (UTS)"
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:07.497Z",
        "request_id": "5d046825-de73-4340-b47b-f38481d20e29"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/thread-api
OpenAPI spec: https://www.oanor.com/api/thread-api/openapi.json
