# Boat Anchoring API
> Boat-anchoring maths as an API, computed locally and deterministically — the scope, swing and load numbers a sailor or boater sets the hook by. The scope endpoint gives the rode to let out: scope = rode ÷ the vertical from the seabed to the bow roller (water depth + bow height), measured at high tide, so anchoring in 20 feet with a 4-foot bow at the classic 7:1 means paying out 168 feet of rode — let out more in a blow, and never less than 5:1 on all chain. The swing endpoint gives the circle the boat swings on: radius = the horizontal reach of the rode (√(rode² − vertical²)) plus the boat length, so that 168-foot rode on a 30-foot boat sweeps a 196-foot radius — the room you must leave every other boat, which swings too. The load endpoint gives the wind load the ground tackle has to hold, 0.00256 × drag coefficient × frontal windage area × wind speed², which quadruples every time the wind doubles — 50 square feet of windage takes 138 lb at 30 mph but 553 lb at 60. Everything is computed locally and deterministically, so it is instant and private. Ideal for sailing and boating apps, anchoring and cruising tools, ground-tackle sizing calculators, and seamanship study aids. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 compute endpoints. Estimates — add current, waves and a safety margin.

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

## Pricing
- **Free** (Free) — 520 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 13,800 calls/Mo, 6 req/s
- **Pro** ($17/Mo) — 86,000 calls/Mo, 15 req/s
- **Mega** ($49/Mo) — 270,000 calls/Mo, 36 req/s

## Endpoints

### Anchor

#### `GET /v1/load` — Wind load on the boat

**Parameters:**
- `frontal_area_sqft` (query, required, string) — Frontal windage area in sq ft Example: `50`
- `wind_speed_mph` (query, required, string) — Wind speed in mph Example: `30`
- `drag_coefficient` (query, optional, string) — Drag coefficient (default 1.2) Example: `1.2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/anchor-api/v1/load?frontal_area_sqft=50&wind_speed_mph=30&drag_coefficient=1.2"
```

**Response:**
```json
{
    "data": {
        "note": "Wind load = 0.00256 × drag coefficient × frontal windage area × wind speed² (lb, mph) — and because it goes with the square of the wind, a doubling of wind quadruples the load. Add current and wave snatch on top, then size anchor, chain and snubber to the gusts, not the average. A bluff hull/rig is Cd ≈ 1.2.",
        "inputs": {
            "wind_speed_mph": 30,
            "drag_coefficient": 1.2,
            "frontal_area_sqft": 50
        },
        "wind_load_lb": 138
    },
    "meta": {
        "timestamp": "2026-06-06T23:54:01.818Z",
        "request_id": "d58d54ca-b60e-48e5-be9c-565e0dae1d69"
    },
    "status": "ok",
    "message": "Wind load",
    "success": true
}
```

#### `GET /v1/scope` — Rode to deploy for a scope ratio

**Parameters:**
- `depth_ft` (query, required, string) — Water depth in feet (at high tide) Example: `20`
- `bow_height_ft` (query, optional, string) — Bow-roller height above water (default 4) Example: `4`
- `scope_ratio` (query, optional, string) — Scope ratio (default 7) Example: `7`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/anchor-api/v1/scope?depth_ft=20&bow_height_ft=4&scope_ratio=7"
```

**Response:**
```json
{
    "data": {
        "note": "Scope = rode length ÷ the vertical from the seabed to the bow roller (water depth + bow height), and you measure it against the depth at HIGH tide. The classic all-chain minimum is 5:1 and rope/chain wants 7:1; in a blow let out more. Too little scope lifts the shank and the anchor drags.",
        "inputs": {
            "depth_ft": 20,
            "scope_ratio": 7,
            "bow_height_ft": 4
        },
        "vertical_ft": 24,
        "rode_to_deploy_ft": 168
    },
    "meta": {
        "timestamp": "2026-06-06T23:54:01.896Z",
        "request_id": "0a050da7-7ae0-43af-98a1-40ca246540b6"
    },
    "status": "ok",
    "message": "Scope",
    "success": true
}
```

#### `GET /v1/swing` — Swing circle around the anchor

**Parameters:**
- `rode_ft` (query, required, string) — Rode deployed in feet Example: `168`
- `depth_ft` (query, required, string) — Water depth in feet Example: `20`
- `bow_height_ft` (query, optional, string) — Bow height above water (default 4) Example: `4`
- `boat_length_ft` (query, required, string) — Boat length in feet Example: `30`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/anchor-api/v1/swing?rode_ft=168&depth_ft=20&bow_height_ft=4&boat_length_ft=30"
```

**Response:**
```json
{
    "data": {
        "note": "The boat swings on a circle of radius = the horizontal reach of the rode (√(rode² − vertical²)) plus the boat length. Leave at least this radius to every other boat and hazard — they swing too, and on different rodes they swing differently, so allow generous room and watch the wind shift.",
        "inputs": {
            "rode_ft": 168,
            "depth_ft": 20,
            "bow_height_ft": 4,
            "boat_length_ft": 30
        },
        "swing_radius_ft": 196.3,
        "swing_diameter_ft": 392.6,
        "horizontal_reach_ft": 166.3
    },
    "meta": {
        "timestamp": "2026-06-06T23:54:01.987Z",
        "request_id": "34b7d559-eb27-4861-aca6-01a30c608349"
    },
    "status": "ok",
    "message": "Swing circle",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "US units (feet, mph, lb). Rode = ratio × (depth + bow height); swing radius = √(rode² − vertical²) + boat length; wind load = 0.00256·Cd·A·V². Estimates — add current, waves and a safety margin; measure depth at high tide.",
        "service": "anchor-api",
        "endpoints": {
            "GET /v1/load": "Wind load on the boat (the holding force needed).",
            "GET /v1/meta": "This document.",
            "GET /v1/scope": "Rode to deploy for a scope ratio over depth + bow height.",
            "GET /v1/swing": "Swing radius and diameter around the anchor."
        },
        "description": "Boat-anchoring maths: the rode (scope) to let out, the swing circle around the anchor, and the wind load the ground tackle must hold."
    },
    "meta": {
        "timestamp": "2026-06-06T23:54:02.077Z",
        "request_id": "a1eb72eb-f9d6-44e0-aad5-b6fa863e5b16"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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