Advanced Weather API

Introduction

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

Format

GET
URL request example
https://{baseURL}/weatherpolygons/{version}/{regionCode}?key={apiKey}

Example

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

Parameters

ParameterDescriptionRequiredExampleDefault
baseURLBase URL for calling TomTom services.Yesapi.tomtom.com-
versionThe version of the service to call.Yesv1-
regionCodeThe name of the product region. See the Region Coverage for supported regionCode values.Yeseurope-
apiKeyAuthorization key for access to the API.Yes--

Headers

HeaderDescriptionRequiredExampleDefault
[Accept-Encoding]Requests that the response is compressed in the specified way. The fuelprices service supports http compression if desired. Currently, only gzip is supported.Nogzip-
[If-None-Match]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 304 (not modified) message if the data that would otherwise be provided has the same entity tag.No"4f3d2af4"-
[If-Modified-Since]Specifies the time stamp of the last actual update of the requested resource received by the client. Allows the service to respond with a 304 (not modified) message if no newer data is available.NoSat, 29 Oct 1994 19:43:31 GMT-

Content

Plain GET messages must be used to create requests.

Response

The weather polygons are served in GeoJSON format. 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 and 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

HeaderDescriptionValues
Content-EncodingThe service supports http compression if desired. Currently, only gzip is supported.gzip
Content-TypeThe format of the served resource. The service always provides data in GeoJSON.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"
EtagEntity-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"

Example Response

GET
Response body - 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

PropertyJSON data typeDescription
forecastOffsetNumberThe forecast horizon of the weather polygon in minutes. A zero stands for the present time.
creationTimeStringTime 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".
timeStampStringTime 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".
rootTimeStampStringTime 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

PropertyJSON data typeDescription
uniqueIdStringA unique and stable id of the current weather polygon.
categoryStringThe category of the weather polygon, e.g. "precip" (see section Category Values).
typeStringThe type of the weather polygon, e.g. "rain" (see section Type Values).
levelNumberThe level of the weather atom, i.e. a numeric value describing its magnitude.
areaNumberThe area of the weather polygon in square kilometers (km²).
childrenArray[String]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.
parentStringA single Feature-Id that represents the polygon of the next lower level which contains the weather polygon. An empty string means no parent.
countriesArray[String]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
precipRegional information about the precipitation in the form of regions with different precipitation levels.
warningRegional 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
1heavy
2extreme

Usage and Freshness

The weather polygons are updated regularly, typical frequencies being in the order of 15 minutes. Using the support for 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