# Catenary Cable API
> Catenary (hanging-cable) maths as an API, computed locally and deterministically. The sag endpoint solves the exact catenary for a cable hung between two level supports: from the span, the weight per unit length and either the horizontal tension or the sag, it returns the catenary parameter a = H/w, the sag a·(cosh(L/2a) − 1), the cable length 2a·sinh(L/2a), the minimum tension (the horizontal tension at the lowest point) and the maximum tension at the supports (H·cosh(L/2a)), plus the slack over the straight span. The parabolic endpoint gives the shallow-sag parabolic approximation — sag = w·L²/(8·H) — that is standard for overhead utility lines, and converts between sag and tension either way. The length endpoint returns the cable length for a given span and sag, with the parabolic value alongside for comparison. Forces and lengths are unit-agnostic but must be consistent (for example newtons, newtons per metre and metres). Everything is computed locally and deterministically, so it is instant and private. Ideal for power-line and transmission tools, zip-line and rigging apps, suspension and surveying calculators, and physics and engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is hanging-cable catenary maths; for rigging working load limits use a rigging API and for beam deflection use a beam 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/catenary-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 20,000 calls/Mo, 6 req/s
- **Pro** ($24/Mo) — 120,000 calls/Mo, 20 req/s
- **Mega** ($74/Mo) — 639,000 calls/Mo, 60 req/s

## Endpoints

### Catenary

#### `GET /v1/length` — Cable length from span & sag

**Parameters:**
- `span` (query, required, string) — Span L Example: `100`
- `sag` (query, required, string) — Sag d Example: `2.5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/catenary-api/v1/length?span=100&sag=2.5"
```

**Response:**
```json
{
    "data": {
        "sag": 2.5,
        "note": "Exact catenary arc length 2a·sinh(L/2a), with the parabolic approximation for comparison.",
        "span": 100,
        "slack": 0.16647,
        "catenary_parameter_a": 500.41611,
        "cable_length_catenary": 100.16647,
        "cable_length_parabolic": 100.16667
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:04.054Z",
        "request_id": "a20328f8-5820-4661-865c-82df7d5107b9"
    },
    "status": "ok",
    "message": "Cable length from sag",
    "success": true
}
```

#### `GET /v1/parabolic` — Parabolic sag approximation

**Parameters:**
- `span` (query, required, string) — Span L Example: `100`
- `weight_per_length` (query, required, string) — Weight per length w Example: `10`
- `horizontal_tension` (query, optional, string) — Horizontal tension H Example: `5000`
- `sag` (query, optional, string) — Or sag d

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/catenary-api/v1/parabolic?span=100&weight_per_length=10&horizontal_tension=5000"
```

**Response:**
```json
{
    "data": {
        "sag": 2.5,
        "note": "Parabolic approximation — accurate for shallow sag (sag ≲ 10% of span), as used for utility lines.",
        "span": 100,
        "formula": "sag = w·L²/(8·H); length ≈ L + 8·d²/(3·L); Tmax ≈ H + w·d.",
        "max_tension": 5025,
        "cable_length": 100.16667,
        "weight_per_length": 10,
        "horizontal_tension": 5000
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:04.154Z",
        "request_id": "81474ecc-1c19-43ee-9407-e0d4103353ab"
    },
    "status": "ok",
    "message": "Parabolic sag approximation",
    "success": true
}
```

#### `GET /v1/sag` — Catenary sag, length & tension

**Parameters:**
- `span` (query, required, string) — Horizontal span L Example: `100`
- `weight_per_length` (query, required, string) — Weight per unit length w Example: `10`
- `horizontal_tension` (query, optional, string) — Horizontal tension H (to get sag) Example: `5000`
- `sag` (query, optional, string) — Or sag d (to get tension)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/catenary-api/v1/sag?span=100&weight_per_length=10&horizontal_tension=5000"
```

**Response:**
```json
{
    "data": {
        "sag": 2.50208,
        "note": "Exact catenary with level supports. Min tension is the horizontal tension at the lowest point; max tension is at the supports.",
        "span": 100,
        "slack": 0.16675,
        "formula": "a = H/w; sag = a(cosh(L/2a) − 1); length = 2a·sinh(L/2a); Tmax = H·cosh(L/2a).",
        "max_tension": 5025.0208,
        "min_tension": 5000,
        "cable_length": 100.16675,
        "weight_per_length": 10,
        "horizontal_tension": 5000,
        "catenary_parameter_a": 500,
        "max_tension_location": "supports"
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:04.226Z",
        "request_id": "db5b29e6-902b-4636-adb6-6ec2688eb743"
    },
    "status": "ok",
    "message": "Catenary sag, length & tension",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "catenary",
        "note": "Catenary (hanging-cable) maths — computed locally and deterministically, no key, no third-party service. Level supports; lengths/forces are unit-agnostic but consistent.",
        "endpoints": [
            "/v1/sag",
            "/v1/parabolic",
            "/v1/length",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:04.310Z",
        "request_id": "c41ad406-ec04-4b14-a25e-f766c9d1f645"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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