# Belt Drive API
> Belt-drive and pulley maths as an API, computed locally and deterministically. The belt endpoint computes the length of an open V-belt or flat belt from the two pulley diameters and the centre distance with L = 2C + (π/2)(D1+D2) + (D1−D2)²/(4C), and returns the belt length plus the wrap (contact) angle on each pulley; pass a driver rpm and it also gives the belt surface speed. The ratio endpoint computes the speed ratio of a pulley pair (driven ÷ driver diameter, since N1·D1 = N2·D2): give a driver or driven rpm and it returns the other, the torque ratio and the belt speed. The centers endpoint reverses the length equation to find the centre distance for a target belt length, solving the equation numerically. Diameters and distances accept millimetres, centimetres, metres, inches or feet, and lengths are reported in several units. Everything is computed locally and deterministically, so it is instant and private. Ideal for machine and drivetrain design tools, maintenance and MRO apps, maker and CNC projects, and mechanical-engineering calculators. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is belt-and-pulley power transmission; for bicycle gear ratios and development use a bike-gear API and for bolt tightening torque 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/beltdrive-api/..."
```

## Pricing
- **Free** (Free) — 13,935 calls/Mo, 2 req/s
- **Starter** ($16/Mo) — 23,650 calls/Mo, 8 req/s
- **Pro** ($36/Mo) — 286,500 calls/Mo, 20 req/s
- **Mega** ($74/Mo) — 1,475,000 calls/Mo, 50 req/s

## Endpoints

### Belt

#### `GET /v1/belt` — Belt length from diameters & centres

**Parameters:**
- `diameter_1` (query, required, string) — First pulley diameter Example: `200`
- `diameter_2` (query, required, string) — Second pulley diameter Example: `100`
- `center_distance` (query, required, string) — Centre distance (C) Example: `500`
- `unit` (query, optional, string) — mm|cm|m|in|ft (default mm) Example: `mm`
- `rpm` (query, optional, string) — Driver rpm (for belt speed) Example: `1450`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/beltdrive-api/v1/belt?diameter_1=200&diameter_2=100&center_distance=500&unit=mm&rpm=1450"
```

**Response:**
```json
{
    "data": {
        "unit": "mm",
        "formula": "L = 2C + (π/2)(D1+D2) + (D1−D2)²/(4C) (open belt).",
        "belt_speed": {
            "m_s": 15.1844,
            "ft_min": 2989,
            "driver_rpm": 1450,
            "on_diameter": "diameter_1"
        },
        "belt_length": {
            "m": 1.47624,
            "in": 58.12,
            "mm": 1476.24,
            "unit": "mm",
            "value": 1476.239
        },
        "diameter_large": {
            "m": 0.2,
            "in": 7.874,
            "mm": 200,
            "unit": "mm",
            "value": 200
        },
        "diameter_small": {
            "m": 0.1,
            "in": 3.937,
            "mm": 100,
            "unit": "mm",
            "value": 100
        },
        "center_distance": {
            "m": 0.5,
            "in": 19.685,
            "mm": 500,
            "unit": "mm",
            "value": 500
        },
        "wrap_angle_large_pulley_deg": 191.48,
        "wrap_angle_small_pulley_deg": 168.52
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:07.616Z",
        "request_id": "dd6ee1a8-a564-43a0-92b4-fc21cfd72097"
    },
    "status": "ok",
    "message": "Belt length from diameters & center distance",
    "success": true
}
```

#### `GET /v1/centers` — Centre distance from belt length

**Parameters:**
- `diameter_1` (query, required, string) — First pulley diameter Example: `200`
- `diameter_2` (query, required, string) — Second pulley diameter Example: `100`
- `belt_length` (query, required, string) — Target belt length Example: `1476.24`
- `unit` (query, optional, string) — mm|cm|m|in|ft Example: `mm`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/beltdrive-api/v1/centers?diameter_1=200&diameter_2=100&belt_length=1476.24&unit=mm"
```

**Response:**
```json
{
    "data": {
        "note": "Center distance solved by inverting the open-belt length equation (bisection).",
        "unit": "mm",
        "belt_length": {
            "m": 1.47624,
            "in": 58.12,
            "mm": 1476.24,
            "unit": "mm",
            "value": 1476.24
        },
        "diameter_large": {
            "m": 0.2,
            "in": 7.874,
            "mm": 200,
            "unit": "mm",
            "value": 200
        },
        "diameter_small": {
            "m": 0.1,
            "in": 3.937,
            "mm": 100,
            "unit": "mm",
            "value": 100
        },
        "center_distance": {
            "m": 0.5,
            "in": 19.685,
            "mm": 500,
            "unit": "mm",
            "value": 500.001
        }
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:07.707Z",
        "request_id": "291206aa-ea57-4a3b-a4cd-41faf2ce4c8c"
    },
    "status": "ok",
    "message": "Center distance from belt length",
    "success": true
}
```

#### `GET /v1/ratio` — Pulley speed ratio & belt speed

**Parameters:**
- `driver_diameter` (query, required, string) — Driver pulley diameter Example: `100`
- `driven_diameter` (query, required, string) — Driven pulley diameter Example: `250`
- `driver_rpm` (query, optional, string) — Driver rpm (to get driven) Example: `1450`
- `driven_rpm` (query, optional, string) — Or driven rpm (to get driver)
- `unit` (query, optional, string) — mm|cm|m|in|ft Example: `mm`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/beltdrive-api/v1/ratio?driver_diameter=100&driven_diameter=250&driver_rpm=1450&unit=mm"
```

**Response:**
```json
{
    "data": {
        "note": "N1·D1 = N2·D2. Speed ratio = driven÷driver diameter; the driven pulley turns slower by this factor and its torque rises by it.",
        "unit": "mm",
        "belt_speed": {
            "m_s": 7.5922,
            "ft_min": 1494.5
        },
        "driven_rpm": 580,
        "driver_rpm": 1450,
        "ratio_label": "2.5:1",
        "speed_ratio": 2.5,
        "torque_ratio": 2.5,
        "driven_diameter": {
            "m": 0.25,
            "in": 9.843,
            "mm": 250,
            "unit": "mm",
            "value": 250
        },
        "driver_diameter": {
            "m": 0.1,
            "in": 3.937,
            "mm": 100,
            "unit": "mm",
            "value": 100
        }
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:07.796Z",
        "request_id": "c94b1549-c211-4802-80f7-7740b70558b2"
    },
    "status": "ok",
    "message": "Pulley speed ratio & belt speed",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "beltdrive",
        "note": "Belt-drive (pulley) maths — computed locally and deterministically, no key, no third-party service.",
        "endpoints": [
            "/v1/belt",
            "/v1/ratio",
            "/v1/centers",
            "/v1/meta"
        ],
        "length_units": [
            "mm",
            "cm",
            "m",
            "in",
            "inch",
            "ft"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:07.882Z",
        "request_id": "5bdc49b0-bfba-480d-8d5a-93e4908606b6"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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