Advanced Weather API
Purpose
The Advanced Weather API delivers spatio-temporally resolved, real-time weather information. The provided content is comprised of polygonal information about radar-based current precipitation and precipitation forecasts in different time slices.
Request data
HTTPS Method: GET
For ease of viewing and identification:
- Constants and parameters enclosed in curly brackets { } must be replaced with their values.
- Please see the following Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.
Format
https://{baseURL}/weatherpolygons/{version}/{regionCode}?key={Your_API_Key}
curl 'https://{baseURL}/weatherpolygons/{version}/{regionCode}?key={Your_API_Key}'
Example
https://api.tomtom.com/weatherpolygons/v1/europe?key={Your_API_Key}
Request parameters
Required parameters | Description |
---|---|
| Base URL for calling TomTom services. |
| The version of the service to call. |
| The name of the product region. See the
Region Coverage for supported
|
| Authorization key for access to the API. |
Request headers
Note: There are no required request headers in this endpoint.
Optional headers | Description |
---|---|
Requests that the response compressed in the specified way. The
fuelprices service supports http compression if desired. Currently, only
gzip is supported. | |
Provides the entity-tag (E-tag)
of the requested resource as last received by the client. Allows
efficient updates of cached information with a minimum amount of
transaction overhead: The service can respond with a | |
Specifies the time stamp of the last actual update of the requested
resource received by the client. Allows the service to respond with an
HTTP |
Content
Plain GET messages must be used to create requests.
Response data
The weather polygons are served in GeoJSON format. The root level of the response is a single FeatureCollection holding all weather polygons.
Every weather polygon is represented by a Feature
, having a unique id and a set of properties. The enclosing FeatureCollection
has an additional set
of properties holding metadata such as the creation time of the response.
Response codes
Code | Meaning & possible causes |
---|---|
| OK |
| Not Modified : The requested content did not change since the last request, as indicated by the value(s) of the If-Modified-Since and/or If-None-Match http header fields. |
| Unauthorized : The supplied API key is not valid for this request (or missing). |
| Not Found : The specified path was not valid. At least one of the path parameters was omitted or not entered correctly. If an unsupported or invalid country code was specified, the included response message provides a list of valid available country codes. |
| Internal Server Error : Oops. |
Response headers
Header | Description |
---|---|
The service supports http compression if desired. Currently, only gzip
is supported. | |
The format of the served resource. The service always provides data in
GeoJSON. | |
A timestamp specifying when the response was sent. Can be used by the
client in the If-Modified-Since header field of subsequent requests in
order to optimize the update procedure. | |
Entity-tag of the served resource. Can be used by the client in the
If-None-Match header field of subsequent requests in order to optimize
the update procedure. |
Response example
1{2 "type": "FeatureCollection",3 "features": [4 {5 "type": "Feature",6 "id": "0",7 "properties": {8 "uniqueId": "7ffffff",9 "category": "precip",10 "type": "rain",11 "level": 0.86,12 "area": 80.968,13 "children": [],14 "parent": "1",15 "countries": ["ESP"]16 },17 "geometry": {18 "type": "Polygon",19 "coordinates": [20 [21 [-3.774, 37.513],22 [-3.68, 37.568],23 [-3.67, 37.628],24 [-3.695, 37.653],25 [-3.759, 37.608],26 [-3.779, 37.518]27 ]28 ]29 },30 "bbox": [-3.779, 37.513, -3.67, 37.653]31 }32 ],33 "properties": {34 "forecastOffset": 15,35 "creationTime": "2015-10-13T11:14:53.70Z",36 "timeStamp": "2015-10-13T11:14:53.70Z",37 "rootTimeStamp": "2015-10-13T11:14:53.70Z"38 }39}
Response structure
FeatureCollection properties
Property | Description |
---|---|
| The forecast horizon of the weather polygon in minutes. A zero stands for the present time. |
| Time of the request in UTC as an ISO-8601-compliant date-time string of the form YYYY-MM-DDThh:mm:ssTZD (Year-Month-DayTHour:Minute:SecondTZD), e.g., "2015-06-09T10:00:00Z". |
| Time of which the weather polygons refer to (may be in the future) in UTC as an ISO-8601-compliant date-time string of the form YYYY-MM-DDThh:mm:ssTZD (Year-Month-DayTHour:Minute:SecondTZD), e.g., "2015-06-09T10:00:00Z". |
| Time at which the weather polygons were measured/predicted in UTC as an ISO-8601-compliant date-time string of the form YYYY-MM-DDThh:mm:ssTZD (Year-Month-DayTHour:Minute:SecondTZD), e.g., "2015-06-09T10:00:00Z". |
Feature properties
Property | Description |
---|---|
| A unique and stable id of the current weather polygon. |
| The category of the weather polygon, e.g., "precip" (see section Category Values ). |
| The type of the weather polygon, e.g., "rain" (see section Type Values ). |
| The level of the weather atom, i.e., a numeric value describing its magnitude. |
| The area of the weather polygon in square kilometers (km²). |
| A list of Feature-Ids that represent polygons of the same category and type with the next higher level which lie inside the weather polygon. An empty array means no children. |
| A single Feature-Id that represents the polygon of the next lower level which contains the weather polygon. An empty string means no parent. |
| The list of countries, given as ISO 3166-1 alpha-3 country codes that intersect with the weather polygon. |
The Feature-Id is given by the id of the
Feature
object, see also the Feature specification.
Category values
Category | Description |
---|---|
| Regional information about the precipitation in the form of regions with different precipitation levels. |
Type values
-
Type values for category
precip
rain
snow
mixed
hail
Level values
-
Level values for category
precip
The value of a level specifies the precipitation intensity in mm/h.
Usage and Freshness
The weather polygons are updated regularly, typical frequencies being in the order of 15 minutes. Using the support for the If-None-Match or If-Modified-Since header fields, higher update request frequencies can be used to minimize the delay between updated information being available in the server and being received by the client.
Region Coverage
Region | RegionCode |
---|---|
Europe |
|
USA |
|
North America |
|
Latin America |
|
Australia |
|