{
"cod": "200",
"message": 0,
"cnt": 96,
"list": [
{
"dt": 1661875200,
"main": {
"temp": 296.34,
"feels_like": 296.02,
"temp_min": 296.34,
"temp_max": 298.24,
"pressure": 1015,
"sea_level": 1015,
"grnd_level": 933,
"humidity": 50,
"temp_kf": -1.9
},
"weather": [
{
"id": 500,
"main": "Rain",
"description": "light rain",
"icon": "10d"
}
],
"clouds": {
"all": 97
},
"wind": {
"speed": 1.06,
"deg": 66,
"gust": 2.16
},
"visibility": 10000,
"pop": 0.32,
"rain": {
"1h": 0.13
},
"sys": {
"pod": "d"
},
"dt_txt": "2022-08-30 16:00:00"
},
{
"dt": 1661878800,
"main": {
"temp": 296.31,
"feels_like": 296.07,
"temp_min": 296.2,
"temp_max": 296.31,
"pressure": 1015,
"sea_level": 1015,
"grnd_level": 932,
"humidity": 53,
"temp_kf": 0.11
},
"weather": [
{
"id": 500,
"main": "Rain",
"description": "light rain",
"icon": "10d"
}
],
"clouds": {
"all": 95
},
"wind": {
"speed": 1.58,
"deg": 103,
"gust": 3.52
},
"visibility": 10000,
"pop": 0.4,
"rain": {
"1h": 0.24
},
"sys": {
"pod": "d"
},
"dt_txt": "2022-08-30 17:00:00"
},
{
"dt": 1661882400,
"main": {
"temp": 294.94,
"feels_like": 294.74,
"temp_min": 292.84,
"temp_max": 294.94,
"pressure": 1015,
"sea_level": 1015,
"grnd_level": 931,
"humidity": 60,
"temp_kf": 2.1
},
"weather": [
{
"id": 500,
"main": "Rain",
"description": "light rain",
"icon": "10n"
}
],
"clouds": {
"all": 93
},
"wind": {
"speed": 1.97,
"deg": 157,
"gust": 3.39
},
"visibility": 10000,
"pop": 0.33,
"rain": {
"1h": 0.2
},
"sys": {
"pod": "n"
},
"dt_txt": "2022-08-30 18:00:00"
},
.....
{
"dt": 1662217200,
"main": {
"temp": 294.14,
"feels_like": 293.99,
"temp_min": 294.14,
"temp_max": 294.14,
"pressure": 1014,
"sea_level": 1014,
"grnd_level": 931,
"humidity": 65,
"temp_kf": 0
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "overcast clouds",
"icon": "04d"
}
],
"clouds": {
"all": 100
},
"wind": {
"speed": 0.91,
"deg": 104,
"gust": 1.92
},
"visibility": 10000,
"pop": 0.53,
"sys": {
"pod": "d"
},
"dt_txt": "2022-09-03 15:00:00"
}
],
"city": {
"id": 3163858,
"name": "Zocca",
"coord": {
"lat": 44.34,
"lon": 10.99
},
"country": "IT",
"population": 4593,
"timezone": 7200,
"sunrise": 1661834187,
"sunset": 1661882248
}
}
Hourly forecast
Product concept
Hourly forecast for 4 days (96 timestamps). Weather data is available in JSON and XML formats.
Call hourly forecast data
How to make an API call
You can search weather forecast for 4 days with data every hour by geographic coordinates.
All weather data can be obtained in JSON and XML formats.
API call
https://pro.openweathermap.org/data/2.5/forecast/hourly?lat={lat}&lon={lon}&appid={API key}
Parameters | ||
---|---|---|
lat |
required | Latitude. If you need the geocoder to automatic convert city names and zip-codes to geo coordinates and the other way around, please use our Geocoding API |
lon |
required | Longitude. If you need the geocoder to automatic convert city names and zip-codes to geo coordinates and the other way around, please use our Geocoding API |
appid |
required | Your unique API key (you can always find it on your account page under the "API key" tab) |
mode |
optional | Data format. Possible values are json and xml . If the
mode parameter is empty the format is JSON by default. Learn
more
|
cnt |
optional | A number of timestamps in response. Learn more |
lang |
optional | Language code. Learn more |
Please use Geocoder API if you need automatic convert city names and zip-codes to geo coordinates and the other way around.
Please note that built-in geocoder has been deprecated. Although it is still available for use, bug fixing and updates are no longer available for this functionality.
API call example
https://pro.openweathermap.org/data/2.5/forecast/hourly?lat=44.34&lon=10.99&appid={API key}
API response
JSON
JSON format API response example
{
"cod": "200",
"message": 0,
"cnt": 96,
"list": [
{
"dt": 1661875200,
"main": {
"temp": 296.34,
"feels_like": 296.02,
"temp_min": 296.34,
"temp_max": 298.24,
"pressure": 1015,
"sea_level": 1015,
"grnd_level": 933,
"humidity": 50,
"temp_kf": -1.9
},
"weather": [
{
"id": 500,
"main": "Rain",
"description": "light rain",
"icon": "10d"
}
],
"clouds": {
"all": 97
},
"wind": {
"speed": 1.06,
"deg": 66,
"gust": 2.16
},
"visibility": 10000,
"pop": 0.32,
"rain": {
"1h": 0.13
},
"sys": {
"pod": "d"
},
"dt_txt": "2022-08-30 16:00:00"
},
{
"dt": 1661878800,
"main": {
"temp": 296.31,
"feels_like": 296.07,
"temp_min": 296.2,
"temp_max": 296.31,
"pressure": 1015,
"sea_level": 1015,
"grnd_level": 932,
"humidity": 53,
"temp_kf": 0.11
},
"weather": [
{
"id": 500,
"main": "Rain",
"description": "light rain",
"icon": "10d"
}
],
"clouds": {
"all": 95
},
"wind": {
"speed": 1.58,
"deg": 103,
"gust": 3.52
},
"visibility": 10000,
"pop": 0.4,
"rain": {
"1h": 0.24
},
"sys": {
"pod": "d"
},
"dt_txt": "2022-08-30 17:00:00"
},
{
"dt": 1661882400,
"main": {
"temp": 294.94,
"feels_like": 294.74,
"temp_min": 292.84,
"temp_max": 294.94,
"pressure": 1015,
"sea_level": 1015,
"grnd_level": 931,
"humidity": 60,
"temp_kf": 2.1
},
"weather": [
{
"id": 500,
"main": "Rain",
"description": "light rain",
"icon": "10n"
}
],
"clouds": {
"all": 93
},
"wind": {
"speed": 1.97,
"deg": 157,
"gust": 3.39
},
"visibility": 10000,
"pop": 0.33,
"rain": {
"1h": 0.2
},
"sys": {
"pod": "n"
},
"dt_txt": "2022-08-30 18:00:00"
},
.....
{
"dt": 1662217200,
"main": {
"temp": 294.14,
"feels_like": 293.99,
"temp_min": 294.14,
"temp_max": 294.14,
"pressure": 1014,
"sea_level": 1014,
"grnd_level": 931,
"humidity": 65,
"temp_kf": 0
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "overcast clouds",
"icon": "04d"
}
],
"clouds": {
"all": 100
},
"wind": {
"speed": 0.91,
"deg": 104,
"gust": 1.92
},
"visibility": 10000,
"pop": 0.53,
"sys": {
"pod": "d"
},
"dt_txt": "2022-09-03 15:00:00"
}
],
"city": {
"id": 3163858,
"name": "Zocca",
"coord": {
"lat": 44.34,
"lon": 10.99
},
"country": "IT",
"population": 4593,
"timezone": 7200,
"sunrise": 1661834187,
"sunset": 1661882248
}
}
JSON format API response fields
cod
Internal parametermessage
Internal parametercnt
Number of timestamps returned by this API call-
list
list.dt
Time of data forecasted, Unix, UTC-
list.main
list.main.temp
Temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheitlist.main.feels_like
This temperature parameter accounts for the human perception of weather. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheitlist.main.temp_min
Minimum temperature at the moment of calculation. This is minimal forecasted temperature (within large megalopolises and urban areas), use this parameter optionally. Please find more info here. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheitlist.main.temp_max
Maximum temperature at the moment of calculation. This is maximal forecasted temperature (within large megalopolises and urban areas), use these parameter optionally. lease find more info here. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheitlist.main.pressure
Atmospheric pressure on the sea level by default, hPalist.main.sea_level
Atmospheric pressure on the sea level, hPalist.main.grnd_level
Atmospheric pressure on the ground level, hPalist.main.humidity
Humidity, %list.main.temp_kf
Internal parameter
-
list.weather
list.weather.id
Weather condition idlist.weather.main
Group of weather parameters (Rain, Snow, Clouds etc.)list.weather.description
Weather condition within the group. Please find more here. You can get the output in your language. Learn morelist.weather.icon
Weather icon id
-
list.clouds
list.clouds.all
Cloudiness, %
-
list.wind
list.wind.speed
Wind speed. Unit Default: meter/sec, Metric: meter/sec, Imperial: miles/hourlist.wind.deg
Wind direction, degrees (meteorological)list.wind.gust
Wind gust. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour
-
list.rain
list.rain.1h
Rain volume for last hour, mm
-
list.snow
list.snow.1h
Snow volume for last hour
list.visibility
Average visibility, metres. The maximum value of the visibility is 10kmlist.pop
Probability of precipitation. The values of the parameter vary between 0 and 1, where 0 is equal to 0%, 1 is equal to 100%-
list.sys
list.sys.pod
Part of the day (n - night, d - day)
list.dt_txt
Time of data forecasted, ISO, UTC-
city
country
Country code (GB, JP etc.). Please note that built-in geocoder functionality has been deprecated. Learn more heretimezone
Shift in seconds from UTCsunrise
Sunrise time, Unix, UTCsunset
Sunset time, Unix, UTC
XML
XML format API response example
<weatherdata>
<location>
<name>Zocca</name>
<type/>
<country>IT</country>
<timezone>7200</timezone>
<location altitude="0" latitude="44.34" longitude="10.99" geobase="geonames" geobaseid="3163858"/>
</location>
<credit/>
<meta>
<lastupdate/>
<calctime>0</calctime>
<nextupdate/>
</meta>
<sun rise="2022-08-30T04:36:27" set="2022-08-30T17:57:28"/>
<forecast>
<time from="2022-08-30T15:00:00" to="2022-08-30T16:00:00">
<symbol number="500" name="light rain" var="10d"/>
<precipitation probability="0.32" unit="1h" value="0.13" type="rain"/>
<windDirection deg="66" code="ENE" name="East-northeast"/>
<windSpeed mps="1.06" unit="m/s" name="Calm"/>
<windGust gust="2.16" unit="m/s"/>
<temperature unit="kelvin" value="296.34" min="296.34" max="298.24"/>
<feels_like value="296.02" unit="kelvin"/>
<pressure unit="hPa" value="1015"/>
<humidity value="50" unit="%"/>
<clouds value="overcast clouds" all="97" unit="%"/>
<visibility value="10000"/>
</time>
<time from="2022-08-30T16:00:00" to="2022-08-30T17:00:00">
<symbol number="500" name="light rain" var="10d"/>
<precipitation probability="0.4" unit="1h" value="0.24" type="rain"/>
<windDirection deg="103" code="ESE" name="East-southeast"/>
<windSpeed mps="1.58" unit="m/s" name="Calm"/>
<windGust gust="3.52" unit="m/s"/>
<temperature unit="kelvin" value="296.31" min="296.2" max="296.31"/>
<feels_like value="296.07" unit="kelvin"/>
<pressure unit="hPa" value="1015"/>
<humidity value="53" unit="%"/>
<clouds value="overcast clouds" all="95" unit="%"/>
<visibility value="10000"/>
</time>
<time from="2022-08-30T17:00:00" to="2022-08-30T18:00:00">
<symbol number="500" name="light rain" var="10n"/>
<precipitation probability="0.33" unit="1h" value="0.2" type="rain"/>
<windDirection deg="157" code="SSE" name="South-southeast"/>
<windSpeed mps="1.97" unit="m/s" name="Light breeze"/>
<windGust gust="3.39" unit="m/s"/>
<temperature unit="kelvin" value="294.94" min="292.84" max="294.94"/>
<feels_like value="294.74" unit="kelvin"/>
<pressure unit="hPa" value="1015"/>
<humidity value="60" unit="%"/>
<clouds value="overcast clouds" all="93" unit="%"/>
<visibility value="10000"/>
</time>
...
</forecast>
</weatherdata>
XML format API response fields
-
location
location.name
City name. Please note that built-in geocoder functionality has been deprecated. Learn more herelocation.type
Internal parameterlocation.country
Country code (GB, JP etc.). Please note that built-in geocoder functionality has been deprecated. Learn more herelocation.timezone
Shift in seconds from UTC-
location.location
location.location.altitude
Geo location, altitude above the sea levellocation.location.latitude
Geo location, latitudelocation.location.longitude
Geo location, longitudelocation.location.geobase
Internal parameterlocation.location.geobaseid
Internal parameter
credit
Internal parameter-
meta
meta.lastupdate
Internal parametermeta.calctime
Speed of data calculationmeta.nextupdate
Internal parameter
-
sun
sun.rise
Sunrise timesun.set
Sunset time
-
forecast
-
forecast.time
forecast.time.from
Beginning of the period of data forecastedforecast.time.to
End of the period of data forecasted
-
forecast.symbol
forecast.symbol.number
Weather condition idforecast.symbol.name
Weather conditionforecast.symbol.var
Weather icon id
-
forecast.precipitation
forecast.precipitation.value
Precipitation volume for the last hour, mmforecast.precipitation.unit
Period of measurements. Possible value is 1 hourforecast.precipitation.type
Type of precipitation. Possible value is rain, snowforecast.precipitation.probability
Probability of precipitation. The values of the parameter vary between 0 and 1, where 0 is equal to 0%, 1 is equal to 100%
-
forecast.windDirection
forecast.windDirection.deg
Wind direction, degrees (meteorological)forecast.windDirection.code
Code of the wind direction. Possible value is WSW, N, S etc.forecast.windDirection.name
Full name of the wind direction
-
forecast.windSpeed
forecast.windSpeed.mps
Wind speed, meters per secondforecast.windSpeed.unit
Unit of measurementsforecast.windSpeed.name
Type of the wind
-
forecast.windGust
forecast.windGust.gust
Wind gust, meters per secondforecast.windGust.unit
Unit of measurements
-
forecast.temperature
forecast.temperature.unit
Unit of measurements. Possible value is Celsius, Kelvin, Fahrenheit.forecast.temperature.value
Temperatureforecast.temperature.min
Minimum temperature at the moment of calculation. This is minimal forecasted temperature (within large megalopolises and urban areas), use this parameter optionally. Please find more info hereforecast.temperature.max
Maximum temperature at the moment of calculation. This is maximal forecasted temperature (within large megalopolises and urban areas), use this parameter optionally. Please find more info here
-
forecast.feels_like
forecast.feels_like.unit
Unit of measurements. Possible value is Celsius, Kelvin, Fahrenheit. Unit Default: Kelvinforecast.feels_like.value
Temperature. This temperature parameter accounts for the human perception of weather
-
forecast.pressure
forecast.pressure.unit
hPaforecast.pressure.value
Pressure value
-
forecast.humidity
forecast.humidity.unit
%forecast.humidity.value
Humidity value
-
forecast.clouds
forecast.clouds.value
Name of the cloudinessforecast.clouds.all
Cloudinessforecast.clouds.unit
%
-
forecast.visibility
forecast.visibility.value
Average visibility, metres. The maximum value of the visibility is 10km
-
List of weather condition codes
List of weather condition codes with icons (range of thunderstorm, drizzle, rain, snow, clouds, atmosphere etc.)
Min/max temperature in our weather API
Please do not confuse min/max parameters in our weather APIs.
- In Hourly forecast API, Current weather 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 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.
- In 16 Day forecast - min and max mean maximum and minimum temperature in the day.
Example of current weather API response
"main":{
"temp":306.15, //current temperature
"pressure":1013,
"humidity":44,
"temp_min":306.15, //min current temperature in the city
"temp_max":306.15 //max current temperature in the city
},
For comparison look at example of daily forecast weather API response:
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
Geocoding API
Requesting API calls by geographical coordinates is the most accurate way to specify any location. If you need to convert city names and zip-codes to geo coordinates and the other way around automatically, please use our Geocoding API.
Built-in geocoding
Please use Geocoder API if you need automatic convert city names and zip-codes to geo coordinates and the other way around.
Please note that API requests by city name, zip-codes and city id have been deprecated. Although they are still available for use, bug fixing and updates are no longer available for this functionality.
Built-in API request by city name
You can search weather forecast for 4 days (96 hours) with data every hour by city name. All weather data can be obtained in JSON and XML formats.
API call
https://pro.openweathermap.org/data/2.5/forecast/hourly?q={city name}&appid={API key}
https://pro.openweathermap.org/data/2.5/forecast/hourly?q={city name},{country code}&appid={API key}
https://pro.openweathermap.org/data/2.5/forecast/hourly?q={city name},{state code},{country code}&appid={API key}
Parameters | ||
---|---|---|
q |
required | city name, state code 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. |
appid |
required | Your unique API key (you can always find it on your account page under the "API key" tab) |
mode |
optional | Data format. Possible values are json and xml . If the
mode parameter is empty the format is JSON by default. Learn
more
|
cnt |
optional | A number of timestamps in response. Learn more |
lang |
optional | Language code. Learn more |
API call examples
https://pro.openweathermap.org/data/2.5/forecast/hourly?q=London,us&mode=xml&appid={API key}
<weatherdata>
<location>
<name>London</name>
<type/>
<country>US</country>
<timezone>-14400</timezone>
<location altitude="0" latitude="39.8865" longitude="-83.4483" geobase="geonames" geobaseid="4517009"/>
</location>
<credit/>
<meta>
<lastupdate/>
<calctime>0</calctime>
<nextupdate/>
</meta>
<sun rise="2022-03-15T11:45:19" set="2022-03-15T23:40:10"/>
<forecast>
<time from="2022-03-15T15:00:00" to="2022-03-15T16:00:00">
<symbol number="804" name="overcast clouds" var="04d"/>
<precipitation probability="0"/>
<windDirection deg="236" code="SW" name="Southwest"/>
<windSpeed mps="3.58" unit="m/s" name="Gentle Breeze"/>
<windGust gust="6.02" unit="m/s"/>
<temperature unit="kelvin" value="283.48" min="283.48" max="284.46"/>
<feels_like value="282.11" unit="kelvin"/>
<pressure unit="hPa" value="1024"/>
<humidity value="59" unit="%"/>
<clouds value="overcast clouds" all="100" unit="%"/>
<visibility value="10000"/>
</time>
....
<time from="2022-03-19T14:00:00" to="2022-03-19T15:00:00">
<symbol number="804" name="overcast clouds" var="04d"/>
<precipitation probability="0.33"/>
<windDirection deg="236" code="SW" name="Southwest"/>
<windSpeed mps="9.88" unit="m/s" name="Fresh Breeze"/>
<windGust gust="15.37" unit="m/s"/>
<temperature unit="kelvin" value="276.47" min="276.47" max="276.47"/>
<feels_like value="270.55" unit="kelvin"/>
<pressure unit="hPa" value="1009"/>
<humidity value="90" unit="%"/>
<clouds value="overcast clouds" all="100" unit="%"/>
<visibility value="6728"/>
</time>
</forecast>
</weatherdata>
There is a possibility to receive a central district of the city/town with its own parameters (geographic coordinates/id/name) in API response. Please see the example below.
https://pro.openweathermap.org/data/2.5/forecast/hourly?q=München,DE&appid={API key}
{
"cod":"200",
"message":0.0151,
"cnt":96,
"list":[
{
"dt":1553709600,
"main":{
"temp":278.76,
"temp_min":278.76,
"temp_max":279.558,
"pressure":1031.934,
"sea_level":1031.934,
"grnd_level":971.745,
"humidity":100,
"temp_kf":-0.8
},
"weather":[
{
"id":803,
"main":"Clouds",
"description":"broken clouds",
"icon":"04n"
}
],
"clouds":{
"all":77
},
"wind":{
"speed":1.6,
"deg":40.932,
"gust":7.9
},
"sys":{
"pod":"n"
},
"dt_txt":"2019-03-27 18:00:00"
},
{
"dt":1553713200,
"main":{
"temp":278.4,
"temp_min":278.4,
"temp_max":279,
"pressure":1033.061,
"sea_level":1033.061,
"grnd_level":972.411,
"humidity":100,
"temp_kf":-0.6
},
"weather":[
{
"id":801,
"main":"Clouds",
"description":"few clouds",
"icon":"02n"
}
],
"clouds":{
"all":24
},
"wind":{
"speed":1.49,
"deg":46.416,
"gust":5.46
},
"sys":{
"pod":"n"
},
"dt_txt":"2019-03-27 19:00:00"
},
.....
{
"dt":1554051600,
"main":{
"temp":281.5,
"temp_min":281.5,
"temp_max":281.5,
"pressure":1021.88,
"sea_level":1021.88,
"grnd_level":963.288,
"humidity":100,
"temp_kf":0
},
"weather":[
{
"id":804,
"main":"Clouds",
"description":"overcast clouds",
"icon":"04d"
}
],
"clouds":{
"all":100
},
"wind":{
"speed":5,
"deg":7.624,
"gust":8.46
},
"rain":{
},
"sys":{
"pod":"d"
},
"dt_txt":"2019-03-31 17:00:00"
}
],
"city":{
"id":2867714,
"name":"Munich",
"coord":{
"lat":48.1371,
"lon":11.5754
},
"country":"DE",
"population":1260391
}
}
Built-in API request by city ID
You can search weather forecast for 4 days with data every hour by city ID.
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
https://pro.openweathermap.org/data/2.5/forecast/hourly?id={city ID}&appid={API key}
Parameters | ||
---|---|---|
id |
required | city ID |
appid |
required | Your unique API key (you can always find it on your account page under the "API key" tab) |
mode |
optional | Data format. Possible values are json and xml . If the
mode parameter is empty the format is JSON by default. Learn
more
|
cnt |
optional | A number of timestamps in response. Learn more |
lang |
optional | Language code. Learn more |
API call example
https://pro.openweathermap.org/data/2.5/forecast/hourly?id=524901&appid={API key}
{
"cod":"200",
"message":0.0204,
"cnt":96,
"list":[
{
"dt":1553709600,
"main":{
"temp":272.09,
"temp_min":271.358,
"temp_max":272.09,
"pressure":1018.01,
"sea_level":1018.01,
"grnd_level":997.153,
"humidity":100,
"temp_kf":0.73
},
"weather":[
{
"id":803,
"main":"Clouds",
"description":"broken clouds",
"icon":"04n"
}
],
"clouds":{
"all":60
},
"wind":{
"speed":3.25,
"deg":287.822,
"gust":5.46
},
"sys":{
"pod":"n"
},
"dt_txt":"2019-03-27 18:00:00"
},
{
"dt":1553713200,
"main":{
"temp":271.59,
"temp_min":271.1,
"temp_max":271.59,
"pressure":1018.335,
"sea_level":1018.335,
"grnd_level":997.403,
"humidity":100,
"temp_kf":0.49
},
"weather":[
{
"id":800,
"main":"Clear",
"description":"clear sky",
"icon":"02n"
}
],
"clouds":{
"all":2
},
"wind":{
"speed":3.4,
"deg":294.075,
"gust":5.46
},
"sys":{
"pod":"n"
},
"dt_txt":"2019-03-27 19:00:00"
},
{
"dt":1553716800,
"main":{
"temp":271.15,
"temp_min":270.907,
"temp_max":271.15,
"pressure":1018.794,
"sea_level":1018.794,
"grnd_level":997.864,
"humidity":100,
"temp_kf":0.24
},
"weather":[
{
"id":800,
"main":"Clear",
"description":"clear sky",
"icon":"01n"
}
],
"clouds":{
"all":1
},
"wind":{
"speed":3.47,
"deg":300.189,
"gust":5.46
},
"sys":{
"pod":"n"
},
"dt_txt":"2019-03-27 20:00:00"
},
....
{
"dt":1554051600,
"main":{
"temp":281.5,
"temp_min":281.5,
"temp_max":281.5,
"pressure":1011.332,
"sea_level":1011.332,
"grnd_level":991.048,
"humidity":100,
"temp_kf":0
},
"weather":[
{
"id":803,
"main":"Clouds",
"description":"broken clouds",
"icon":"04n"
}
],
"clouds":{
"all":63
},
"wind":{
"speed":4.61,
"deg":226.055,
"gust":8.46
},
"rain":{
},
"sys":{
"pod":"n"
},
"dt_txt":"2019-03-31 17:00:00"
}
],
"city":{
"id":524901,
"name":"Moscow",
"coord":{
"lat":55.7522,
"lon":37.6156
},
"country":"RU"
}
}
Built-in API request by ZIP code
Please note if country is not specified then the search works for USA as a default.
API call
https://pro.openweathermap.org/data/2.5/forecast/hourly?zip={zip code},{country code}&appid={API key}
Parameters | ||
---|---|---|
zip |
required | Zip code |
appid |
required | Your unique API key (you can always find it on your account page under the "API key" tab) |
mode |
optional | Data format. Possible values are json and xml . If the
mode parameter is empty the format is JSON by default. Learn
more
|
cnt |
optional | A number of timestamps in response. Learn more |
lang |
optional | Language code |
API call example
https://pro.openweathermap.org/data/2.5/forecast/hourly?zip=94040,us&appid={API key}
{
"cod":"200",
"message":0.0208,
"cnt":96,
"list":[
{
"dt":1553709600,
"main":{
"temp":286.44,
"temp_min":286.258,
"temp_max":286.44,
"pressure":1015.82,
"sea_level":1015.82,
"grnd_level":1002.193,
"humidity":100,
"temp_kf":0.18
},
"weather":[
{
"id":500,
"main":"Rain",
"description":"light rain",
"icon":"10d"
}
],
"clouds":{
"all":86
},
"wind":{
"speed":5.51,
"deg":202.816,
"gust":10.46
},
"rain":{
"1h":0.812
},
"sys":{
"pod":"d"
},
"dt_txt":"2019-03-27 18:00:00"
},
{
"dt":1553713200,
"main":{
"temp":286.43,
"temp_min":286.3,
"temp_max":286.43,
"pressure":1016.183,
"sea_level":1016.183,
"grnd_level":1002.667,
"humidity":100,
"temp_kf":0.13
},
"weather":[
{
"id":500,
"main":"Rain",
"description":"light rain",
"icon":"10d"
}
],
"clouds":{
"all":92
},
"wind":{
"speed":4.84,
"deg":206.141,
"gust":5.46
},
"rain":{
"1h":0.625
},
"sys":{
"pod":"d"
},
"dt_txt":"2019-03-27 19:00:00"
},
{
"dt":1553716800,
"main":{
"temp":286.6,
"temp_min":286.507,
"temp_max":286.6,
"pressure":1016.462,
"sea_level":1016.462,
"grnd_level":1003.128,
"humidity":100,
"temp_kf":0.09
},
"weather":[
{
"id":500,
"main":"Rain",
"description":"light rain",
"icon":"10d"
}
],
"clouds":{
"all":94
},
"wind":{
"speed":4.58,
"deg":216.201,
"gust":5.46
},
"rain":{
"1h":0.437
},
"sys":{
"pod":"d"
},
"dt_txt":"2019-03-27 20:00:00"
},
....
{
"dt":1554051600,
"main":{
"temp":288.9,
"temp_min":288.9,
"temp_max":288.9,
"pressure":1023.992,
"sea_level":1023.992,
"grnd_level":1011.112,
"humidity":100,
"temp_kf":0
},
"weather":[
{
"id":802,
"main":"Clouds",
"description":"scattered clouds",
"icon":"03d"
}
],
"clouds":{
"all":50
},
"wind":{
"speed":1.69,
"deg":347.482,
"gust":5.46
},
"sys":{
"pod":"d"
},
"dt_txt":"2019-03-31 17:00:00"
}
],
"city":{
"id":420006353,
"name":"Mountain View",
"coord":{
"lat":37.3894,
"lon":-122.0833
},
"country":"US"
}
}
Format
JSON format is used by default. To get data in XML format just set up mode = xml.
Parameters | ||
---|---|---|
mode |
optional | Data format. Possible values are json and xml . If the
mode parameter is empty the format is JSON by default.
|
API call examples
JSON
api.openweathermap.org/data/2.5/weather?q=London&appid={API key}
{
"coord":{
"lon":-0.13,
"lat":51.51
},
"weather":[
{
"id":300,
"main":"Drizzle",
"description":"light intensity drizzle",
"icon":"09d"
}
],
"base":"stations",
"main":{
"temp":280.32,
"pressure":1012,
"humidity":81,
"temp_min":279.15,
"temp_max":281.15
},
"visibility":10000,
"wind":{
"speed":4.1,
"deg":80,
"gust":8.1,
},
"clouds":{
"all":90
},
"dt":1485789600,
"sys":{
"type":1,
"id":5091,
"message":0.0103,
"country":"GB",
"sunrise":1485762037,
"sunset":1485794875
},
"id":2643743,
"name":"London",
"cod":200
}
XML
api.openweathermap.org/data/2.5/weather?q=London&mode=xml
<current>
<city id="2643743" name="London">
<coord lon="-0.13" lat="51.51" />
<country>GB</country>
<sun rise="2017-01-30T07:40:36" set="2017-01-30T16:47:56" />
</city>
<temperature value="280.15" min="278.15" max="281.15" unit="kelvin" />
<humidity value="81" unit="%" />
<pressure value="1012" unit="hPa" />
<wind>
<speed value="4.6" name="Gentle Breeze" />
<gusts />
<direction value="90" code="E" name="East" />
</wind>
<clouds value="90" name="overcast clouds" />
<visibility value="10000" />
<precipitation mode="no" />
<weather number="701" value="mist" icon="50d" />
<lastupdate value="2017-01-30T15:50:00" />
</current>
Limitation of result
To limit number of listed cities please setup cnt
parameter that specifies the number of
timestamps returned.
Parameters | ||
---|---|---|
cnt |
optional | A number of timestamps in response |
API call example
cnt=3
https://pro.openweathermap.org/data/2.5/forecast/hourly?lat=57&lon=-2.15{API key}&cnt=3
{
"cod": "200",
"message": 0,
"cnt": 3,
"list": [
{
"dt": 1647356400,
"main": {
"temp": 281.98,
"feels_like": 278.65,
"temp_min": 280.57,
"temp_max": 281.98,
"pressure": 1014,
"sea_level": 1014,
"grnd_level": 1014,
"humidity": 81,
"temp_kf": 1.41
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "overcast clouds",
"icon": "04d"
}
],
"clouds": {
"all": 100
},
"wind": {
"speed": 6.78,
"deg": 184,
"gust": 12.14
},
"visibility": 10000,
"pop": 0.34,
"sys": {
"pod": "d"
},
"dt_txt": "2022-03-15 15:00:00"
},
{
"dt": 1647360000,
"main": {
"temp": 281.8,
"feels_like": 278.45,
"temp_min": 281.06,
"temp_max": 281.8,
"pressure": 1014,
"sea_level": 1014,
"grnd_level": 1014,
"humidity": 79,
"temp_kf": 0.74
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "overcast clouds",
"icon": "04d"
}
],
"clouds": {
"all": 100
},
"wind": {
"speed": 6.68,
"deg": 186,
"gust": 11.8
},
"visibility": 10000,
"pop": 0.28,
"sys": {
"pod": "d"
},
"dt_txt": "2022-03-15 16:00:00"
},
{
"dt": 1647363600,
"main": {
"temp": 281.58,
"feels_like": 278.29,
"temp_min": 280.99,
"temp_max": 281.58,
"pressure": 1014,
"sea_level": 1014,
"grnd_level": 1014,
"humidity": 79,
"temp_kf": 0.59
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "overcast clouds",
"icon": "04d"
}
],
"clouds": {
"all": 100
},
"wind": {
"speed": 6.33,
"deg": 181,
"gust": 11.26
},
"visibility": 10000,
"pop": 0.24,
"sys": {
"pod": "d"
},
"dt_txt": "2022-03-15 17:00:00"
}
],
"city": {
"id": 2641549,
"name": "Newtonhill",
"coord": {
"lat": 57,
"lon": -2.15
},
"country": "GB",
"population": 3284,
"timezone": 0,
"sunrise": 1647325488,
"sunset": 1647367827
}
}
Units of measurement
standard
, metric
, and imperial
units are available. List of all API parameters with available units.
Parameters | ||
---|---|---|
units |
optional | Units of measurement. 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
API call examples
Standard
https://pro.openweathermap.org/data/2.5/forecast/hourly?lat=57&lon=-2.15&appid={API key}
{
"cod": "200",
"message": 0,
"cnt": 96,
"list": [
{
"dt": 1647356400,
"main": {
"temp": 281.99,
"feels_like": 278.67,
"temp_min": 280.57,
"temp_max": 281.99,
"pressure": 1015,
"sea_level": 1015,
"grnd_level": 1014,
"humidity": 77,
"temp_kf": 1.42
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "overcast clouds",
"icon": "04d"
}
],
"clouds": {
"all": 100
},
"wind": {
"speed": 6.78,
"deg": 184,
"gust": 12.14
},
"visibility": 10000,
"pop": 0.34,
"sys": {
"pod": "d"
},
"dt_txt": "2022-03-15 15:00:00"
},
{
"dt": 1647360000,
"main": {
"temp": 281.83,
"feels_like": 278.49,
"temp_min": 281.06,
"temp_max": 281.83,
"pressure": 1015,
"sea_level": 1015,
"grnd_level": 1014,
"humidity": 76,
"temp_kf": 0.77
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "overcast clouds",
"icon": "04d"
}
],
"clouds": {
"all": 100
},
"wind": {
"speed": 6.68,
"deg": 186,
"gust": 11.8
},
"visibility": 10000,
"pop": 0.28,
"sys": {
"pod": "d"
},
"dt_txt": "2022-03-15 16:00:00"
},
.....
],
"city": {
"id": 2641549,
"name": "Newtonhill",
"coord": {
"lat": 57,
"lon": -2.15
},
"country": "GB",
"population": 3284,
"timezone": 0,
"sunrise": 1647325488,
"sunset": 1647367827
}
}
https://pro.openweathermap.org/data/2.5/forecast/hourly?lat=57&lon=-2.15&appid={API key}&units=metric
{
"cod": "200",
"message": 0,
"cnt": 96,
"list": [
{
"dt": 1647356400,
"main": {
"temp": 8.84,
"feels_like": 5.52,
"temp_min": 7.42,
"temp_max": 8.84,
"pressure": 1015,
"sea_level": 1015,
"grnd_level": 1014,
"humidity": 78,
"temp_kf": 1.42
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "overcast clouds",
"icon": "04d"
}
],
"clouds": {
"all": 100
},
"wind": {
"speed": 6.78,
"deg": 184,
"gust": 12.14
},
"visibility": 10000,
"pop": 0.34,
"sys": {
"pod": "d"
},
"dt_txt": "2022-03-15 15:00:00"
},
{
"dt": 1647360000,
"main": {
"temp": 8.68,
"feels_like": 5.34,
"temp_min": 7.91,
"temp_max": 8.68,
"pressure": 1015,
"sea_level": 1015,
"grnd_level": 1014,
"humidity": 77,
"temp_kf": 0.77
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "overcast clouds",
"icon": "04d"
}
],
"clouds": {
"all": 100
},
"wind": {
"speed": 6.68,
"deg": 186,
"gust": 11.8
},
"visibility": 10000,
"pop": 0.28,
"sys": {
"pod": "d"
},
"dt_txt": "2022-03-15 16:00:00"
},
....
],
"city": {
"id": 2641549,
"name": "Newtonhill",
"coord": {
"lat": 57,
"lon": -2.15
},
"country": "GB",
"population": 3284,
"timezone": 0,
"sunrise": 1647325488,
"sunset": 1647367827
}
}
https://pro.openweathermap.org/data/2.5/forecast/hourly?lat=57&lon=-2.15&appid={API key}&units=imperial
{
"cod": "200",
"message": 0,
"cnt": 96,
"list": [
{
"dt": 1647356400,
"main": {
"temp": 47.91,
"feels_like": 41.94,
"temp_min": 45.36,
"temp_max": 47.91,
"pressure": 1015,
"sea_level": 1015,
"grnd_level": 1014,
"humidity": 78,
"temp_kf": 1.42
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "overcast clouds",
"icon": "04d"
}
],
"clouds": {
"all": 100
},
"wind": {
"speed": 15.17,
"deg": 184,
"gust": 27.16
},
"visibility": 10000,
"pop": 0.34,
"sys": {
"pod": "d"
},
"dt_txt": "2022-03-15 15:00:00"
},
{
"dt": 1647360000,
"main": {
"temp": 47.62,
"feels_like": 41.61,
"temp_min": 46.24,
"temp_max": 47.62,
"pressure": 1015,
"sea_level": 1015,
"grnd_level": 1014,
"humidity": 77,
"temp_kf": 0.77
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "overcast clouds",
"icon": "04d"
}
],
"clouds": {
"all": 100
},
"wind": {
"speed": 14.94,
"deg": 186,
"gust": 26.4
},
"visibility": 10000,
"pop": 0.28,
"sys": {
"pod": "d"
},
"dt_txt": "2022-03-15 16:00:00"
},
....
],
"city": {
"id": 2641549,
"name": "Newtonhill",
"coord": {
"lat": 57,
"lon": -2.15
},
"country": "GB",
"population": 3284,
"timezone": 0,
"sunrise": 1647325488,
"sunset": 1647367827
}
}
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
https://pro.openweathermap.org/data/2.5/forecast/hourly?lat=57&lon=-2.15&appid={API key}&lang={lang}
Parameters | ||
---|---|---|
lang |
optional | Language code |
API call example
https://pro.openweathermap.org/data/2.5/forecast/hourly?lat=57&lon=-2.15&lang=zh_cn&appid={API key}
{
"cod": "200",
"message": 0,
"cnt": 96,
"list": [
{
"dt": 1647356400,
"main": {
"temp": 281.99,
"feels_like": 278.67,
"temp_min": 280.57,
"temp_max": 281.99,
"pressure": 1015,
"sea_level": 1015,
"grnd_level": 1014,
"humidity": 78,
"temp_kf": 1.42
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "阴,多云",
"icon": "04d"
}
],
"clouds": {
"all": 100
},
"wind": {
"speed": 6.78,
"deg": 184,
"gust": 12.14
},
"visibility": 10000,
"pop": 0.34,
"sys": {
"pod": "d"
},
"dt_txt": "2022-03-15 15:00:00"
},
{
"dt": 1647360000,
"main": {
"temp": 281.83,
"feels_like": 278.49,
"temp_min": 281.06,
"temp_max": 281.83,
"pressure": 1015,
"sea_level": 1015,
"grnd_level": 1014,
"humidity": 77,
"temp_kf": 0.77
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "阴,多云",
"icon": "04d"
}
],
"clouds": {
"all": 100
},
"wind": {
"speed": 6.68,
"deg": 186,
"gust": 11.8
},
"visibility": 10000,
"pop": 0.28,
"sys": {
"pod": "d"
},
"dt_txt": "2022-03-15 16:00:00"
},
....
],
"city": {
"id": 2641549,
"name": "Newtonhill",
"coord": {
"lat": 57,
"lon": -2.15
},
"country": "GB",
"population": 3284,
"timezone": 0,
"sunrise": 1647325488,
"sunset": 1647367827
}
}
We support the following languages that you can use with the corresponded lang values:
sq
Albanianaf
Afrikaansar
Arabicaz
Azerbaijanieu
Basquebe
Belarusianbg
Bulgarianca
Catalanzh_cn
Chinese Simplifiedzh_tw
Chinese Traditionalhr
Croatiancz
Czechda
Danishnl
Dutchen
Englishfi
Finnishfr
Frenchgl
Galiciande
Germanel
Greekhe
Hebrewhi
Hindihu
Hungarianis
Icelandicid
Indonesianit
Italianja
Japanesekr
Koreanku
Kurmanji (Kurdish)la
Latvianlt
Lithuanianmk
Macedonianno
Norwegianfa
Persian (Farsi)pl
Polishpt
Portuguesept_br
Português Brasilro
Romanianru
Russiansr
Serbiansk
Slovaksl
Sloveniansp, es
Spanishsv, se
Swedishth
Thaitr
Turkishua, uk
Ukrainianvi
Vietnamesezu
Zulu
Call back function for JavaScript code
To use JavaScript code you can transfer callback
functionName to JSONP callback.
API call example
https://pro.openweathermap.org/data/2.5/forecast/hourly?lat=57&lon=-2.15&callback=test&appid={API key}
test({
"coord":{
"lon":-0.13,
"lat":51.51
},
"weather":[
{
"id":300,
"main":"Drizzle",
"description":"light intensity drizzle",
"icon":"09d"
}
],
"base":"stations",
"main":{
"temp":280.32,
"pressure":1012,
"humidity":81,
"temp_min":279.15,
"temp_max":281.15
},
"visibility":10000,
"wind":{
"speed":4.1,
"deg":80,
"gust":6.1
},
"clouds":{
"all":90
},
"dt":1485789600,
"sys":{
"type":1,
"id":5091,
"message":0.0103,
"country":"GB",
"sunrise":1485762037,
"sunset":1485794875
},
"id":2643743,
"name":"London",
"cod":200
})