# Worm Gear API
> Worm-gear engineering maths as an API, computed locally and deterministically — the ratio, lead-angle and efficiency numbers a machine designer or millwright sizes a worm drive with. The ratio endpoint gives the reduction = wheel teeth ÷ worm starts, so a single-start worm on a 40-tooth wheel is a big 40:1 reduction in one compact stage — the high ratio in a small package is the whole appeal of a worm drive. The geometry endpoint gives the lead (= starts × axial pitch, with axial pitch = π × module) and the lead angle = atan(lead ÷ (π × worm pitch diameter)), and tests for self-locking: a small lead angle (roughly under 5–6° for typical steel-on-bronze) means the wheel cannot back-drive the worm — invaluable for hoists and holding loads, at the cost of efficiency. The efficiency endpoint gives the mesh efficiency when the worm drives = tan(lead angle) ÷ tan(lead angle + friction angle), which is low for the small lead angles that give big ratios — often 50–70 %, which is why worm gears run warm and need good lubrication — while high-lead multi-start worms reach 90 %+; when the lead angle drops to the friction angle the drive becomes self-locking. Everything is computed locally and deterministically, so it is instant and private. Ideal for mechanical-design and gearbox tools, machine-building and CAD utilities, and engineering calculators. Pure local computation — no key, no third-party service, instant. Confirm self-locking dynamically — vibration can unlock a marginal pair. 3 compute endpoints. For spur gears use a spur-gear API; for a general ratio a gear-ratio 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/wormgear-api/..."
```

## Pricing
- **Free** (Free) — 4,600 calls/Mo, 2 req/s
- **Starter** ($13/Mo) — 51,000 calls/Mo, 6 req/s
- **Pro** ($39/Mo) — 217,000 calls/Mo, 15 req/s
- **Mega** ($121/Mo) — 1,120,000 calls/Mo, 40 req/s

## Endpoints

### Worm

#### `GET /v1/efficiency` — Mesh efficiency (worm driving)

**Parameters:**
- `lead_angle_deg` (query, required, string) — Lead angle (degrees) Example: `3.814`
- `friction_coeff` (query, optional, string) — Friction coefficient (default 0.05) Example: `0.05`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wormgear-api/v1/efficiency?lead_angle_deg=3.814&friction_coeff=0.05"
```

**Response:**
```json
{
    "data": {
        "note": "Worm-drive efficiency (worm driving the wheel) = tan(lead angle) ÷ tan(lead angle + friction angle), where the friction angle = atan(μ). It is low for the small lead angles that give big ratios — often 50–70 % — which is why worm gears run warm and need good lubrication; multi-start, high-lead worms reach 90 %+. When the lead angle ≤ the friction angle the back-driving efficiency goes to zero: the drive is self-locking.",
        "inputs": {
            "friction_coeff": 0.05,
            "lead_angle_deg": 3.814
        },
        "self_locking": false,
        "efficiency_driving": 0.5695,
        "friction_angle_deg": 2.862,
        "efficiency_driving_pct": 56.95
    },
    "meta": {
        "timestamp": "2026-06-07T08:18:08.050Z",
        "request_id": "26e68854-7608-4049-855f-59ec4f986e47"
    },
    "status": "ok",
    "message": "Efficiency",
    "success": true
}
```

#### `GET /v1/geometry` — Lead angle and self-locking test

**Parameters:**
- `worm_starts` (query, required, string) — Worm starts (threads) Example: `1`
- `module_mm` (query, required, string) — Axial module (mm) Example: `2`
- `worm_pitch_diameter_mm` (query, required, string) — Worm pitch diameter (mm) Example: `30`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wormgear-api/v1/geometry?worm_starts=1&module_mm=2&worm_pitch_diameter_mm=30"
```

**Response:**
```json
{
    "data": {
        "note": "The lead = starts × axial pitch (π × module), and the lead angle = atan(lead ÷ (π × worm pitch diameter)). A small lead angle (roughly under 5–6° for typical steel-on-bronze) makes the drive self-locking — the wheel cannot back-drive the worm, useful for hoists and holding loads, but it caps efficiency. Bigger lead angles (multi-start, thin worm) drive more freely and efficiently but lose the self-locking. Confirm self-locking dynamically; vibration can unlock a marginal pair.",
        "inputs": {
            "module_mm": 2,
            "worm_starts": 1,
            "worm_pitch_diameter_mm": 30
        },
        "lead_mm": 6.283,
        "self_locking": true,
        "axial_pitch_mm": 6.283,
        "lead_angle_deg": 3.814
    },
    "meta": {
        "timestamp": "2026-06-07T08:18:08.119Z",
        "request_id": "10470bbd-2d28-4686-8cf6-9d835c3b884a"
    },
    "status": "ok",
    "message": "Worm geometry",
    "success": true
}
```

#### `GET /v1/ratio` — Gear ratio from starts and teeth

**Parameters:**
- `worm_starts` (query, required, string) — Worm starts (threads) Example: `1`
- `gear_teeth` (query, required, string) — Wheel teeth Example: `40`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wormgear-api/v1/ratio?worm_starts=1&gear_teeth=40"
```

**Response:**
```json
{
    "data": {
        "note": "A worm drive's ratio = wheel teeth ÷ worm starts (threads), and the worm turns the wheel one tooth per worm turn for a single start — so a single-start worm on a 40-tooth wheel is a big 40:1 reduction in one compact stage. More starts cut the ratio but raise the lead angle and efficiency. Drive is almost always worm-in, wheel-out: the high ratio and often self-locking action are the whole point.",
        "inputs": {
            "gear_teeth": 40,
            "worm_starts": 1
        },
        "gear_ratio": 40,
        "ratio_label": "40:1"
    },
    "meta": {
        "timestamp": "2026-06-07T08:18:08.193Z",
        "request_id": "4a36ea86-d93b-4c83-a036-44620cbd14ac"
    },
    "status": "ok",
    "message": "Gear ratio",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Metric (mm, °, %). ratio = teeth/starts; lead = starts·π·module; lead angle = atan(lead/(π·d)); efficiency = tan λ / tan(λ+φ), φ = atan μ; self-locking when λ ≤ φ. For spur gears use a spur-gear API; for a general ratio a gear-ratio API.",
        "service": "wormgear-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/ratio": "Gear ratio from worm starts and wheel teeth.",
            "GET /v1/geometry": "Lead, lead angle and self-locking from the worm geometry.",
            "GET /v1/efficiency": "Mesh efficiency (worm driving) from lead angle and friction."
        },
        "description": "Worm-gear maths: gear ratio, lead angle and self-locking test, and mesh efficiency."
    },
    "meta": {
        "timestamp": "2026-06-07T08:18:08.289Z",
        "request_id": "f7ab9973-e609-4207-907d-6e77a27f5edc"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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