# Bolt Circle API
> Bolt-circle (bolt pattern / PCD) geometry as an API, computed locally and deterministically. The coordinates endpoint lays out a set of equally spaced holes on a circle: from the bolt-circle diameter (or radius), the number of holes, an optional start angle, centre offset and direction, it returns the X and Y coordinate and angle of every hole, the angular step (360 ÷ number of holes) and the chord between adjacent holes — exactly what a CNC or drawing needs. The chord endpoint gives the straight-line distance between any two holes on the pattern using chord = 2·R·sin(central angle ÷ 2), taking the shorter way around. The diameter endpoint works in reverse: from a measured distance between two holes and the number of holes it recovers the bolt-circle diameter, so you can reverse-engineer an existing flange or wheel. Lengths are unit-agnostic — the output is in whatever unit you supply. Everything is computed locally and deterministically, so it is instant and private. Ideal for CNC and CAD tools, machining and fabrication apps, flange, wheel and hub design, and drilling-jig and robotics projects. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is bolt-circle geometry; for screw-thread pitch and tap drill use a thread API and for spur-gear geometry use a gear 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/boltcircle-api/..."
```

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

## Endpoints

### BoltCircle

#### `GET /v1/chord` — Distance between two holes

**Parameters:**
- `bolt_circle_diameter` (query, optional, string) — BCD (or radius) Example: `100`
- `radius` (query, optional, string) — Or radius
- `holes` (query, required, string) — Number of holes Example: `4`
- `hole_a` (query, optional, string) — First hole (default 1) Example: `1`
- `hole_b` (query, optional, string) — Second hole (default 2) Example: `3`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/boltcircle-api/v1/chord?bolt_circle_diameter=100&holes=4&hole_a=1&hole_b=3"
```

**Response:**
```json
{
    "data": {
        "note": "Chord = 2·R·sin(central angle / 2). Central angle = (holes apart) × 360/N.",
        "holes": 4,
        "hole_a": 1,
        "hole_b": 3,
        "steps_apart": 2,
        "adjacent_chord": 70.71068,
        "chord_distance": 100,
        "central_angle_deg": 180,
        "bolt_circle_diameter": 100
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:06.132Z",
        "request_id": "4e2d19c3-aa60-4c7e-8b10-b39759bc6c52"
    },
    "status": "ok",
    "message": "Distance between two holes",
    "success": true
}
```

#### `GET /v1/coordinates` — Hole positions on a bolt circle

**Parameters:**
- `bolt_circle_diameter` (query, optional, string) — BCD/PCD (or radius) Example: `100`
- `radius` (query, optional, string) — Or radius
- `holes` (query, required, string) — Number of holes Example: `4`
- `start_angle` (query, optional, string) — Start angle deg (default 0) Example: `0`
- `center_x` (query, optional, string) — Centre X (default 0) Example: `0`
- `center_y` (query, optional, string) — Centre Y (default 0) Example: `0`
- `direction` (query, optional, string) — ccw|cw (default ccw) Example: `ccw`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/boltcircle-api/v1/coordinates?bolt_circle_diameter=100&holes=4&start_angle=0&center_x=0&center_y=0&direction=ccw"
```

**Response:**
```json
{
    "data": {
        "note": "Holes equally spaced by 360/N. x = cx + R·cos θ, y = cy + R·sin θ. Adjacent chord = 2·R·sin(π/N).",
        "holes": 4,
        "center": {
            "x": 0,
            "y": 0
        },
        "radius": 50,
        "direction": "ccw",
        "coordinates": [
            {
                "x": 50,
                "y": 0,
                "hole": 1,
                "angle_deg": 0
            },
            {
                "x": 0,
                "y": 50,
                "hole": 2,
                "angle_deg": 90
            },
            {
                "x": -50,
                "y": 0,
                "hole": 3,
                "angle_deg": 180
            },
            {
                "x": 0,
                "y": -50,
                "hole": 4,
                "angle_deg": 270
            }
        ],
        "adjacent_chord": 70.71068,
        "angle_step_deg": 90,
        "start_angle_deg": 0,
        "bolt_circle_diameter": 100
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:06.237Z",
        "request_id": "54eb2292-92e3-49be-8bf9-d6bc8d5761cc"
    },
    "status": "ok",
    "message": "Hole positions on a bolt circle",
    "success": true
}
```

#### `GET /v1/diameter` — BCD from a measured chord

**Parameters:**
- `holes` (query, required, string) — Number of holes Example: `4`
- `chord` (query, required, string) — Measured distance between holes Example: `70.71`
- `steps_apart` (query, optional, string) — Holes apart measured (default 1) Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/boltcircle-api/v1/diameter?holes=4&chord=70.71&steps_apart=1"
```

**Response:**
```json
{
    "data": {
        "note": "R = chord / (2·sin(central angle / 2)). Use steps_apart for non-adjacent measured holes.",
        "holes": 4,
        "radius": 49.99952,
        "steps_apart": 1,
        "adjacent_chord": 70.71,
        "measured_chord": 70.71,
        "central_angle_deg": 90,
        "bolt_circle_diameter": 99.99904
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:06.328Z",
        "request_id": "b03bd7ec-341a-4cae-8187-2edf93a32b69"
    },
    "status": "ok",
    "message": "Bolt circle diameter from a chord",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "boltcircle",
        "note": "Bolt-circle (PCD) geometry — computed locally and deterministically, no key, no third-party service. Lengths are unit-agnostic (output matches input).",
        "endpoints": [
            "/v1/coordinates",
            "/v1/chord",
            "/v1/diameter",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:06.396Z",
        "request_id": "c2b02f10-ce47-4b5e-a025-f2c221754edc"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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