# Towing Calculator API
> Trailer-towing weight maths as an API, computed locally and deterministically. The tongue endpoint computes the tongue (hitch) weight as a percentage of the loaded trailer weight and reports the recommended 10–15 % range — too little tongue weight is the main cause of trailer sway. The capacity endpoint computes the maximum trailer weight a tow vehicle can pull, GCWR − curb weight − payload (the passengers and cargo in the vehicle), and checks a proposed trailer against it with the margin remaining. The payload endpoint computes the vehicle payload still available once the trailer is hitched, GVWR − curb weight − tongue weight, since the tongue weight presses down on the tow vehicle and counts against its payload rating. Everything is computed locally and deterministically, so it is instant and private. Ideal for RV, caravan, trailer and fleet apps, tow-vehicle matching and load-planning tools, and automotive calculators. Pure local computation — no key, no third-party service, instant. Live, nothing stored. Guidance only — follow the manufacturer's ratings. 3 endpoints. This is trailer-towing weights; for tyre size and rolling circumference use a tyre 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/towing-api/..."
```

## Pricing
- **Free** (Free) — 3,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 20,000 calls/Mo, 5 req/s
- **Pro** ($24/Mo) — 120,000 calls/Mo, 15 req/s
- **Mega** ($69/Mo) — 600,000 calls/Mo, 40 req/s

## Endpoints

### Towing

#### `GET /v1/capacity` — Towing capacity

**Parameters:**
- `gcwr` (query, required, string) — Gross combined weight rating Example: `7000`
- `curb_weight` (query, required, string) — Tow-vehicle curb weight Example: `2000`
- `payload` (query, optional, string) — Passengers + cargo in vehicle Example: `400`
- `trailer_weight` (query, optional, string) — Proposed trailer weight to check Example: `4000`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/towing-api/v1/capacity?gcwr=7000&curb_weight=2000&payload=400&trailer_weight=4000"
```

**Response:**
```json
{
    "data": {
        "note": "Max trailer = GCWR − curb − payload (passengers and cargo in the tow vehicle). Stay within the rating.",
        "inputs": {
            "gcwr": 7000,
            "payload": 400,
            "curb_weight": 2000
        },
        "margin": 600,
        "trailer_weight": 4000,
        "within_capacity": true,
        "max_trailer_weight": 4600,
        "loaded_vehicle_weight": 2400
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:19.817Z",
        "request_id": "3240a73f-aa35-409f-92fd-7fa28cd8c521"
    },
    "status": "ok",
    "message": "Towing capacity",
    "success": true
}
```

#### `GET /v1/payload` — Vehicle payload

**Parameters:**
- `gvwr` (query, required, string) — Gross vehicle weight rating Example: `3000`
- `curb_weight` (query, required, string) — Curb weight Example: `2000`
- `tongue_weight` (query, optional, string) — Tongue weight Example: `360`
- `trailer_weight` (query, optional, string) — Or trailer weight to derive tongue
- `tongue_percent` (query, optional, string) — Tongue percentage (default 12) Example: `12`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/towing-api/v1/payload?gvwr=3000&curb_weight=2000&tongue_weight=360&tongue_percent=12"
```

**Response:**
```json
{
    "data": {
        "note": "Available payload = GVWR − curb − tongue weight. The trailer's tongue weight counts against the tow vehicle's payload.",
        "inputs": {
            "gvwr": 3000,
            "curb_weight": 2000,
            "tongue_weight": 360
        },
        "available_payload": 640,
        "payload_before_tongue": 1000
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:19.917Z",
        "request_id": "59a76526-a83a-4e12-b32a-6111308cbd57"
    },
    "status": "ok",
    "message": "Vehicle payload",
    "success": true
}
```

#### `GET /v1/tongue` — Tongue weight

**Parameters:**
- `trailer_weight` (query, required, string) — Loaded trailer weight Example: `3000`
- `tongue_percent` (query, optional, string) — Tongue percentage (default 12) Example: `12`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/towing-api/v1/tongue?trailer_weight=3000&tongue_percent=12"
```

**Response:**
```json
{
    "data": {
        "note": "Tongue weight should be 10–15 % of the loaded trailer weight for stable towing (too little causes sway).",
        "inputs": {
            "tongue_percent": 12,
            "trailer_weight": 3000
        },
        "tongue_weight": 360,
        "recommended_max": 450,
        "recommended_min": 300,
        "in_recommended_range": true
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:20.000Z",
        "request_id": "7aa30440-ad12-4e2f-bbf2-91c43a931ef2"
    },
    "status": "ok",
    "message": "Tongue weight",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "All weights in the same unit (kg or lb). GCWR = gross combined weight rating, GVWR = gross vehicle weight rating, curb = empty vehicle weight. Guidance only — follow the manufacturer's ratings.",
        "service": "towing-api",
        "formulae": {
            "tongue": "tongue = percent × trailer (10–15 % recommended)",
            "payload": "payload = GVWR − curb − tongue",
            "capacity": "max trailer = GCWR − curb − payload"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/tongue": "Tongue weight from the trailer weight and percentage, with the 10–15 % recommended range.",
            "GET /v1/payload": "Remaining vehicle payload = GVWR − curb − tongue weight.",
            "GET /v1/capacity": "Maximum trailer weight = GCWR − curb − payload, with a pass/fail check."
        },
        "description": "Trailer-towing weight calculator: tongue (hitch) weight, available trailer capacity from GCWR, and remaining vehicle payload after the tongue load."
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:20.102Z",
        "request_id": "c40b6b8d-4698-48b5-a5db-f3f233b7c2e7"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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