One Call API

Make just one API call and get all your essential weather data for a specific location with our new OpenWeather One Call API.
Easy migration from the Dark Sky API.

The One Call API provides the following weather data for any geographical coordinates:

  • Current weather
  • Minute forecast for 1 hour
  • Hourly forecast for 48 hours
  • Daily forecast for 7 days
  • Government weather alerts
  • Historical weather data for the previous 5 days

Current and forecast weather data

To get access to current weather, minute forecast for 1 hour, hourly forecast for 48 hours, daily forecast for 7 days and government weather alerts, please use this section of the documentation.

If you are interested in historical weather data, please read the "Historical weather data" section.

How to make an API call

API call

https://api.openweathermap.org/data/2.5/onecall?lat={lat}&lon={lon}&exclude={part}&appid={API key}
Parameters
lat, lon required Geographical coordinates (latitude, longitude)
appid required Your unique API key (you can always find it on your account page under the "API key" tab)
exclude optional By using this parameter you can exclude some parts of the weather data from the API response. It should be a comma-delimited list (without spaces).

Available values:

  • current
  • minutely
  • hourly
  • daily
  • alerts
units optional Units of measurement. standard, metric and imperial units are available. If you do not use the units parameter, standard units will be applied by default. Learn more
lang optional You can use the lang parameter to get the output in your language. Learn more

Example of API call

https://api.openweathermap.org/data/2.5/onecall?lat=33.441792&lon=-94.037689&exclude=hourly,daily&appid={API key}

Example of API response

Example of API response
                
{
  "lat": 40.12,
  "lon": -96.66,
  "timezone": "America/Chicago",
  "timezone_offset": -18000,
  "current": {
    "dt": 1595243443,
    "sunrise": 1595243663,
    "sunset": 1595296278,
    "temp": 293.28,
    "feels_like": 293.82,
    "pressure": 1016,
    "humidity": 100,
    "dew_point": 293.28,
    "uvi": 10.64,
    "clouds": 90,
    "visibility": 10000,
    "wind_speed": 4.6,
    "wind_deg": 310,
    "weather": [
      {
        "id": 501,
        "main": "Rain",
        "description": "moderate rain",
        "icon": "10n"
      },
      {
        "id": 201,
        "main": "Thunderstorm",
        "description": "thunderstorm with rain",
        "icon": "11n"
      }
    ],
    "rain": {
      "1h": 2.93
    }
  },
  "minutely": [
    {
      "dt": 1595243460,
      "precipitation": 2.928
    },
    ...
  },
    "hourly": [
    {
      "dt": 1595242800,
      "temp": 293.28,
      "feels_like": 293.82,
      "pressure": 1016,
      "humidity": 100,
      "dew_point": 293.28,
      "clouds": 90,
      "visibility": 10000,
      "wind_speed": 4.6,
      "wind_deg": 123,
      "weather": [
        {
          "id": 501,
          "main": "Rain",
          "description": "moderate rain",
          "icon": "10n"
        }
      ],
      "pop": 0.99,
      "rain": {
        "1h": 2.46
      }
    },
    ...
  }
"daily": [
    {
      "dt": 1595268000,
      "sunrise": 1595243663,
      "sunset": 1595296278,
      "temp": {
        "day": 298.82,
        "min": 293.25,
        "max": 301.9,
        "night": 293.25,
        "eve": 299.72,
        "morn": 293.48
      },
      "feels_like": {
        "day": 300.06,
        "night": 292.46,
        "eve": 300.87,
        "morn": 293.75
      },
      "pressure": 1014,
      "humidity": 82,
      "dew_point": 295.52,
      "wind_speed": 5.22,
      "wind_deg": 146,
      "weather": [
        {
          "id": 502,
          "main": "Rain",
          "description": "heavy intensity rain",
          "icon": "10d"
        }
      ],
      "clouds": 97,
      "pop": 1,
      "rain": 12.57,
      "uvi": 10.64
    },
    ...
    },
"alerts": [
    {
      "sender_name": "NWS Tulsa (Eastern Oklahoma)",
      "event": "Heat Advisory",
      "start": 1597341600,
      "end": 1597366800,
      "description": "...HEAT ADVISORY REMAINS IN EFFECT FROM 1 PM THIS AFTERNOON TO\n8 PM CDT THIS EVENING...\n* WHAT...Heat index values of 105 to 109 degrees expected.\n* WHERE...Creek, Okfuskee, Okmulgee, McIntosh, Pittsburg,\nLatimer, Pushmataha, and Choctaw Counties.\n* WHEN...From 1 PM to 8 PM CDT Thursday.\n* IMPACTS...The combination of hot temperatures and high\nhumidity will combine to create a dangerous situation in which\nheat illnesses are possible."
    },
    ...
  ]
                
              

Fields in API response

  • lat Geographical coordinates of the location (latitude)
  • lon Geographical coordinates of the location (longitude)
  • timezone Timezone name for the requested location
  • timezone_offset Shift in seconds from UTC
  • current Current weather data API response
    • current.dt Current time, Unix, UTC
    • current.sunrise Sunrise time, Unix, UTC
    • current.sunset Sunset time, Unix, UTC
    • current.temp Temperature. Units - default: kelvin, metric: Celsius, imperial: Fahrenheit. How to change units used
    • current.feels_like Temperature. This temperature parameter accounts for the human perception of weather. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
    • current.pressure Atmospheric pressure on the sea level, hPa
    • current.humidity Humidity, %
    • current.dew_point AAtmospheric temperature (varying according to pressure and humidity) below which water droplets begin to condense and dew can form. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
    • current.clouds Cloudiness, %
    • current.uvi Midday UV index
    • current.visibility Average visibility, metres
    • current.wind_speed Wind speed. Wind speed. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour. How to change units used
    • current.wind_gust (where available) Wind gust. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour. How to change units used
    • current.wind_deg Wind direction, degrees (meteorological)
    • current.rain
      • current.rain.1h (where available) Rain volume for last hour, mm
    • current.snow
      • current.snow.1h (where available) Snow volume for last hour, mm
    • current.weather
  • minutely Minute forecast weather data API response
    • minutely.dt Time of the forecasted data, unix, UTC
    • minutely.precipitation Precipitation volume, mm
  • hourly Hourly forecast weather data API response
    • hourly.dt Time of the forecasted data, Unix, UTC
    • hourly.temp Temperature. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit. How to change units used
    • hourly.feels_like Temperature. This accounts for the human perception of weather. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
    • hourly.pressure Atmospheric pressure on the sea level, hPa
    • hourly.humidity Humidity, %
    • hourly.dew_point Atmospheric temperature (varying according to pressure and humidity) below which water droplets begin to condense and dew can form. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
    • hourly.clouds Cloudiness, %
    • hourly.visibility Average visibility, metres
    • hourly.wind_speed Wind speed. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour.How to change units used
    • hourly.wind_gust (where available) Wind gust. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour. How to change units used
    • chourly.wind_deg Wind direction, degrees (meteorological)
    • hourly.pop Probability of precipitation
    • hourly.rain
      • hourly.rain.1h (where available) Rain volume for last hour, mm
    • hourly.snow
      • hourly.snow.1h (where available) Snow volume for last hour, mm
    • hourly.weather
  • daily Daily forecast weather data API response
    • daily.dt Time of the forecasted data, Unix, UTC
    • daily.sunrise Sunrise time, Unix, UTC
    • daily.sunset Sunset time, Unix, UTC
    • daily.temp Units – default: kelvin, metric: Celsius, imperial: Fahrenheit. How to change units used
      • daily.temp.morn Morning temperature.
      • daily.temp.day Day temperature.
      • daily.temp.eve Evening temperature.
      • daily.temp.night Night temperature.
      • daily.temp.min Min daily temperature.
      • daily.temp.max Max daily temperature.
    • daily.feels_like This accounts for the human perception of weather. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit. How to change units used
      • daily.feels_like.morn Morning temperature.
      • daily.feels_like.day Day temperature.
      • daily.feels_like.eve Evening temperature.
      • daily.feels_like.night Night temperature.
    • daily.pressure Atmospheric pressure on the sea level, hPa
    • daily.humidity Humidity, %
    • daily.dew_point Atmospheric temperature (varying according to pressure and humidity) below which water droplets begin to condense and dew can form. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
    • daily.wind_speed Wind speed. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour. How to change units used
    • daily.wind_gust (where available) Wind gust. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour. How to change units used
    • daily.wind_deg Wind direction, degrees (meteorological)
    • daily.clouds Cloudiness, %
    • daily.uvi Midday UV index
    • daily.visibility Average visibility, metres
    • daily.pop Probability of precipitation
    • daily.rain (where available) Precipitation volume, mm
    • daily.snow (where available) Snow volume, mm
    • daily.weather
  • alerts Government weather alerts data from major national weather warning systems
    • alerts.sender_name Name of the alert source
    • alerts.event Alert event name
    • alerts.start Date and time of the start of the alert, Unix, UTC
    • alerts.end Date and time of the end of the alert, Unix, UTC
    • alerts.description Description of the alert

Historical weather data

To learn about how get access to historical weather data for the previous 5 days, please use this section of the documentation.

If you are interested in current weather data, forecasts and weather alerts please read the "Current and forecast weather data" section.

How to make an API call

API call

https://api.openweathermap.org/data/2.5/onecall/timemachine?lat={lat}&lon={lon}&dt={time}&appid={API key}
Parameters
lat, lon required Geographical coordinates (latitude, longitude)
dt required Date from the previous five days (Unix time, UTC time zone), e.g. dt=1586468027
appid required Your unique API key (you can always find it on your account page under the "API key" tab)
units optional Units of measurement. standard, metric and imperial units are available. If you do not use the units parameter, standard units will be applied by default. Learn more
lang optional You can use the lang parameter to get the output in your language. Learn more
Please note that in order to get historical data for the last five days, you need to make five API calls (one call for each day).

Example of API call

http://api.openweathermap.org/data/2.5/onecall/timemachine?lat=60.99&lon=30.9&dt=1586468027&appid={API key}

Example of API response

Example of API response
                   
  {
    "lat": 60.99,
    "lon": 30.9,
    "timezone": "Europe/Moscow",
    "timezone_offset": 10800"
    "current": {
      "dt": 1586468027,
      "sunrise": 1586487424,
      "sunset": 1586538297,
      "temp": 274.31,
      "feels_like": 269.79,
      "pressure": 1006,
      "humidity": 72,
      "dew_point": 270.21,
      "clouds": 0,
      "visibility": 10000,
      "wind_speed": 3,
      "wind_deg": 260,
      "weather": [
        {
          "id": 800,
          "main": "Clear",
          "description": "clear sky",
          "icon": "01n"
        }
      ]
    },
    "hourly": [
      {
        "dt": 1586390400,
        "temp": 278.41,
        "feels_like": 269.43,
        "pressure": 1006,
        "humidity": 65,
        "dew_point": 272.46,
        "clouds": 0,
        "wind_speed": 9.83,
        "wind_deg": 60,
        "wind_gust": 15.65,
        "weather": [
          {
            "id": 800,
            "main": "Clear",
            "description": "clear sky",
            "icon": "01n"
          }
        ]
      },
      ...
    }
                   
                 

Fields in API response

  • lat Geographical coordinates of the location (latitude)
  • lon Geographical coordinates of the location (longitude)
  • timezone Timezone name for the requested location
  • timezone_offset Shift in seconds from UTC
  • current Data point dt refers to the requested time, rather than the current time
    • current.dt Requested time, Unix, UTC
    • current.sunrise Sunrise time, Unix, UTC
    • current.sunset Sunset time, Unix, UTC
    • current.temp Temperature. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit. How to change units used
    • current.feels_like Temperature. This accounts for the human perception of weather. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
    • current.pressure Atmospheric pressure on the sea level, hPa
    • current.humidity Humidity, %
    • current.dew_point Atmospheric temperature (varying according to pressure and humidity) below which water droplets begin to condense and dew can form. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
    • current.clouds Cloudiness, %
    • current.uvi Midday UV index
    • current.visibility Average visibility, metres
    • current.wind_speed Wind speed. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour. How to change units used
    • current.wind_gust (where available) Wind gust. Wind speed. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour. How to change units used
    • current.wind_deg Wind direction, degrees (meteorological)
    • current.rain (where available) Precipitation volume, mm
    • current.snow (where available) Snow volume, mm
    • current.weather
  • hourly Data block contains hourly historical data starting at 00:00 on the requested day and continues until 23:59 on the same day (UTC time)
    • hourly.dt Time of historical data, Unix, UTC
    • hourly.temp Temperature. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit. How to change units used
    • hourly.feels_like Temperature. This accounts for the human perception of weather. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
    • hourly.pressure Atmospheric pressure on the sea level, hPa
    • hourly.humidity Humidity, %
    • hourly.dew_point Atmospheric temperature (varying according to pressure and humidity) below which water droplets begin to condense and dew can form. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
    • hourly.clouds Cloudiness, %
    • hourly.visibility Average visibility, metres
    • hourly.wind_speed Wind speed. Wind speed. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour. How to change units used
    • hourly.wind_gust (where available) Wind gust. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour. How to change units used
    • chourly.wind_deg Wind direction, degrees (meteorological)
    • hourly.rain (where available) Precipitation volume, mm
    • hourly.snow (where available) Snow volume, mm
    • hourly.weather

List of weather condition codes

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

Other features

Units of measurement

standard, metric and imperial units are available.

List of all API parameters with available units.

API call

http://api.openweathermap.org/data/2.5/onecall?lat={lat}&lon={lon}&units={units}
Parameters
units optional Units of measurement. standard, metric and imperial units are available. If you do not use the units parameter, standard units will be applied by default.
Temperature is available in Fahrenheit, Celsius and Kelvin units.

Wind speed is available in miles/hour and meter/sec.

  • For temperature in Fahrenheit and wind speed in miles/hour, use units=imperial
  • For temperature in Celsius and wind speed in meter/sec, use units=metric
  • Temperature in Kelvin and wind speed in meter/sec is used by default, so there is no need to use the units parameter in the API call if you want this

Examples of API calls

Standard (default)

api.openweathermap.org/data/2.5/onecall?lat=30.489772&lon=-99.771335

Metric

api.openweathermap.org/data/2.5/onecall?lat=30.489772&lon=-99.771335&units=metric

Imperial

api.openweathermap.org/data/2.5/onecall?lat=30.489772&lon=-99.771335&units=imperial

Multilingual support

You can use lang parameter to get the output in your language.

The contents of the description field will be translated.

API call

http://api.openweathermap.org/data/2.5/onecall?lat={lat}&lon={lon}&lang={lang}
Parameters
lang optional You can use the lang parameter to get the output in your language.

Example of API call

http://api.openweathermap.org/data/2.5/onecall?lat=30.489772&lon=-99.771335&lang=zh_cn

We support the following languages. To select one, you can use the corresponding language code:

  • af Afrikaans
  • al Albanian
  • ar Arabic
  • az Azerbaijani
  • bg Bulgarian
  • ca Catalan
  • cz Czech
  • da Danish
  • de German
  • el Greek
  • en English
  • eu Basque
  • fa Persian (Farsi)
  • fi Finnish
  • fr French
  • gl Galician
  • he Hebrew
  • hi Hindi
  • hr Croatian
  • hu Hungarian
  • id Indonesian
  • it Italian
  • ja Japanese
  • kr Korean
  • la Latvian
  • lt Lithuanian
  • mk Macedonian
  • no Norwegian
  • nl Dutch
  • pl Polish
  • pt Portuguese
  • pt_br Português Brasil
  • ro Romanian
  • ru Russian
  • sv, se Swedish
  • sk Slovak
  • sl Slovenian
  • sp, es Spanish
  • sr Serbian
  • th Thai
  • tr Turkish
  • ua, uk Ukrainian
  • vi Vietnamese
  • zh_cn Chinese Simplified
  • zh_tw Chinese Traditional
  • zu Zulu

Call back function for JavaScript code

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

API call example

api.openweathermap.org/data/2.5/onecall?lat=38.8&lon=12.09&callback=test
                           
test({
  "lat": 40.12,
  "lon": -96.66,
  "timezone": "America/Chicago",
  "timezone_offset": -18000,
  "current": {
    "dt": 1595243443,
    "sunrise": 1595243663,
    "sunset": 1595296278,
    "temp": 293.28,
    "feels_like": 293.82,
    "pressure": 1016,
    "humidity": 100,
    "dew_point": 293.28,
    "uvi": 10.64,
    "clouds": 90,
    "visibility": 10000,
    "wind_speed": 4.6,
    "wind_deg": 310,
    "weather": [
      {
        "id": 501,
        "main": "Rain",
        "description": "moderate rain",
        "icon": "10n"
      },
      {
        "id": 201,
        "main": "Thunderstorm",
        "description": "thunderstorm with rain",
        "icon": "11n"
      }
    ],
    "rain": {
      "1h": 2.93
    }
  },
  "minutely": [
    {
      "dt": 1595243460,
      "precipitation": 2.928
    },
    ...
  },
    "hourly": [
    {
      "dt": 1595242800,
      "temp": 293.28,
      "feels_like": 293.82,
      "pressure": 1016,
      "humidity": 100,
      "dew_point": 293.28,
      "clouds": 90,
      "visibility": 10000,
      "wind_speed": 4.6,
      "wind_deg": 123,
      "weather": [
        {
          "id": 501,
          "main": "Rain",
          "description": "moderate rain",
          "icon": "10n"
        }
      ],
      "pop": 0.99,
      "rain": {
        "1h": 2.46
      }
    },
    ...
  }
"daily": [
    {
      "dt": 1595268000,
      "sunrise": 1595243663,
      "sunset": 1595296278,
      "temp": {
        "day": 298.82,
        "min": 293.25,
        "max": 301.9,
        "night": 293.25,
        "eve": 299.72,
        "morn": 293.48
      },
      "feels_like": {
        "day": 300.06,
        "night": 292.46,
        "eve": 300.87,
        "morn": 293.75
      },
      "pressure": 1014,
      "humidity": 82,
      "dew_point": 295.52,
      "wind_speed": 5.22,
      "wind_deg": 146,
      "weather": [
        {
          "id": 502,
          "main": "Rain",
          "description": "heavy intensity rain",
          "icon": "10d"
        }
      ],
      "clouds": 97,
      "pop": 1,
      "rain": 12.57,
      "uvi": 10.64
    },
    ...
    },
"alerts": [
    {
      "sender_name": "NWS Tulsa (Eastern Oklahoma)",
      "event": "Heat Advisory",
      "start": 1597341600,
      "end": 1597366800,
      "description": "...HEAT ADVISORY REMAINS IN EFFECT FROM 1 PM THIS AFTERNOON TO\n8 PM CDT THIS EVENING...\n* WHAT...Heat index values of 105 to 109 degrees expected.\n* WHERE...Creek, Okfuskee, Okmulgee, McIntosh, Pittsburg,\nLatimer, Pushmataha, and Choctaw Counties.\n* WHEN...From 1 PM to 8 PM CDT Thursday.\n* IMPACTS...The combination of hot temperatures and high\nhumidity will combine to create a dangerous situation in which\nheat illnesses are possible."
    },
    ...
  ]
  })