# Weather History API
> Decades of historical weather for any location on Earth, from 1940 to the present. Pull daily records — temperature highs, lows and means, apparent temperature, precipitation, rain, snowfall, wind speed, gusts and direction — or an hourly series with temperature, humidity, precipitation, wind, pressure and cloud cover, or a period summary with mean temperature, the hottest and coldest day, total precipitation and wet-day counts. Global coverage from the ERA5 reanalysis archive via Open-Meteo, delivered as tidy JSON through a fast, reliable API. Ideal for agriculture and energy, insurance and risk, climate research, construction and travel planning.

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

## Pricing
- **Free** (Free) — 1,000 calls/Mo, 1 req/s
- **Basic** ($3/Mo) — 30,000 calls/Mo, 5 req/s
- **Pro** ($8/Mo) — 250,000 calls/Mo, 15 req/s
- **Mega** ($19/Mo) — 1,500,000 calls/Mo, 40 req/s

## Endpoints

### History

#### `GET /v1/daily` — Daily historical weather

**Parameters:**
- `lat` (query, required, string) — Latitude -90..90 Example: `52.52`
- `lon` (query, required, string) — Longitude -180..180 Example: `13.41`
- `start` (query, required, string) — Start date YYYY-MM-DD (≥1940) Example: `2024-01-01`
- `end` (query, required, string) — End date YYYY-MM-DD (max 366 days) Example: `2024-01-07`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/weatherhistory-api/v1/daily?lat=52.52&lon=13.41&start=2024-01-01&end=2024-01-07"
```

**Response:**
```json
{
    "data": {
        "end": "2024-01-07",
        "days": [
            {
                "date": "2024-01-01",
                "rain_mm": 1.8,
                "temp_max_c": 7.3,
                "temp_min_c": 3.4,
                "snowfall_cm": 0,
                "temp_mean_c": 5.3,
                "apparent_max_c": 4,
                "apparent_min_c": -0.4,
                "precipitation_mm": 1.8,
                "windgusts_max_kmh": 36,
                "windspeed_max_kmh": 19.7,
                "wind_direction_deg": 218
            },
            {
                "date": "2024-01-02",
                "rain_mm": 6.8,
                "temp_max_c": 6.9,
                "temp_min_c": 2.5,
                "snowfall_cm": 0.3,
                "temp_mean_c": 4.4,
                "apparent_max_c": 4.1,
                "apparent_min_c": -1.3,
                "precipitation_mm": 7.2,
                "windgusts_max_kmh": 35.6,
                "windspeed_max_kmh": 20.2,
                "wind_direction_deg": 167
            },
            {
                "date": "2024-01-03",
                "rain_mm": 12.1,
                "temp_max_c": 10.6,
                "temp_min_c": 7.2,
                "snowfall_cm": 0,
                "temp_mean_c": 8.7,
                "apparent_max_c": 6.2,
                "apparent_min_c": 3.3,
                "precipitation_mm": 12.1,
                "windgusts_max_kmh": 47.9,
                "windspeed_max_kmh": 27.8,
                "wind_direction_d
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/hourly` — Hourly historical weather

**Parameters:**
- `lat` (query, required, string) — Latitude -90..90 Example: `52.52`
- `lon` (query, required, string) — Longitude -180..180 Example: `13.41`
- `start` (query, required, string) — Start date YYYY-MM-DD Example: `2024-06-01`
- `end` (query, required, string) — End date YYYY-MM-DD (max 31 days) Example: `2024-06-02`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/weatherhistory-api/v1/hourly?lat=52.52&lon=13.41&start=2024-06-01&end=2024-06-02"
```

**Response:**
```json
{
    "data": {
        "end": "2024-06-02",
        "count": 48,
        "start": "2024-06-01",
        "series": [
            {
                "time": "2024-06-01T00:00",
                "humidity_pct": 79,
                "pressure_hpa": 1009.4,
                "temperature_c": 15.7,
                "windspeed_kmh": 10.9,
                "cloudcover_pct": 97,
                "precipitation_mm": 0,
                "wind_direction_deg": 354
            },
            {
                "time": "2024-06-01T01:00",
                "humidity_pct": 82,
                "pressure_hpa": 1009.2,
                "temperature_c": 15.2,
                "windspeed_kmh": 8.6,
                "cloudcover_pct": 100,
                "precipitation_mm": 0,
                "wind_direction_deg": 358
            },
            {
                "time": "2024-06-01T02:00",
                "humidity_pct": 89,
                "pressure_hpa": 1008.9,
                "temperature_c": 15,
                "windspeed_kmh": 8.5,
                "cloudcover_pct": 100,
                "precipitation_mm": 0,
                "wind_direction_deg": 12
            },
            {
                "time": "2024-06-01T03:00",
                "humidity_pct": 94,
                "pressure_hpa": 1009.2,
                "temperature_c": 15.9,
                "windspeed_kmh": 7.1,
                "cloudcover_pct": 100,
                "precipitation_mm": 0,
                "wind_direction_deg": 30
            },
   
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/summary` — Period summary statistics

**Parameters:**
- `lat` (query, required, string) — Latitude -90..90 Example: `52.52`
- `lon` (query, required, string) — Longitude -180..180 Example: `13.41`
- `start` (query, required, string) — Start date YYYY-MM-DD Example: `2023-01-01`
- `end` (query, required, string) — End date YYYY-MM-DD Example: `2023-03-31`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/weatherhistory-api/v1/summary?lat=52.52&lon=13.41&start=2023-01-01&end=2023-03-31"
```

**Response:**
```json
{
    "data": {
        "end": "2023-03-31",
        "days": 90,
        "start": "2023-01-01",
        "latitude": 52.54833,
        "timezone": "Europe/Berlin",
        "longitude": 13.407822,
        "temperature_c": {
            "mean": 4.2,
            "lowest": {
                "date": "2023-02-07",
                "value": -7.8
            },
            "highest": {
                "date": "2023-03-18",
                "value": 17.2
            }
        },
        "precipitation_mm": {
            "total": 201,
            "wet_days": 45,
            "daily_avg": 2.2
        }
    },
    "meta": {
        "timestamp": "2026-05-30T18:16:58.602Z",
        "request_id": "bb038359-f29c-4330-903d-8b9149e3eda4"
    },
    "status": "ok",
    "message": "Summary retrieved",
    "success": true
}
```


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