Historical Weather API
Access weather records for any date and location going back to 1 January 2010.
Query temperature, precipitation, wind, humidity, and conditions for any single day or multi-day range (up to 30 days per request) from January 2010 to yesterday. Our AI layer validates and gap-fills historical records against multiple station networks, giving you a clean, consistent time series wherever you query.
What You Get with the Historical Weather API
14+ years of history
Records start from 1 January 2010, giving you over a decade of verifiable data for trend analysis.
Up to 30 days per request
Retrieve a date range in one call using dt and end_dt — no need to loop through day-by-day requests.
AI-validated & gap-filled
Missing station data is interpolated using neighbouring sources and AI quality checks, minimising nulls.
Hourly breakdown available
Each day includes an hourly array, so you can pinpoint the exact hour a temperature record was reached.
Same location syntax
Use city names, coordinates, postcodes, or IATA codes — consistent with all other WeatherAI.io endpoints.
Pattern analysis ready
Clean JSON output integrates directly with Python, R, and BI tools for climate and seasonality modelling.
Who Uses This API
From startups to enterprise teams, the Historical Weather API powers a wide range of real-world applications.
Insurance & risk underwriting
Validate claims and model risk by querying exact weather conditions on any historical date at any location.
Academic & climate research
Build long time-series datasets for papers, reports, and climate-change analyses without scraping raw station data.
Agriculture & yield modelling
Correlate historical weather patterns with crop yields to improve future predictions and risk pricing.
Legal & forensic investigation
Provide weather evidence for litigation — accident investigations, liability claims, and contract disputes.
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| q | string | Required | Location — city, lat/lon, postcode, or IP | Tokyo |
| dt | string | Required | Start date (YYYY-MM-DD, on or after 2010-01-01) | 2023-07-15 |
| end_dt | string | Optional | End date (max 30 days from dt) | 2023-07-20 |
| units | string | Optional | metric | imperial | both | metric |
Authenticate every request with the X-API-Key header.
Code Example
Request
curl "https://api.weatherai.io/v1/history?q=Tokyo&dt=2023-07-15&end_dt=2023-07-17&units=metric" \
-H "X-API-Key: your-api-key"Response
{
"location": { "name": "Tokyo", "country": "Japan" },
"history": [
{
"date": "2023-07-15",
"temperature": { "max": { "celsius": 35 }, "min": { "celsius": 27 }, "avg": { "celsius": 31 } },
"precipitation": { "mm": 2.4 },
"wind": { "maxKph": 22 },
"humidity": { "avg": 82 }
}
]
}Response Fields
| Field | Type | Description |
|---|---|---|
| location | object | Location name, coordinates, country, timezone |
| history[] | array | One object per day in the requested range |
| history[].date | string | Date in YYYY-MM-DD |
| history[].temperature.max/min/avg | object | Daily temperature range |
| history[].precipitation.mm | number | Total daily precipitation |
| history[].wind.maxKph | number | Maximum wind speed that day |
| history[].humidity.avg | number | Average relative humidity % |
| history[].hourly[] | array | Hourly conditions for each day |
Related APIs
Start Using the Historical Weather API Today
Create a free account and get your API key in under a minute. 50 free Premium calls per day. No credit card required.
Get Your Free API Key