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.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:
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=7By 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}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=524901By 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}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=10By 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}Parameters:
zip zip code
Examples of API calls:
api.openweathermap.org/data/2.5/forecast/daily?zip=94040,us
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:
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": 1000000,
"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
},
"pressure": 1025.04,
"humidity": 42,
"weather": [
{
"id": 800,
"main": "Clear",
"description": "sky is clear",
"icon": "01d"
}
],
"speed": 4.66,
"deg": 102,
"clouds": 0
},
....
Parameters:
-
citycity.idCity IDcity.nameCity name-
city.coordcity.coord.latCity geo location, latitudecity.coord.lonCity geo location, longitude
countryCountry code (GB, JP etc.)timezoneShift in seconds from UTCcodInternal parametermessageInternal parametercntNumber of lines returned by this API call-
listlist.dtTime of data forecasted-
list.templist.temp.dayDay temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.list.temp.minMin daily temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.list.temp.maxMax daily temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.list.temp.nightNight temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.list.temp.eveEvening temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.list.temp.mornMorning temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
list.pressureAtmospheric pressure on the sea level, hPalist.humidityHumidity, %-
list.weather(more info Weather condition codes)list.weather.idWeather condition idlist.weather.mainGroup of weather parameters (Rain, Snow, Extreme etc.)list.weather.descriptionWeather condition within the grouplist.weather.iconWeather icon id
list.speedWind speed. Unit Default: meter/sec, Metric: meter/sec, Imperial: miles/hour.list.degWind direction, degrees (meteorological)list.cloudsCloudiness, %list.rainPrecipitation volume, mmlist.snowSnow volume, mm
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">
<symbol number="802" name="scattered clouds" var="03d"/>
<precipitation/>
<windDirection deg="148" code="SSE" name="South-southeast"/>
<windSpeed mps="5.12" name="Gentle Breeze"/>
<temperature day="23.65" min="17.27" max="23.74" night="17.27" eve="22.94" morn="17.54"/>
<pressure unit="hPa" value="1032.24"/>
<humidity value="70" unit="%"/>
<clouds value="scattered clouds" all="36" unit="%"/>
</time>
</forecast>
</weatherdata>
Parameters:
-
locationlocation.nameCity IDlocation.typePrototype parameterlocation.countryCountry code (GB, JP etc.)location.timezoneShift in seconds from UTC-
location.locationlocation.location.altitudeCity geo location, altitude above the sea levellocation.location.latitudeCity geo location, latitudelocation.location.longitudeCity geo location, longitudelocation.location.geobasePrototype parameterlocation.location.geobaseidPrototype parameter
-
metameta.lastupdatePrototype parametermeta.calctimeSpeed of data calculationmeta.nextupdatePrototype parameter
-
sunsun.riseSunrise timesun.setSunset time
-
forecast-
forecast.timeforecast.time.dayDate of weather data forecasted
-
forecast.symbolforecast.symbol.numberWeather condition idforecast.symbol.nameWeather conditionforecast.symbol.varWeather icon id
-
forecast.precipitationforecast.precipitation.valuePrecipitation volume for the last day, mmforecast.precipitation.typeType of precipitation. Possible value is rain, snow.
-
forecast.windDirectionforecast.windDirection.degWind direction, degrees (meteorological)forecast.windDirection.codeCode of the wind direction. Possilbe value is WSW, N, S etc.forecast.windDirection.nameFull name of the wind direction.
-
forecast.windSpeedforecast.windSpeed.mpsWind speed, mpsforecast.windSpeed.nameType of the wind
-
forecast.temperatureforecast.temperature.dayDay temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.forecast.temperature.minMin daily temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.forecast.temperature.maxMax daily temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.forecast.temperature.nightNight temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.forecast.temperature.eveEvening temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.forecast.temperature.mornMorning temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
-
forecast.pressureforecast.pressure.unithPaforecast.pressure.valuePressure value
-
forecast.humidityforecast.humidity.unit%forecast.humidity.valueHumidity value
-
forecast.cloudsforecast.pressure.valueName of the cloudinessforecast.pressure.allCloudinessforecast.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 responseExamples 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:
Arabic - ar, Bulgarian - bg, Catalan - ca, Czech - cz, German - de, Greek - el, English - en, Persian (Farsi) - fa, Finnish - fi, French - fr, Galician - gl, Croatian - hr, Hungarian - hu, Italian - it, Japanese - ja, Korean - kr, Latvian - la, Lithuanian - lt, Macedonian - mk, Dutch - nl, Polish - pl, Portuguese - pt, Romanian - ro, Russian - ru, Swedish - se, Slovak - sk, Slovenian - sl, Spanish - es, Turkish - tr, Ukrainian - ua, Vietnamese - vi, Chinese Simplified - zh_cn, Chinese Traditional - zh_tw.
NOTE: Translation is only applied for the "description" field.
API call:
http://api.openweathermap.org/data/2.5/forecast/daily?id=524901&lang={lang}Parameters:
lang language codeExamples of API calls:
http://api.openweathermap.org/data/2.5/forecast/daily?id=524901&lang=zh_cnCall back function for JavaScript code
Description:
To use JavaScript code you can transfer callback functionName to JSONP callback.