Statistical Weather Data API is now available!

Statistical Weather Data API is now available!

Posted on 15 Jul 2019

We are pleased to announce that our new Statistical Weather Data API is now available!

Statistical Weather Data is an API that can provide its users with aggregated statistical weather data for cities.

You can receive statistical weather data:

- for any day of the year, by using the month’s number and a number of one single day in this month (Daily aggregation). An API response will return weather data for a single day that was chosen by user;
- for any month of the year, by using the month’s number (Monthly aggregation). An API response will return aggregated weather data for a chosen month;
- combined data set for the whole year with division for days; data for 365 days in one single API response (Yearly aggregation)

For main weather parameters (Temperature, Pressure, Humidity, Wind, Precipitation and Clouds), you can request the following statistical data:

- Absolute minimum and maximum based on all historical measurements for this day/month;
- The median value;
- Average of all measurements for this day/month;
- Values of the first and third quartiles;
Standard deviation;
- Number of observations that were employed for an aggregation.

For Temperature parameter, you can request an average of all minimum and an average of all maximum values for a chosen day/month. Similarly, for Monthly aggregation, you can request an average number of sunny hours in the chosen month.

For more information on weather parameters and their values, please visit our documentation page.

In order to receive the data, all you need to do is create an API request that mentions all of the following:

-For daily aggregation, a number of the month and a number of the chosen day in this month. For monthly aggregation, a number of the chosen month.
-Specify the location by using any of the following approaches: city name and country code, city id, geographic coordinates.
-Include your unique APPID (API key).

Examples of an API call:

For Yearly aggregation, using city ID:
history.openweathermap.org/data/2.5/aggregated/year?id={city ID}

For Monthly aggregation, using city name and country code:
history.openweathermap.org/data/2.5/aggregated/month?q={city name},{country code}&month={number of month}

For Daily aggregation, using geographical coordinates:
history.openweathermap.org/data/2.5/aggregated/day?lat={lat}&lon={lon}&month={number of month}&day={number of day}

Example of API response of Yearly aggregation:

In order to receive an APPID (API key), you need to register using the link located on your account page. Alternatively, you can use an API key that has been already created.

For API requests, please see the documentation here.

For more information on subscriptions that include Statistical Weather Data API, please see the pricing page.

We would be glad to receive your feedback and suggestions at info@openweathermap.org.

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.