16 day weather forecast

16 day forecasts is available at any location or city. Forecasts include daily weather and available in JSON, XML, or HTML format.

Call 16 day / daily forecast data

By city name

Description:
You can search 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. API responds with exact result. All weather data can be obtained in JSON, XML or HTML format.

List of city ID city.list.json.gz can be downloaded here http://bulk.openweathermap.org/sample/

We recommend to call API by city ID to get unambiguous result for your city.

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:

We provide number of bulk files with current weather and forecasts. More information is on the Bulk page

Bulk downloading is available not for 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

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.

JSON

Example of API repond:

{"cod":"200","message":0.0032,
"city":{"id":1851632,"name":"Shuzenji",
"coord":{"lon":138.933334,"lat":34.966671},
"country":"JP"},
"cnt":10,
"list":[{
    "dt":1406080800,
    "temp":{
        "day":297.77,
        "min":293.52,
        "max":297.77,
        "night":293.52,
        "eve":297.77,
        "morn":297.77},
    "pressure":925.04,
    "humidity":76,
    "weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],}
        ]}

Parameters:
  • city
    • city.id City ID
    • city.name City name
    • city.coord
      • city.coord.lat City geo location, latitude
      • city.coord.lon City geo location, longitude
    • city.country Country code (GB, JP etc.)
  • cod Internal parameter
  • message Internal parameter
  • cnt Number of lines returned by this API call
  • list
    • list.dt Time of data forecasted
    • list.temp
      • list.temp.day Day temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • list.temp.min Min daily temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • list.temp.max Max daily temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • list.temp.night Night temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • list.temp.eve Evening temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • list.temp.morn Morning temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
    • list.pressure Atmospheric pressure on the sea level, hPa
    • list.humidity Humidity, %
    • list.weather (more info Weather condition codes)
      • list.weather.id Weather condition id
      • list.weather.main Group of weather parameters (Rain, Snow, Extreme etc.)
      • list.weather.description Weather condition within the group
      • list.weather.icon Weather icon id
    • list.speed Wind speed. Unit Default: meter/sec, Metric: meter/sec, Imperial: miles/hour.
    • list.deg Wind direction, degrees (meteorological)
    • list.clouds Cloudiness, %

XML

Example of API repond:



 London
 
 GB
 
 



 
 0.0091
 



 




Parameters:
  • location
    • location.name City ID
    • location.type Prototype parameter
    • location.country Country code (GB, JP etc.)
    • location.timezone Prototype parameter
    • location.location
      • location.location.altitude City geo location, altitude above the sea level
      • location.location.latitude City geo location, latitude
      • location.location.longitude City geo location, longitude
      • location.location.geobase Prototype parameter
      • location.location.geobaseid Prototype parameter
  • meta
    • meta.lastupdate Prototype parameter
    • meta.calctime Speed of data calculation
    • meta.nextupdate Prototype parameter
  • sun
    • sun.rise Sunrise time
    • sun.set Sunset time
  • forecast
    • forecast.time
      • forecast.time.day Date of weather data forecasted
    • forecast.symbol
      • forecast.symbol.number Weather condition id
      • forecast.symbol.name Weather condition
      • forecast.symbol.var Weather icon id
    • forecast.precipitation
      • forecast.precipitation.value Precipitation volume for the last 3 hours, mm
      • forecast.precipitation.unit Period of measurements. Possilbe value is 1 hour, 3 hours.
      • forecast.precipitation.type Type of precipitation. Possible value is rain, snow.
    • forecast.windDirection
      • forecast.windDirection.deg Wind direction, degrees (meteorological)
      • forecast.windDirection.code Code of the wind direction. Possilbe value is WSW, N, S etc.
      • forecast.windDirection.name Full name of the wind direction.
    • forecast.windSpeed
      • forecast.windSpeed.mps Wind speed, mps
      • forecast.windSpeed.name Type of the wind
    • forecast.temperature
      • forecast.temperature.day Day temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • forecast.temperature.min Min daily temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • forecast.temperature.max Max daily temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • forecast.temperature.night Night temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • forecast.temperature.eve Evening temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • forecast.temperature.morn Morning temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
    • forecast.pressure
      • forecast.pressure.unit hPa
      • forecast.pressure.value Pressure value
    • forecast.humidity
      • forecast.humidity.unit %
      • forecast.humidity.value Humidity value
    • forecast.clouds
      • forecast.pressure.value Name of the cloudiness
      • forecast.pressure.all Cloudiness
      • forecast.pressure.unit %

List of 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 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