# Wind Power API
> Wind-turbine power maths as an API, computed locally and deterministically. The power endpoint applies the wind-power equation P = ½ · ρ · A · v³ · Cp: from the wind speed, the rotor (given as swept area, diameter or blade length) and an optional air density and power coefficient, it returns the total power in the wind, the Betz maximum (the theoretical 16/27 ≈ 59.3 % limit) and the power actually extracted at the chosen coefficient — in watts, kilowatts, megawatts and horsepower. The energy endpoint multiplies power by time and an optional capacity factor to give the energy produced in watt-, kilowatt- and megawatt-hours, taking the power directly or deriving it from the wind and rotor. The sweptarea endpoint is a geometry helper: swept area from a diameter, radius or blade length, plus the blade-tip speed and tip-speed ratio from an rpm. Wind speed accepts metres per second, km/h, mph or knots; air density defaults to 1.225 kg/m³ at sea level. Because power scales with the cube of wind speed and the square of rotor diameter, small changes move it a lot — the API shows every intermediate value. Everything is computed locally and deterministically, so it is instant and private. Ideal for renewable-energy and engineering tools, education and physics apps, site-assessment and feasibility calculators, and STEM projects. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is wind-turbine power physics; for the Beaufort wind scale use a wind-scale API and for solar arrays use a solar 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/windpower-api/..."
```

## Pricing
- **Free** (Free) — 12,935 calls/Mo, 2 req/s
- **Starter** ($14/Mo) — 22,550 calls/Mo, 8 req/s
- **Pro** ($34/Mo) — 275,500 calls/Mo, 20 req/s
- **Mega** ($72/Mo) — 1,420,000 calls/Mo, 50 req/s

## Endpoints

### Wind

#### `GET /v1/energy` — Energy produced over time

**Parameters:**
- `power_kw` (query, optional, string) — Power (or wind_speed+rotor)
- `power_watts` (query, optional, string) — Or power in watts
- `wind_speed` (query, optional, string) — Or derive from wind Example: `12`
- `diameter` (query, optional, string) — Rotor diameter (if deriving) Example: `100`
- `hours` (query, optional, string) — Hours (or days) Example: `24`
- `days` (query, optional, string) — Or days
- `capacity_factor` (query, optional, string) — CF 0-1 (default 1) Example: `0.35`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/windpower-api/v1/energy?wind_speed=12&diameter=100&hours=24&capacity_factor=0.35"
```

**Response:**
```json
{
    "data": {
        "note": "Energy = power × hours × capacity_factor. capacity_factor defaults to 1 (continuous at this power); real turbines average ~0.25–0.45.",
        "hours": 24,
        "energy": {
            "watt_hours": 27930518.3,
            "kilowatt_hours": 27930.518,
            "megawatt_hours": 27.930518
        },
        "derived_from": {
            "swept_area_m2": 7853.982,
            "power_coefficient": 0.4,
            "from_wind_speed_ms": 12
        },
        "capacity_factor": 0.35,
        "rated_power_watts": 3325061.7
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:11.586Z",
        "request_id": "8aa12366-f2ce-4959-9e3f-36d610e46c2e"
    },
    "status": "ok",
    "message": "Energy produced over time",
    "success": true
}
```

#### `GET /v1/power` — Instantaneous turbine power

**Parameters:**
- `wind_speed` (query, required, string) — Wind speed Example: `12`
- `speed_unit` (query, optional, string) — ms|kmh|mph|knots Example: `ms`
- `diameter` (query, optional, string) — Rotor diameter (or radius/swept_area) Example: `100`
- `radius` (query, optional, string) — Or blade length / radius
- `swept_area` (query, optional, string) — Or swept area (m²)
- `air_density` (query, optional, string) — Air density (default 1.225)
- `power_coefficient` (query, optional, string) — Cp 0-1 (default 0.4) Example: `0.4`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/windpower-api/v1/power?wind_speed=12&speed_unit=ms&diameter=100&power_coefficient=0.4"
```

**Response:**
```json
{
    "data": {
        "note": "P = 0.5 × air_density × swept_area × wind_speed³ × Cp. Power in wind uses Cp=1; Betz maximum is 16/27 ≈ 0.593.",
        "betz_limit": 0.5926,
        "air_density": 1.225,
        "betz_maximum": {
            "watts": 4926017.3,
            "kilowatts": 4926.0173,
            "megawatts": 4.926017,
            "horsepower": 6605.898
        },
        "power_in_wind": {
            "watts": 8312654.2,
            "kilowatts": 8312.6542,
            "megawatts": 8.312654,
            "horsepower": 11147.453
        },
        "swept_area_m2": 7853.982,
        "wind_speed_ms": 12,
        "rotor_radius_m": 50,
        "extracted_power": {
            "watts": 3325061.7,
            "kilowatts": 3325.0617,
            "megawatts": 3.325062,
            "horsepower": 4458.981
        },
        "power_coefficient": 0.4
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:11.678Z",
        "request_id": "44625a06-9d4f-4019-a672-dd0545397d4c"
    },
    "status": "ok",
    "message": "Instantaneous wind-turbine power",
    "success": true
}
```

#### `GET /v1/sweptarea` — Swept area & tip speed

**Parameters:**
- `diameter` (query, optional, string) — Rotor diameter (or radius/swept_area) Example: `100`
- `radius` (query, optional, string) — Or radius / blade length
- `swept_area` (query, optional, string) — Or swept area
- `rpm` (query, optional, string) — Rotor rpm (for tip speed) Example: `15`
- `wind_speed` (query, optional, string) — Wind speed (for tip-speed ratio) Example: `12`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/windpower-api/v1/sweptarea?diameter=100&rpm=15&wind_speed=12"
```

**Response:**
```json
{
    "data": {
        "note": "Swept area A = π r². Tip speed = 2π r × rpm / 60. Tip-speed ratio = tip speed ÷ wind speed.",
        "source": "diameter",
        "tip_speed_ms": 78.54,
        "swept_area_m2": 7853.9816,
        "tip_speed_kmh": 282.74,
        "rotor_radius_m": 50,
        "tip_speed_ratio": 6.545,
        "rotor_diameter_m": 100
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:11.751Z",
        "request_id": "aa53dbd6-a90e-4995-bc40-f0ecdf422846"
    },
    "status": "ok",
    "message": "Rotor swept area & tip speed",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "windpower",
        "note": "Wind-turbine power maths — computed locally and deterministically, no key, no third-party service.",
        "constants": {
            "betz_limit": 0.5925925925925926,
            "air_density_sea_level": 1.225,
            "default_power_coefficient": 0.4
        },
        "endpoints": [
            "/v1/power",
            "/v1/energy",
            "/v1/sweptarea",
            "/v1/meta"
        ],
        "speed_units": [
            "ms",
            "m/s",
            "mps",
            "kmh",
            "km/h",
            "kph",
            "mph",
            "kn",
            "knot",
            "knots"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:11.840Z",
        "request_id": "e387d66e-ba2e-426a-a59e-2ebf308a0479"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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