5 and 16 day weather forecast

Both 5 day forecasts and 16 day forecasts are available at any location or city. 5 day forecasts include weather data every 3 hours and 16 day forecasts include daily weather. Forecasts are available in JSON, XML, or HTML format.

Call 5 day / 3 hour forecast data

By city name

Description:
You can seach weather forecast for 5 days with data every 3 hours by city name. All weather data can be obtained in JSON, XML or HTML format.
API call:
api.openweathermap.org/data/2.5/forecast?q={city name},{country code}
Parameters:

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

Examples of API calls:
api.openweathermap.org/data/2.5/forecast?q=London,us&mode=xml

By city ID

Description:
You can seach weather forecast for 5 days with data every 3 hours by city ID. All weather data can be obtained in JSON, XML or HTML format.
API call:
api.openweathermap.org/data/2.5/forecast?id={city ID}
Parameters:
id city ID
Examples of API calls:
api.openweathermap.org/data/2.5/forecast?id=524901

By geographic coordinats

Description:
You can seach weather forecast for 5 days with data every 3 hours by geographic coordinates. All weather data can be obtained in JSON, XML or HTML format.
API call:
api.openweathermap.org/data/2.5/forecast?lat={lat}&lon={lon}
Parameters:
lat, lon coordinates of the location of your interest
Examples of API calls:
api.openweathermap.org/data/2.5/forecast?lat=35&lon=139

Call 16 day / daily forecast data

By city name

Description:
You can seach 16 day weather forecast with daily average parameters by city name. All weather data can be obtained in JSON, XML or HTML format.
API call:
api.openweathermap.org/data/2.5/forecast/daily?q={city name},{country code}&cnt={cnt}
Parameters:

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

cnt number of days returned (from 1 to 16)

Examples of API calls:
Call 7 days forecast by city name in XML format and metric units api.openweathermap.org/data/2.5/forecast/daily?q=London&mode=xml&units=metric&cnt=7

By city ID

Description:
You can seach 16 day weather forecast with daily average parameters by city ID. All weather data can be obtained in JSON, XML or HTML format.
API call:
api.openweathermap.org/data/2.5/forecast/daily?id={city ID}&cnt={cnt}
Parameters:

id city ID

cnt number of days returned (from 1 to 16)

Examples of API calls:
api.openweathermap.org/data/2.5/forecast/daily?id=524901

By geographic coordinats

Description:
You can seach 16 day weather forecast with daily average parameters by geographic coordinats. All weather data can be obtained in JSON, XML or HTML format.
API call:
api.openweathermap.org/data/2.5/forecast/daily?lat={lat}&lon={lon}&cnt={cnt}
Parameters:

lat, lon coordinates of the location of your interest

cnt number of days returned (from 1 to 16)

Examples of API calls:
Call 10 days forecast by geographic coordinates api.openweathermap.org/data/2.5/forecast/daily?lat=35&lon=139&cnt=10

Bulk downloading

Description:

As a standard we provide number of bulk files with weather forecast.

You can find the following files in the list of bulk examples:

daily_14.json.gz - 12 days daily forecast. 22,000 cities. Updated 4 times per day.

daily_16.json.gz - 12 days daily forecast. 209,000 cities. Updated 1 time per day.

hourly_14.json.gz - 4 days forecast with 3 hour step. 22,000 cities. Updated 4 times per day.

hourly_16.json.gz - 4 days forecast with 3 hour step. 209,000 cities. Updated 1 time per day.

weather_14.json.gz - Current weather. 20,000 cities. Updated hourly.

forecast_canonical.csv.gz - forecast for 80,000 cities with Google Canonical ID

Bulk downloading is available for not the all accounts. To get more information please refer to the price.

Examples of bulk files:

http://bulk.openweathermap.org/sample/

Weather parameters in API respond

Lists of parameters

List of weather parameters for 5 days/3 hour forecast (city ID, city location, humidity, pressure, wind etc.)

List of weather parameters for 16 days/daily forecast (city ID, city location, humidity, day/night/evening/morning/min/max temperature, pressure, wind etc.)

List of weather condition codes with icons (range of thunderstorm, drizzle, rain, snow, clouds, atmosphere including extreme conditions like tornado, hurricane etc.)

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.


Min/max temperature in current weather API and forecast API

Please, do not confuse min/max parameters in current weather API and forecast API. In current weather API temp_min and temp_max are optional parameters mean min / max temperature in the city at the current moment to see deviation from current temp 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 in current weather API optionally.

Example of current weather API respond:
"main":{
"temp":306.15, //current temperature 
"pressure":1013,
"humidity":44,
"temp_min":306, //min current temperature in the city
"temp_max":306 //max current temperature in the city
},
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

Other features

Format

Description:

JSON format is used by default. To get data in XML or HTML formats just set up mode = xml or html.

Parameters:
mode - possible values are xml and html. If mode parameter is empty the format is JSON by default.
Examples of API calls:

JSON api.openweathermap.org/data/2.5/weather?q=London

XML api.openweathermap.org/data/2.5/weather?q=London&mode=xml

HTML api.openweathermap.org/data/2.5/weather?q=London&mode=html

Search accuracy

Description:

You can use our geocoding system to find cities by name, country, zip-code or geographic coordinates. You can call also by part of the city name. To make the result more accurate just put the city name and country divided by comma.

To set the accuracy level either use the 'accurate' or 'like' type parameter. 'accurate' returns exact match values. 'like' returns results by searching for that substring.

Call API by city ID instead of city name, city coordinates or zip code. In this case you get precise respond exactly for your city.
Parameters:

like close result

accurate accurate result

Examples of API calls:

Like api.openweathermap.org/data/2.5/find?q=London&type=like&mode=xml

Accurate api.openweathermap.org/data/2.5/find?q=London&type=accurate&mode=xml

Limitation of result

Description:

To limit number of listed cities please setup 'cnt' parameter that specifies the number of lines returned.

Parameters:
cnt number of lines in respond
Examples of API calls:

cnt=3 api.openweathermap.org/data/2.5/find?lat=57&lon=-2.15&cnt=3

Units format

Description:

Standard, metric, and imperial units are available.

Parameters:

units metric, imperial. When you do not use units parameter, format is Standard by default.

Temperature is available in Fahrenheit, Celsius and Kelvin units.

  • For temperature in Fahrenheit use units=imperial
  • For temperature in Celsius use units=metric
  • Temperature in Kelvin is used by default, no need to use units parameter in API call

List of all API parameters with units openweathermap.org/weather-data

Examples of API calls:

standard api.openweathermap.org/data/2.5/find?q=London

metric api.openweathermap.org/data/2.5/find?q=London&units=metric

imperial api.openweathermap.org/data/2.5/find?q=London&units=imperial

Multilingual support

Description:

You can use lang parameter to get the output in your language. We support the following languages that you can use with the corresponded lang values: English - en, Russian - ru, Italian - it, Spanish - es (or sp), Ukrainian - uk (or ua), German - de, Portuguese - pt, Romanian - ro, Polish - pl, Finnish - fi, Dutch - nl, French - fr, Bulgarian - bg, Swedish - sv (or se), Chinese Traditional - zh_tw, Chinese Simplified - zh (or zh_cn), Turkish - tr, Croatian - hr, Catalan - ca

API call:
http://api.openweathermap.org/data/2.5/forecast/daily?id=524901&lang={lang}
Parameters:
lang language code
Examples of API calls:
http://api.openweathermap.org/data/2.5/forecast/daily?id=524901&lang=zh_cn

Call back function for JavaScript code

Description:

To use JavaScript code you can transfer callback functionName to JSONP callback.

Examples of API calls:
api.openweathermap.org/data/2.5/weather?q=London,uk&callback=test