History API Full archive
History API Full archive
This product provides the full archive of historical weather data by chosen location from 1 January 1979 till now. Weather data are available with 1-hour step.
There are 3 simple steps to get the historical archive for your location:
1. How to add a location to download list
To activate loading your data you should add your location to the download list by making an API call according to the following rules.
http://history.openweathermap.org/data/3.0/history/locations/create?lat={lat}&lon={lon}&appid={API key}Parameters | ||
|---|---|---|
| required | Latitude. If you need a geocoder to automatic convert city names and zip-codes to geo coordinates and the other way around, please use our Geocoding API |
| required | Longitude. If you need a geocoder to automatic convert city names and zip-codes to geo coordinates and the other way around, please use our Geocoding API |
| required | Your unique API key (you can always find it on your account page under the "API key" tab) |
http://history.openweathermap.org/data/3.0/history/locations/create?lat=51.8080&lon=-0.1257&appid={API key}{
"id": "53506193580c9bda6c38a1c6a67f5599", //location id
"lat": 52.808,
"lon": -0.1257,
"start": 283996800,
"end": 1597104000,
"created_at": "2020-08-11T15:51:23.377Z",
"status": "calculating"
},Errors | |
|---|---|
| An incorrect lat, lon or an already existing location was entered |
Please note:
2. How to get a list of all added locations and status of new locations
Before trying to get historical weather data by your created location (read the section 1), please make sure that weather data has been successfully downloaded for your location. To check the statuses of your locations please use this section.
http://history.openweathermap.org/data/3.0/history/locations?appid={API key}Location statuses | |
|---|---|
| Data for the new location is processing. Please wait. |
| Calculation for the new location has been successful. You can request historical weather data. Please read section 3 of the current document to learn more. |
| Internal error. Please contact our support team. |
3. How to get historical data for added location
http://history.openweathermap.org/data/3.0/history/result?id={location_id}&start={start_date}&end={end_date}&appid={API key}Parameters | ||
|---|---|---|
| required | Location ID, which you received when adding your unique location (please see section 1 of this documentation) |
| required | Any date from 1 January 1979 till 23:59 of the previous day, Unix, UTC |
| required | Any date from 1 January 1979 till 23:59 of the previous day, Unix, UTC |
| required | Your unique API key (you can always find it on your account page under the "API key" tab) |
To avoid receiving errors in the API response, please specify a time period of requested historical data less than 1 year in one API call.
{
"id": "7466e40670b7eccdd6c27cf9a78ea286",
"cnt": 278,
"list": [
{ "dt": 283996800,
"main": {
"temp": 268.6,
"feels_like": 261.48,
"pressure": 1010,
"humidity": 85,
"temp_min": 268.15,
"temp_max": 269.121
},
"wind": {
"speed": 6.2,
"deg": 350
},
"clouds": {
"all": 20
},
"weather": [
{
"id": 801,
"main": "Clouds",
"description": "few clouds",
"icon": "02n"
}
]
},
…
]
}Errors | |
|---|---|
| You have specified an ID of non-existent location |
| Calculation process has not yet ended, please see paragraph #2 of the current document) |
Historical data in the API response
If you do not see some of the parameters in your API response it means that these weather phenomena are just not happened for the time of measurement for the city or location chosen. Only really measured or calculated data is displayed in API response.
id Location IDcnt Technical fieldlistdt Time of data calculation, unix, UTCmainmain.temp Temperature, Kelvinsmain.feels_like Temperature, Kelvins. This temperature parameter accounts for the human perception of weathermain.pressure Atmospheric pressure, hPamain.humidity Humidity, %main.temp_min Minimum temperature within a large city or a megalopolis (optional parameter), Kelvinmain.temp_max Maximum temperature within a large city or a megalopolis (optional parameter), Kelvinswindwind.speed Wind speed. Unit: meter/sec.wind.deg Wind direction, degrees (meteorological)cloudsclouds.all Cloudiness, %rainrain.1h Rain volume for the last 1 hoursnowsnow.1h Snow volume for the last 1 hourweather (Full list of weather conditions)weather.id Weather condition idweather.main Group of weather parameters (Rain, Snow, Clouds etc.)weather.description Weather condition within the group. Please find more hereweather.icon Weather icon idWe provide a broad variety of products such as One Call API 3.0, Solar Irradiance & Energy Prediction service, Road Risk API, Air Pollution API and solutions for advanced weather parameters like solar irradiance data, UVI, dew point, government weather alerts, etc. Please review our product list page and find more info in the product documentation and pricing pages.
List of weather condition codes
List of weather condition codes with icons (range of thunderstorm, drizzle, rain, snow, clouds, atmosphere etc.)