16 day weather forecast

16 day forecasts is available at any location or city. Forecasts include daily weather and available in JSON or XML format. It is only available for all paid accounts.

Call 16 day / daily forecast data

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 name

Description:
You can search 16 day weather forecast with daily average parameters by city name. All weather data can be obtained in JSON and XML formats.
API call:

api.openweathermap.org/data/2.5/forecast/daily?q={city name}&cnt={cnt}&appid={your api key}

api.openweathermap.org/data/2.5/forecast/daily?q={city name},{state code}&cnt={cnt}
&appid={your api key}

api.openweathermap.org/data/2.5/forecast/daily?q={city name},{state code},{country code}
&cnt={cnt}&appid={your api key}

Parameters:

q city name, state cide and country code divided by comma, use ISO 3166 country codes. You can specify the parameter not only in English. In this case, the API response should be returned in the same language as the language of requested location name if the location is in our predefined list of more than 200,000 locations.

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

Please note, that searching by states available only for the USA locations.

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

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 and XML 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}&appid={your api key}
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 and XML formats.
API call:
api.openweathermap.org/data/2.5/forecast/daily?lat={lat}&lon={lon}&cnt={cnt}&appid={your api key}
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

By ZIP code

Description:

Please note if country is not specified then the search works for USA as a default.

API call:
api.openweathermap.org/data/2.5/forecast/daily?zip={zip code},{country code}&appid={your api key}
Parameters:

zip zip code

Examples of API calls:

api.openweathermap.org/data/2.5/forecast/daily?zip=94040,us



Bulk downloading

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 page.

Examples of bulk files:

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

Weather parameters in 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.

JSON

Example of API repond:

{
  "city": {
    "id": 2643743,
    "name": "London",
    "coord": {
      "lon": -0.1258,
      "lat": 51.5085
    },
    "country": "GB",
    "population": 0,
    "timezone": 3600
  },
  "cod": "200",
  "message": 0.7809187,
  "cnt": 7,
  "list": [
    {
      "dt": 1568977200,
      "sunrise": 1568958164,
      "sunset": 1569002733,
      "temp": {
        "day": 293.79,
        "min": 288.85,
        "max": 294.47,
        "night": 288.85,
        "eve": 290.44,
        "morn": 293.79
      },
      "feels_like": {
        "day": 278.87,
        "night": 282.73,
        "eve": 281.92,
        "morn": 278.87
      },
      "pressure": 1025.04,
      "humidity": 42,
      "weather": [
        {
          "id": 800,
          "main": "Clear",
          "description": "sky is clear",
          "icon": "01d"
        }
      ],
      "speed": 4.66,
      "deg": 102,
      "clouds": 0
      "pop": 0.24
    },
    ....
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
  • country Country code (GB, JP etc.)
  • population Internal parameter
  • timezone Shift in seconds from UTC
  • 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.feels_like
      • list.feels_like.day Day temperature.This temperature parameter accounts for the human perception of weather. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • list.feels_like.night Night temperature.This temperature parameter accounts for the human perception of weather. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • list.feels_like.eve Evening temperature.This temperature parameter accounts for the human perception of weather. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • list.feels_like.morn Morning temperature. This temperature parameter accounts for the human perception of weather. 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. You can get the output in your language. Learn more.
      • 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, %
    • list.rain Precipitation volume, mm
    • list.snow Snow volume, mm
    • list.pop Probability of precipitation

XML

Example of API repond:
    <weatherdata>
    <location>
     <name>London</name>
     <type/>
     <country>GB</country>
     <timezone>3600</timezone>
     <location altitude="0" latitude="51.50853" longitude="-0.12574" 
     geobase="geonames" geobaseid="0"/>
    </location>
    <credit/>
    <meta>
     <lastupdate/>
     <calctime>0.0091</calctime>
     <nextupdate/>
    </meta>
    <sun rise="2015-06-04T03:46:26" set="2015-06-04T20:11:17"/>
    <forecast>
     <time day="2015-06-04">
     <sun rise="2020-08-06T19:57:53" set="2020-08-07T09:41:42"/>
    <symbol number="804" name="overcast clouds" var="04n"/>
    <precipitation probability="0.24"/>
    <windDirection deg="250" code="WSW" name="West-southwest"/>
    <windSpeed mps="5.09" unit="m/s" name="Gentle Breeze"/>
    <temperature day="298.15" min="298.15" max="298.44" night="298.44" eve="298.15" morn="298.15" unit="kelvin"/>
    <feels_like day="299.13" night="300.41" eve="299.13" morn="299.13" unit="kelvin"/>
    <pressure unit="hPa" value="1005"/>
    <humidity value="82" unit="%"/>
    <clouds value="overcast clouds" all="100" unit="%"/>
     </time>
    </forecast>
    </weatherdata>
Parameters:
  • location
    • location.name City ID
    • location.type Prototype parameter
    • location.country Country code (GB, JP etc.)
    • location.timezone Shift in seconds from UTC
    • 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 Internal parameter
      • location.location.geobaseid Internal parameter
  • meta
    • meta.lastupdate Internal parameter
    • meta.calctime Speed of data calculation
    • meta.nextupdate Internal 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 day, mm
      • forecast.precipitation.type Type of precipitation. Possible value is rain, snow.
      • forecast.precipitation.probability Probability of precipitation
    • 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.temperature.unit Unit of measurements. Possilbe valure is Celsius, Kelvin, Fahrenheit.
    • forecast.feels_like
      • forecast.feels_like.day Day temperature. This temperature parameter accounts for the human perception of weather. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • forecast.feels_like.night Night temperature. This temperature parameter accounts for the human perception of weather. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • forecast.feels_like.eve Evening temperature. This temperature parameter accounts for the human perception of weather. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • forecast.feels_like.morn Morning temperature. This temperature parameter accounts for the human perception of weather. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
      • forecast.feels_like.unit Unit of measurements. Possilbe valure is Celsius, Kelvin, Fahrenheit. Unit Default: Kelvin
    • 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 our weather APIs.

  • In 16 Day forecast - min and max mean maximum and minimum temperature in the day.
  • In Current weather API, Hourly forecast API and 5 day / 3 hour forecast 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 response:
"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 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

Other features

Format

Description:

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

Parameters:
mode - possible values are JSON xml. 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

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 response
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

You can use lang parameter to get the output in your language.
Translation is applied for the city name and description fields.

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

We support the following languages that you can use with the corresponded lang values:

# Language code Language
1 af Afrikaans
2 al Albanian
3 ar Arabic
4 az Azerbaijani
5 bg Bulgarian
6 ca Catalan
7 cz Czech
8 da Danish
9 de German
10 el Greek
11 en English
12 eu Basque
13 fa Persian (Farsi)
14 fi Finnish
15 fr French
16 gl Galician
17 he Hebrew
18 hi Hindi
19 hr Croatian
20 hu Hungarian
21 id Indonesian
22 it Italian
23 ja Japanese
24 kr Korean
25 la Latvian
26 lt Lithuanian
27 mk Macedonian
28 no Norwegian
29 nl Dutch
30 pl Polish
31 pt Portuguese
32 pt_br Português Brasil
33 ro Romanian
34 ru Russian
35 sv, se Swedish
36 sk Slovak
37 sl Slovenian
38 sp, es Spanish
39 sr Serbian
40 th Thai
41 tr Turkish
42 ua, uk Ukrainian
43 vi Vietnamese
44 zh_cn Chinese Simplified
45 zh_tw Chinese Traditional
46 zu Zulu

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