Advanced Weather API

Service version: v1
Last edit: 2022.08.25

Purpose

The Advanced Weather API delivers spatio-temporally resolved, real-time weather information. The provided content comprises polygonal information about radar-based current precipitation, precipitation forecasts in different time slices, and local warnings about safety-relevant weather events for the present and future.

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

GET
URL request format
https://{baseURL}/weatherpolygons/{version}/{regionCode}?key={Your_API_Key}
GET
curl request format
curl 'https://{baseURL}/weatherpolygons/{version}/{regionCode}?key={Your_API_Key}'

Example

GET
URL request example
https://api.tomtom.com/weatherpolygons/v1/europe?key={Your_API_Key}

Request parameters

Required parametersDescription
baseURL
string
Base URL for calling TomTom services.
Value: api.tomtom.com
version
string
The version of the service to call.
Value: v1
regionCode
string
The name of the product region. See the Region Coverage for supported regionCode values.
Value: Example: europe
key
string
Authorization key for access to the API.
Value: Your valid API Key.

Request headers

Note: There are no required request headers in this endpoint.

Optional headersDescription
Accept-EncodingRequests that the response compressed in the specified way. The fuelprices service supports http compression if desired. Currently, only gzip is supported.
Value: gzip
If-None-MatchProvides 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 304 (not modified) message if the data that would otherwise be provided has the same entity tag.
Value: 4f3d2af4
If-Modified-SinceSpecifies the time stamp of the last actual update of the requested resource received by the client. Allows the service to respond with an HTTP 304 (not modified) message if no newer data is available.
Value: Sat, 29 Oct 1994 19:43:31 GMT

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

CodeMeaning & possible causes
200OK
304Not 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.
401Unauthorized: The supplied API key is not valid for this request (or missing).
404Not 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.
500Internal Server Error: Oops.

Response headers

HeaderDescription
Content-EncodingThe service supports http compression if desired. Currently, only gzip is supported.
Example: gzip
Content-TypeThe format of the served resource. The service always provides data in GeoJSON.
Example: application/json
DateA 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.
Example: Wed, 20 Jul 2016 14:23:59 GMT
E-tagEntity-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.
Example: 4f3d2af4

Response example

Response body example - JSON
1{
2 "type" : "FeatureCollection",
3 "features" : [ {
4 "type" : "Feature",
5 "id" : "0",
6 "properties" : {
7 "uniqueId" : "7ffffff",
8 "category" : "precip",
9 "type" : "rain",
10 "level" : 0.86,
11 "area" : 80.968,
12 "children" : [ ],
13 "parent" : "1",
14 "countries" : [ "ESP" ]
15 },
16 "geometry" : {
17 "type" : "Polygon",
18 "coordinates" : [ [ [ -3.774, 37.513 ], [ -3.68, 37.568 ], [ -3.67, 37.628 ], [ -3.695, 37.653 ], [ -3.759, 37.608 ], [ -3.779, 37.518 ] ] ]
19 },
20 "bbox" : [ -3.779, 37.513, -3.67, 37.653 ]
21 } ],
22 "properties" : {
23 "forecastOffset" : 15,
24 "creationTime" : "2015-10-13T11:14:53.70Z",
25 "timeStamp" : "2015-10-13T11:14:53.70Z",
26 "rootTimeStamp" : "2015-10-13T11:14:53.70Z"
27 }
28}

Response structure

FeatureCollection properties

PropertyDescription
forecastOffset
integer
The forecast horizon of the weather polygon in minutes. A zero stands for the present time.
creationTime
string
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".
timeStamp
string (datetime)
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".
rootTimeStamp
string (datetime)
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

PropertyDescription
uniqueId
string
A unique and stable id of the current weather polygon.
category
string
The category of the weather polygon, e.g., "precip" (see section Category Values).
type
string
The type of the weather polygon, e.g., "rain" (see section Type Values).
level
integer
The level of the weather atom, i.e., a numeric value describing its magnitude.
area
integer
The area of the weather polygon in square kilometers (km²).
children
array (of strings)
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.
parent
string
A single Feature-Id that represents the polygon of the next lower level which contains the weather polygon. An empty string means no parent.
countries
array (of strings)
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

CategoryDescription
precip
string
Regional information about the precipitation in the form of regions with different precipitation levels.
warning
string
Regional information about severe-weather conditions.

Type values

The type values are depending on the category value.

  • Type values for category precip
    • rain
    • snow
    • mixed
    • hail
  • Type values for category warning
    • storm
    • thunderstorm
    • heavyrain
    • snowfall
    • frost
    • sleet
    • heat
    • slipperiness
    • forestfire
    • groundfrost
    • fog
    • freezingrain
    • cyclone
    • blizzard

Level values

The level values are depending on the category.

  • Level values for category precip

The value of a level specifies the precipitation intensity in mm/h.

  • Level values for category warning
ValueDescription
0moderate (precipitation intensity)
1heavy (precipitation intensity)
2extreme (precipitation intensity)

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

RegionRegionCode
Europeeurope
USAusa