# Tire Calculator API
> Tire maths as an API, computed locally and deterministically — the size, pressure and speedometer numbers a driver, fitter or fleet manager works out before fitting a tyre. The size endpoint turns a P-metric spec into the real dimensions: overall diameter = rim + 2 × the sidewall (section width × aspect ratio), so a 225/45R17 stands about 25 inches tall, rolls a 78-inch circumference and turns roughly 808 times a mile — the numbers behind fitment, gearing and clearance. The pressure endpoint gives the hot pressure from a cold pressure and the temperature change, because pressure tracks absolute temperature (P2/P1 = T2/T1), about +1 psi per 10 °F — so 32 psi set cold at 70 °F reads ~34.6 after warming to 100 °F, and drops on a cold morning, which is what trips the warning light. The speedo-error endpoint gives the speedometer error and true speed from a tyre-size change: a taller tyre makes the speedo read low, so actual speed = indicated × new diameter ÷ old — go up 4 % and 60 on the dial is really 62.5. Everything is computed locally and deterministically, so it is instant and private. Ideal for tyre-shop and fitment apps, fleet and 4x4 build tools, speedo-recalibration calculators, and automotive sites. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 compute endpoints. Estimates — always set pressure cold to the placard.

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

## Pricing
- **Free** (Free) — 600 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 15,500 calls/Mo, 8 req/s
- **Pro** ($16/Mo) — 95,000 calls/Mo, 20 req/s
- **Mega** ($49/Mo) — 310,000 calls/Mo, 48 req/s

## Endpoints

### Tire

#### `GET /v1/pressure` — Hot pressure from temperature

**Parameters:**
- `cold_pressure_psi` (query, required, string) — Cold (set) pressure in psi Example: `32`
- `cold_temp_f` (query, required, string) — Cold temperature °F Example: `70`
- `hot_temp_f` (query, required, string) — Hot/operating temperature °F Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tire-api/v1/pressure?cold_pressure_psi=32&cold_temp_f=70&hot_temp_f=100"
```

**Response:**
```json
{
    "data": {
        "note": "Tire pressure tracks absolute temperature (P2/P1 = T2/T1 with pressure as absolute, temperature in Rankine) — roughly +1 psi for every 10 °F. Always set the placard pressure COLD; checking after a drive reads high. Cold mornings drop it, which is why the warning light pops on the first frost.",
        "inputs": {
            "hot_temp_f": 100,
            "cold_temp_f": 70,
            "cold_pressure_psi": 32
        },
        "hot_pressure_psi": 34.6,
        "pressure_change_psi": 2.6
    },
    "meta": {
        "timestamp": "2026-06-06T23:54:01.070Z",
        "request_id": "c922728a-79a5-4e5b-a501-797ecf051c67"
    },
    "status": "ok",
    "message": "Pressure",
    "success": true
}
```

#### `GET /v1/size` — Overall tire size

**Parameters:**
- `width_mm` (query, required, string) — Section width in mm Example: `225`
- `aspect_ratio` (query, required, string) — Aspect ratio (%) Example: `45`
- `rim_diameter_in` (query, required, string) — Rim diameter in inches Example: `17`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tire-api/v1/size?width_mm=225&aspect_ratio=45&rim_diameter_in=17"
```

**Response:**
```json
{
    "data": {
        "note": "Overall diameter = rim diameter + 2 × the sidewall height (section width × aspect ratio). A 225/45R17 stands about 25 inches tall and turns ~808 times a mile. The aspect ratio is the sidewall as a percentage of the width — a lower number is a shorter, sportier sidewall on the same rim.",
        "inputs": {
            "width_mm": 225,
            "aspect_ratio": 45,
            "rim_diameter_in": 17
        },
        "sidewall_in": 3.99,
        "revs_per_mile": 808,
        "circumference_in": 78.45,
        "overall_diameter_in": 24.97,
        "overall_diameter_mm": 634.3
    },
    "meta": {
        "timestamp": "2026-06-06T23:54:01.167Z",
        "request_id": "799d5db7-0e3e-4d6d-ad52-acfee9108c69"
    },
    "status": "ok",
    "message": "Tire size",
    "success": true
}
```

#### `GET /v1/speedo-error` — Speedometer error from size change

**Parameters:**
- `old_diameter_in` (query, required, string) — Old overall diameter in inches Example: `24.97`
- `new_diameter_in` (query, required, string) — New overall diameter in inches Example: `26`
- `indicated_speed` (query, optional, string) — Indicated speed (default 60) Example: `60`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tire-api/v1/speedo-error?old_diameter_in=24.97&new_diameter_in=26&indicated_speed=60"
```

**Response:**
```json
{
    "data": {
        "note": "A taller tire travels farther per turn, so the speedo (which counts turns) reads LOW and the odometer under-counts — actual speed = indicated × new diameter ÷ old. Go up 3 % in diameter and 60 on the dial is really ~62. Big changes need a speedo recalibration, and they shift gearing and clearance too.",
        "inputs": {
            "indicated_speed": 60,
            "new_diameter_in": 26,
            "old_diameter_in": 24.97
        },
        "error_pct": 4.12,
        "actual_speed": 62.5
    },
    "meta": {
        "timestamp": "2026-06-06T23:54:01.260Z",
        "request_id": "7132a1b5-58c0-4977-b7ba-ee3222e7b94f"
    },
    "status": "ok",
    "message": "Speedo error",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "US units (inches, psi, °F). Diameter = rim + 2×(width×aspect); pressure P2/P1 = T2/T1 (absolute, Rankine, ≈ +1 psi/10 °F); speedo actual = indicated × new ÷ old diameter. Estimates — set pressure cold.",
        "service": "tire-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/size": "Overall diameter, circumference and revs/mile from width/aspect/rim.",
            "GET /v1/pressure": "Hot pressure from a cold pressure and temperatures (gas law).",
            "GET /v1/speedo-error": "Speedometer error and actual speed from a tire-size change."
        },
        "description": "Tire maths: overall size from a P-metric spec, cold/hot pressure with temperature, and the speedometer error from a size change."
    },
    "meta": {
        "timestamp": "2026-06-06T23:54:01.366Z",
        "request_id": "35f70a14-e809-4217-baed-1f07e5e5e145"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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