Historical weather API
We provide hourly historical weather data for cities via History API.
You can also download this data in JSON or CSV via History Bulk.
Please read Historical weather data or Historical Forecast weather data to learn more.
We have combined our Weather services and Satellite imagery in one simple and fast Agricultural API. Satellite images (True&False color, NDVI, EVI), Weather data (Current and Forecast), Hisorical data, Soil temperature and moisture, Accumulated temperature and precipitation, etc.
Try it right now!
Hourly historical data for cities
Availbility of hourly historical data archive depends on a type of your account. For more information please refer to the price.
Please remember that all Examples of API calls that listed on this page are just samples and do not have any connection to the real API service!
By city ID
Description:
Call historical data by city ID. API responds with exact result.
List of city IDs can be downloaded here http://bulk.openweathermap.org/sample/history.city.list.json.gz
API call:
http://history.openweathermap.org/data/2.5/history/city?id={id}&type=hour&start={start}&end={end}
http://history.openweathermap.org/data/2.5/history/city?id={id}&type=hour&start={start}&cnt={cnt}
Parameters:
id city ID
type type of the call, keep this parameter in the API call as 'hour'
start start date (unix time, UTC time zone), e.g. start=1369728000
end end date (unix time, UTC time zone), e.g. end=1369789200
cnt amount of returned data (one per hour, can be used instead of 'end')
Examples of API calls:
http://history.openweathermap.org/data/2.5/history/city?id=2885679&type=hourOnly for Starter and Medium tariffs: The maximum historical data depth in one API response is one week.
If you specify a historical data depth more than one week in the request, you will receive a historical data only for first week from start date in one API response.
If you want to get the historical data depth more than one week, then please use several queries.
By city name
Description:
Call historical data by city name.There is a possibility to receive a central district of the city/town with its own parameters (geographic coordinates/id/name) in API response. Example
API call:
http://history.openweathermap.org/data/2.5/history/city?q={city ID},{country code}&type=hour&start={start}&end={end}
http://history.openweathermap.org/data/2.5/history/city?q={city ID},{country code}&type=hour&start={start}&cnt={cnt}
Parameters:
q city name and country code divided by comma, use ISO 3166 country codes
type type of the call, keep this parameter in the API call as 'hour'
start start date (unix time, UTC time zone), e.g. start=1369728000
end end date (unix time, UTC time zone), e.g. end=1369789200
cnt amount of returned data (one per hour, can be used instead of 'end')
Exmaples of API calls:
http://history.openweathermap.org/data/2.5/history/city?q=London,UKBy geographic coordinates
Description:
Call historical data by geographic coordinates.API call:
http://history.openweathermap.org/data/2.5/history/city?lat={lat}&lon={lon}&type=hour&start={start}&end={end}
http://history.openweathermap.org/data/2.5/history/city?lat={lat}&lon={lon}&type=hour&start={start}&cnt={cnt}
Parameters:
lat, lon coordinates of the location of your interest
type type of the call, keep this parameter in the API call as 'hour'
start start date (unix time, UTC time zone), e.g. start=1369728000
end end date (unix time, UTC time zone), e.g. end=1369789200
cnt amount of returned data (one per hour, can be used instead of 'end')
Examples of API calls:
http://history.openweathermap.org/data/2.5/history/city?lat=41.85&lon=-87.65History Bulk
We have recently announced the History Bulk functionality that allows to extract historical data per city for 6 years in the past. For accessing this feature please click the next link. The detailed documentation can be found here.
Weather parameters in API response for hourly historical data for cities
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.
List of all API parameters with units openweathermap.org/weather-data
JSON
Example of API response:
{"coord":
{"lon":145.77,"lat":-16.92},
"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],
"base":"cmc stations",
"main":{"temp":293.25,"pressure":1019,"humidity":83,"temp_min":289.82,
"temp_max":295.37},
"wind":{"speed":5.1,"deg":150},
"clouds":{"all":75},
"rain":{"3h":3},
"dt":1435658272,
"sys":{"type":1,"id":8166,"message":0.0166,"country":"AU",
"sunrise":1435610796,"sunset":1435650870},
"id":2172797,
"name":"Cairns",
"cod":200}
Parameters:
-
coordcoord.lonCity geo location, longitudecoord.latCity geo location, latitude
-
weather(more info Weather condition codes)weather.idWeather condition idweather.mainGroup of weather parameters (Rain, Snow, Extreme etc.)weather.descriptionWeather condition within the groupweather.iconWeather icon id
baseInternal parameter-
mainmain.tempTemperature. The temperature is provided only in Kelvinsmain.pressureAtmospheric pressure (on the sea level, if there is no sea_level or grnd_level data), hPamain.humidityHumidity, %main.temp_minMinimum temperature at the moment. This is deviation from temperature that is possible for large cities and megalopolises geographically expanded (use these parameter optionally). The temperature is provided only in Kelvins.main.temp_maxMaximum temperature at the moment. This is deviation from temperature that is possible for large cities and megalopolises geographically expanded (use these parameter optionally). The temperature is provided only in Kelvins.main.sea_levelAtmospheric pressure on the sea level, hPamain.grnd_levelAtmospheric pressure on the ground level, hPa
-
windwind.speedWind speed. Unit: meter/sec.wind.degWind direction, degrees (meteorological)
-
cloudsclouds.allCloudiness, %
-
rainrain.1hRain volume for the last 1 hourrain.3hRain volume for the last 3 hours
-
snowsnow.1hSnow volume for the last 1 hoursnow.3hSnow volume for the last 3 hours
dtTime of data calculation, unix, UTC-
idCity ID -
nameCity name -
codInternal parameter
List of weather condition codes
List of weather condition codes with icons (range of thunderstorm, drizzle, rain, snow, clouds, atmosphere including extreme conditions like tornado, hurricane etc.)
Min/max temperature in historical weather API and forecast API
Please, do not confuse min/max parameters in hourly historical weather API and forecast API. In hourly historical weather API temp_min and temp_max are optional parameters mean min / max temperature in the city at the moment of calculation to show deviation from the average temperature just for your reference. For large cities and megalopolises geographically expanded it might be applicable. In most cases both temp_min and temp_max parameters have the same volume as 'temp'. Please, use temp_min and temp_max parameters optionally.
Example of historical weather for cities API response:
"main":{
"temp":306.15, // temperature at the moment of calculation
"pressure":1013,
"humidity":44,
"temp_min":306, //min temperature in the city at the moment of calculation
"temp_max":306 //max temperature in the city at the moment of calculation
},
For comparison look at example of daily forecast weather API response:
"dt":1406080800,
"temp":{
"day":297.77, //daily averaged temperature
"min":293.52, //daily min temperature
"max":297.77, //daily max temperature
"night":293.52, //night temperature
"eve":297.77, //evening temperature
"morn":297.77}, //morning temperature