All essential weather information in just one API request.
Posted on 12 Jul 2022
Leonardo de Vinci once said that “simplicity is the ultimate sophistication”.
OpenWeather provides this sophistication through the ability to instantly retrieve essential weather information using just one, simple API call. Using only the OpenWeather One Call API 3.0, a wide range of accurate and detailed weather information can be obtained from just one API. If your requirement is for forecast data, then the One Call API 3.0 can provide minute granularity for an hour, hourly for 48 hours and daily for 8 days. If you simply are looking for the current weather, then One Call API 3.0 is perfect for you. You can also use One Call API 3.0 to obtain National weather alerts. We have also extended the functionality of our One Call API 1.0 by giving historical weather data going back more than 40 years, as opposed to the five days for our One Call API 1.0.
Users can monitor their API usage in their personal account and set usage limits to avoid the possibility of paying for unpredictable high loads.
The One Call API 3.0 provides the following weather data for any geographical location:
-
Current weather
-
Minute forecast for 1 hour
-
Hourly forecast for 48 hours
-
Daily forecast for 8 days
-
National weather alerts
-
Historical weather data for 40+ years back (since January 1, 1979) for a specified time.
This versatile API can be used in a wide variety of scenarios:
The insurance industry can gain instant access to claim validating historical weather information for any global location, including values for wind speed and direction, temperature, visibility, sunrise and sunset, rain, snow and even wind gust.
Mobile apps can utilize the variety of data supplied by the One Call API 3.0 to enable their users to access different data sets and alerts, as well as leveraging the ability for the API to exclude certain data sets to reduce the data response to only what is actually required.
Leonardo would be impressed.
Using the OpenWeather One Call API 3.0
The API has just two endpoints for requesting the weather data:
-
Current, Forecasts and National alerts
-
Historical data
Requesting Current, Forecasts and National alerts data:
The following API call can be made:
https://api.openweathermap.org/data/3.0/onecall?lat={lat}&lon={lon}&exclude={part}&appid={API key}
With the following parameters:
-
Geographical coordinates (latitude, longitude)
-
Your unique API key - (you can always find it on your account page under the "API key" tab)
-
Exclusion parameters - using this parameter you can exclude some parts of the weather data from the API response
-
Units of measurement. standard, metric and imperial units are available
-
Language - You can use the lang parameter to get the output in your language.
Each API response contains the following parts:
-
Current data
-
Minute forecast for 1 hour
-
Hourly forecast for 48 hours
-
Daily forecast for 8 days
-
National alerts (if predicted).
Details of the response can be found here.
Requesting historical data:
The following API call can be made:
https://api.openweathermap.org/data/3.0/onecall/timemachine?lat={lat}&lon={lon}&dt={time}&appid={API key}
With the following parameters:
-
Geographical coordinates (latitude, longitude)
-
Timestamp (Unix time, UTC time zone), e.g. dt=1586468027. Data is available from 1st January 1979
-
Your unique API key (you can always find it on your account page under the "API key" tab)
-
Units of measurement. standard, metric and imperial units are available
-
Language - You can use the lang parameter to get the output in your language.
The API response contains weather data for a specified timestamp.
Details of the response can be found here.
Pricing and Subscription:
The new OpenWeather subscription plan “One Call by Call” is used solely for our One Call API 3.0.
This subscription includes 1,000 free API calls per day.
Using the “One Call by Call” subscription plan:
-
Subscribe to the “One Call by Call” plan and start using the One Call API 3.0.
-
If 1,000 API calls per day are exceeded, our system starts counting exceeding calls.
-
At the end of the billing month, the payment for exceeded calls will be charged automatically.
Pricing and subscription details can be found here.
Technical support and details of how to start using the OpenWeather One Call API 3.0 can be found here.
For more information on how to gain access to our OpenWeather One Call API 3.0, please e-mail us.