Historical data

Through our API we provide hourly historical weather data for cities and historical data from weather stations. Find more about historical data availability in price-list.

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/

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=hour

Only 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,UK

By geographic coordinates

Description:
Call historical data by city name.
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.65


History Bulk

We have recently announced the History Bulk functionality that allows to extract historical data per city for 5 years in the past. For accessing this feature please click the next link. The detailed documentation can be found here.



Weather parameters in API respond for hourly historical data for cities

If you do not see some of the parameters in your API respond 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 respond.

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:
  • coord
    • coord.lon City geo location, longitude
    • coord.lat City geo location, latitude
  • weather (more info Weather condition codes)
    • weather.id Weather condition id
    • weather.main Group of weather parameters (Rain, Snow, Extreme etc.)
    • weather.description Weather condition within the group
    • weather.icon Weather icon id
  • base Internal parameter
  • main
    • main.temp Temperature. The temperature is provided only in Kelvins
    • main.pressure Atmospheric pressure (on the sea level, if there is no sea_level or grnd_level data), hPa
    • main.humidity Humidity, %
    • main.temp_min Minimum 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_max Maximum 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_level Atmospheric pressure on the sea level, hPa
    • main.grnd_level Atmospheric pressure on the ground level, hPa
  • wind
    • wind.speed Wind speed. Unit: meter/sec.
    • wind.deg Wind direction, degrees (meteorological)
  • clouds
    • clouds.all Cloudiness, %
  • rain
    • rain.1h Rain volume for the last 1 hour
    • rain.3h Rain volume for the last 3 hours
  • snow
    • snow.1h Snow volume for the last 1 hour
    • snow.3h Snow volume for the last 3 hours
  • dt Time of data calculation, unix, UTC
  • id City ID
  • name City name
  • cod Internal parameter

Rain item is showing "1h" in the case when data are received from weather stations directly.
The fact is that some METAR stations do not have precipitation indicators or do not measure precipitation conditions due to some other technical reasons.
In this case, we use model data. So, rain item is showing "3h" when our system returns an API response based on model data.


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 respond:
"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

Accumulated weather data

This API service is included in the Historical subscriptions by default with the appropriate time limits. Please contact us if you would like to use this API separately.

Accumulated temperature

Description:
Call accumulated temperature data by city ID, city name and geo coordinates.
API call:

http://history.openweathermap.org/data/2.5/history/accumulated_temperature?id={city ID}&start={start}&end={end}&threshold={threshold}

http://history.openweathermap.org/data/2.5/history/accumulated_temperature?q={city name}&start={start}&end={end}&threshold={threshold}

http://history.openweathermap.org/data/2.5/history/accumulated_temperature?lat={lat}&lon={lon}&start={start}&end={end}&threshold={threshold}

Parameters:

ID city ID

q city name and country code divided by comma, use ISO 3166 country codes

lat, lon coordinates of the location of your interest

start start date (unix time, UTC time zone), e.g. start=1483218000

end end date (unix time, UTC time zone), e.g. end=1504213200

threshold all values smaller than indicated value are not taken into account

Exmaples of API calls:

http://history.openweathermap.org/data/2.5/history/accumulated_temperature?id=2885679&start=1505336400&end=1505941200&threshold=284

Example of API response:
{
"date": "2017-9-13",
"temp": 288.93,
"count": 1
},
Parameters:
  • date date
  • temp temperature accumulated indicator
  • count number of data measurements

The temperature is provided only in Kelvins.

Accumulated precipitation

Description:
Call accumulated precipitation data by city ID, city name and geo coordinates.
API call:

http://history.openweathermap.org/data/2.5/history/accumulated_precipitation?id={city ID}&start={start}&end={end}

http://history.openweathermap.org/data/2.5/history/accumulated_precipitation?q={city name}&start={start}&end={end}

http://history.openweathermap.org/data/2.5/history/accumulated_precipitation?lat={lat}&lon={lon}&start={start}&end={end}

Parameters:

ID city ID

q city name and country code divided by comma, use ISO 3166 country codes

lat, lon coordinates of the location of your interest

start start date (unix time, UTC time zone), e.g. start=1483218000

end end date (unix time, UTC time zone), e.g. end=1504213200

Exmaples of API calls:

http://history.openweathermap.org/data/2.5/history/accumulated_precipitation?id=2885679&start=1505336400&end=1505941200

Example of API response:
{
"date": "2017-5-2",
"rain": 155.02,
"count": 367
}
Parameters:
  • date date
  • rain precipitation accumulation indicator
  • count number of data measurements

The threshold parameter is not used. The whole ammount of precipitation data is provided for specified period. Precipitation data is provided in mm.