# Hammock Hang API
> Hammock-hang maths as an API, computed locally and deterministically — the suspension-force, ridgeline and strap-height numbers a camper or hammock hanger sets up by. It all comes back to the 30-degree rule. The force endpoint shows why: the tension in each suspension line is the occupant weight ÷ (2 × sin of the hang angle), so at a 30° hang each strap carries about one body weight, but flatten the hang to 15° and it jumps to roughly 1.9 times — which is what over-stresses straps, trees and your back when people pull a hammock drum-tight. The ridgeline endpoint sizes a structural ridgeline at about 83 % of the hammock length, the fixed line that reproduces that ~30° lay and the right sag on any pair of trees. The strapheight endpoint estimates how high to attach the straps from the distance between the trees and the seat height you want, since trees farther apart need higher anchor points to hold the angle. Everything is computed locally and deterministically, so it is instant and private. Ideal for camping, backpacking, outdoor-gear and hammock app developers, hang-calculator and trip-planning tools, and adventure software. Pure local computation — no key, no third-party service, instant. Weight and lengths in your own unit. Live, nothing stored. 3 compute endpoints.

## 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/hammock-api/..."
```

## Pricing
- **Free** (Free) — 6,960 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 55,300 calls/Mo, 6 req/s
- **Pro** ($12/Mo) — 227,300 calls/Mo, 15 req/s
- **Mega** ($38/Mo) — 1,337,000 calls/Mo, 40 req/s

## Endpoints

### Hammock

#### `GET /v1/force` — Suspension force at an angle

**Parameters:**
- `weight` (query, required, string) — Occupant weight Example: `200`
- `hang_angle_deg` (query, optional, string) — Hang angle from horizontal (default 30) Example: `30`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/hammock-api/v1/force?weight=200&hang_angle_deg=30"
```

#### `GET /v1/ridgeline` — Structural ridgeline length

**Parameters:**
- `hammock_length` (query, required, string) — Hammock length Example: `132`
- `ridgeline_percent` (query, optional, string) — Ridgeline % of length (default 83) Example: `83`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/hammock-api/v1/ridgeline?hammock_length=132&ridgeline_percent=83"
```

#### `GET /v1/strapheight` — Strap attach height

**Parameters:**
- `tree_distance` (query, required, string) — Distance between trees Example: `144`
- `sit_height` (query, optional, string) — Desired seat height (default 18) Example: `18`
- `hang_angle_deg` (query, optional, string) — Hang angle (default 30) Example: `30`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/hammock-api/v1/strapheight?tree_distance=144&sit_height=18&hang_angle_deg=30"
```

### Meta

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

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


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