The Weather API lets you request weather conditions, such as temperature, wind speeds, humidity, precipitation, etc for a specific location. The API provides endpoints that let you query:
This example shows a request to get the current weather conditions for central Paris (48.857456, 2.354611) using the default request parameters settings
Returns hourly weather forecasts for the specified location. Each forecast includes hourly weather temperature, wind speeds, humidity, precipitation, etc. For a maximum of 120 hours (5 days).
Use the hours parameter to set the number of hours for which to request forecasts.
Returns daily current and future weather forecasts for the specified location. Each forecast includes daily UV radiation, sunrise and sunset times, and moon conditions for a maximum of five days of daily forecasts.
Use the days parameter to set the number of days for which to request forecasts.
Days: A period of 24 hours starting from the start_date timestamp. Each period represents one full day (00:00 - 23:59) according to the specified location’s local time.
Current/Coming Day: The first day of forecast data includes the current day. As evening (as defined by the location’s time zone) approaches the current day’s forecast is no longer relevant. Therefore, requests sent in the later part of the day, return the following days forecast.
The response data field is an array of objects, where each of them include the following fields:
TIP
The data object:
In cases, where weather data is unavailable or could not be calculated the field returns null.
By default, the response uses metric units. For more information, see Unit Systems
start_date
string
ISO 8601 UTC timestamp indicating the beginning of the day (midnight) at the queried location. This starting time of the 24 hour period over which weather data measured and indexes calculated.
2018-10-02T22:00:00Z, is midnight, 2018-10-03T00:00:00 in France, which is the queried location.
sun
object
Object that contains sunrise and set times for a 24 hour. The period starts from 00:00 to 23:59 local time
Show child fields
sunrise_time
string
ISO 8601 UTC timestamp indicating that day’s sunrise
Object that contains lunar data for a 24 hour. The period starts from 00:00 to 23:59 local time.
Note:
In cases where moonrise or moonset is not expected within the expected 24 hour period, the relevant fields return: “ --- “
Show child fields
moonrise_time
string
ISO 8601 UTC timestamp indicating that day’s moonrise
moonset_time
string
ISO 8601 UTC timestamp indicating that day’s moonset
moon_phase
string
Text of the Moon phase name. The scope of values are: 'new', 'waxing crescent', 'first quarter, 'waxing gibbous', 'full', 'waning gibbous', 'last quarter', 'waning crescent'
sunset_time returnsT24:00:00 of the same day (i.e. "2017-07-04T24:00:00Z”)
Polar Night(opens new window): When the night lasts for more than 24 hours, sunrise_time and sunset_time will be: T00:00:00 (i.e. "2017-07-04T00:00:00Z")
Polar Areas Above 66.5 Degrees: There might be missing sunrise, followed by an actual sunset if the period of polar days ends, or a missing sunset, followed by an actual sunrise if the period of polar days starts. In these cases, the value in the correspond field will be: “ --- “
Any request to an API endpoint can return metadata that describes the original request. You request metadata by including the metadata parameter in your request with the value true. When excluding the metadata parameter, or setting it to false, the metadata field returns null.
When requested, it has slightly different structure, depending on the request type
Requests for a specific date and time return a single object, and a metadata object with a single timestamp. This example shows a request to the current conditions endpoint for a specific date and time that returns metadata:
Requests for the next number of hours or days return an array of objects, and a metadata object with a range of timestamps. This example shows a request to the hourly forecast API endpoint for the next three hours that returns metadata:
This table lists the icon codes returned by the Current Conditions and Hourly Forecast Weather endpoints. For each icon code, a description (Weather Text) is returned that
summarises sunshine, cloud, precipitation type, intensity, and thunderstorms weather conditions for the requested time period.
TIP
Note:
You use values the icon_code and is_day_time fields return to display the day or night icon image that best describes the weather conditions and time of day.
You can create your own set of weather icons, with 70 different icons divided into two sets of 35 for day and night times.
Icon Code
Weather Text
1
Clear, cloudless sky
2
Clear, few cirrus
3
Clear with cirrus
4
Clear with few low clouds
5
Clear with few low clouds and few cirrus
6
Clear with few low clouds and cirrus
7
Partly cloudy
8
Partly cloudy and few cirrus
9
Partly cloudy and cirrus
10
Mixed with some thunderstorm clouds possible
11
Mixed with few cirrus with some thunderstorm clouds possible
12
Mixed with cirrus and some thunderstorm clouds possible