# Crosswind Calculator API
> Aviation runway wind-component maths as an API, computed locally and deterministically. The component endpoint resolves the surface wind into the two parts pilots care about for take-off and landing: the crosswind component perpendicular to the runway, wind·sin(θ), and the headwind (or tailwind) component along it, wind·cos(θ), where θ is the angle between the wind direction and the runway heading — give it the runway as a heading or a designator from 01 to 36, plus the wind direction and speed, and it returns the crosswind with the side it blows from (left or right), the headwind or tailwind, and the angle off; wind 30° off the nose at 20 knots is a 10-knot crosswind and a 17.3-knot headwind. The max-wind endpoint inverts it: the greatest total wind speed before a given crosswind limit is exceeded at a wind angle, limit / |sin θ|. Directions are in degrees (wind is where it comes FROM) and the speed unit is whatever you supply (knots, m/s). Everything is computed locally and deterministically, so it is instant and private. Ideal for aviation, pilot, flight-training, electronic-flight-bag, drone and weather-briefing app developers, runway-selection and crosswind-limit tools, and cockpit software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 2 endpoints. This is runway wind geometry; for the speed of sound and Mach number use a Mach API and for standard-atmosphere density a standard-atmosphere 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/crosswind-api/..."
```

## Pricing
- **Free** (Free) — 4,400 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 43,000 calls/Mo, 6 req/s
- **Pro** ($15/Mo) — 205,000 calls/Mo, 15 req/s
- **Mega** ($46/Mo) — 1,230,000 calls/Mo, 40 req/s

## Endpoints

### Crosswind

#### `GET /v1/component` — Crosswind & headwind components

**Parameters:**
- `runway` (query, optional, string) — Runway designator 01–36 Example: `09`
- `runway_heading` (query, optional, string) — Or runway heading (deg)
- `wind_direction` (query, required, string) — Wind direction (deg, FROM) Example: `120`
- `wind_speed` (query, required, string) — Wind speed (kt or m/s) Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/crosswind-api/v1/component?runway=09&wind_direction=120&wind_speed=20"
```

**Response:**
```json
{
    "data": {
        "note": "Crosswind = wind·sin(θ), headwind = wind·cos(θ), where θ is the angle between the wind direction and the runway heading. A 30° offset at 20 kt gives 10 kt crosswind and 17.3 kt headwind.",
        "inputs": {
            "wind_speed": 20,
            "runway_heading": 90,
            "wind_direction": 120
        },
        "headwind": 17.3205,
        "tailwind": 0,
        "crosswind": 10,
        "head_or_tail": "headwind",
        "angle_off_deg": 30,
        "crosswind_from": "right"
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:18.398Z",
        "request_id": "6d505d52-21c6-45cf-b6cd-2be86636e740"
    },
    "status": "ok",
    "message": "Wind components",
    "success": true
}
```

#### `GET /v1/max-wind` — Max wind for a crosswind limit

**Parameters:**
- `crosswind_limit` (query, required, string) — Crosswind limit Example: `15`
- `runway` (query, optional, string) — Runway designator 01–36 Example: `36`
- `wind_direction` (query, optional, string) — Wind direction (deg) Example: `040`
- `runway_heading` (query, optional, string) — Or runway heading (deg)
- `angle_off` (query, optional, string) — Or angle off directly (deg)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/crosswind-api/v1/max-wind?crosswind_limit=15&runway=36&wind_direction=040"
```

**Response:**
```json
{
    "data": {
        "note": "Max total wind = crosswind limit / |sin(θ)|. Beyond this the crosswind component exceeds the limit.",
        "inputs": {
            "angle_off_deg": 40,
            "crosswind_limit": 15
        },
        "max_wind_speed": 23.3359
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:18.499Z",
        "request_id": "b98aab51-ac99-46d4-84d0-5ba1db6ad90a"
    },
    "status": "ok",
    "message": "Max wind for limit",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Directions in degrees (0–360, where wind direction is where the wind comes FROM); runway as a heading or a designator 01–36 (tens of degrees). Wind speed unit is whatever you supply (kt, m/s…) and outputs match.",
        "service": "crosswind-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/max-wind": "Maximum total wind speed before a crosswind limit is exceeded.",
            "GET /v1/component": "Crosswind and head/tailwind from runway heading and wind."
        },
        "description": "Aviation wind components: crosswind and headwind/tailwind on a runway, and the maximum wind for a crosswind limit."
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:18.587Z",
        "request_id": "f8b21f4c-0da0-415b-93ab-0cfac21f530f"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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