# Winch Drum API
> Winch and cable-drum maths as an API, computed locally and deterministically — the rope-capacity, line-pull and rope-out numbers a winch operator, rigger or recovery driver works a drum with. The capacity endpoint gives the rope a drum holds by exact layer geometry: the sum over every full layer of the turns per layer × π × that layer's mean wrap diameter, where turns per layer = drum width ÷ rope diameter and the number of layers = the flange-to-barrel depth ÷ rope diameter — a 10-inch barrel, 20-inch flange, 12-inch-wide drum on half-inch rope holds about 940 ft over 10 layers. The layer-pull endpoint shows why pull falls as the drum fills: the rated pull is for the bare-drum first layer, and as rope piles on, the growing lever arm cuts the line pull and raises the line speed in the same ratio — pull × (first-layer diameter ÷ this layer's diameter) — so the top layer of a deep drum can pull barely half the bottom-layer rating, which is why you spool off to bare drum for a hard pull or add a snatch block. The length-at-layer endpoint gives the rope wound after a number of full layers, for marking the rope or knowing how much line is out. Everything is computed locally and deterministically, so it is instant and private. Ideal for winch- and hoist-sizing tools, recovery and off-road apps, marine and industrial-rigging utilities, and engineering calculators. Pure local computation — no key, no third-party service, instant. Geometric estimate — allow for nesting and freeboard. 3 compute endpoints. For capstan friction use a capstan API; for block-and-tackle a pulley 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/winch-api/..."
```

## Pricing
- **Free** (Free) — 4,850 calls/Mo, 2 req/s
- **Starter** ($12/Mo) — 49,000 calls/Mo, 6 req/s
- **Pro** ($40/Mo) — 205,500 calls/Mo, 15 req/s
- **Mega** ($122/Mo) — 1,108,000 calls/Mo, 40 req/s

## Endpoints

### Winch

#### `GET /v1/capacity` — Rope capacity, layers and turns

**Parameters:**
- `barrel_diameter_in` (query, required, string) — Barrel (core) diameter (in) Example: `10`
- `flange_diameter_in` (query, required, string) — Flange diameter (in) Example: `20`
- `drum_width_in` (query, required, string) — Drum width between flanges (in) Example: `12`
- `rope_diameter_in` (query, required, string) — Rope diameter (in) Example: `0.5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/winch-api/v1/capacity?barrel_diameter_in=10&flange_diameter_in=20&drum_width_in=12&rope_diameter_in=0.5"
```

#### `GET /v1/layer-pull` — Line pull and speed at a layer

**Parameters:**
- `bare_drum_pull_lb` (query, required, string) — Bare-drum (rated) line pull (lb) Example: `10000`
- `barrel_diameter_in` (query, required, string) — Barrel diameter (in) Example: `10`
- `rope_diameter_in` (query, required, string) — Rope diameter (in) Example: `0.5`
- `layer` (query, required, string) — Wrap layer number Example: `5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/winch-api/v1/layer-pull?bare_drum_pull_lb=10000&barrel_diameter_in=10&rope_diameter_in=0.5&layer=5"
```

#### `GET /v1/length-at-layer` — Rope length at a number of layers

**Parameters:**
- `barrel_diameter_in` (query, required, string) — Barrel diameter (in) Example: `10`
- `drum_width_in` (query, required, string) — Drum width (in) Example: `12`
- `rope_diameter_in` (query, required, string) — Rope diameter (in) Example: `0.5`
- `layers_wound` (query, required, string) — Full layers wound Example: `5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/winch-api/v1/length-at-layer?barrel_diameter_in=10&drum_width_in=12&rope_diameter_in=0.5&layers_wound=5"
```

### Meta

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

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


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