Intermediate Traffic API

Intermediate Traffic Evaluation API - Traffic Flow

Purpose

This endpoint is part of the self-service Intermediate Traffic Evaluation API, intended for exploring TomTom traffic flow data ahead of a production integration with the Intermediate Traffic API .

The TomTom Traffic Flow - Intermediate Service - Protobuf (hereafter called ‘Service’) is designed for server-to-server integration with traffic control center, routing, navigation, and mapping applications. It contains real-time travel times and speeds for segments, based on TomTom’s Traffic technology, with several possible configurations.

This document describes the data exchange method and the payload description of the Service interface.

Features

TomTom provides customers with real-time travel times and speeds for segments.

Detailed information about the available features can be found in the section Available features .

Request data

How do you make a request?

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 and Request headers sections with the required and optional parameters tables for their values.

The generic request format is as follows:

get
URL format
https://api.tomtom.com/maps/orbis/intermediate-traffic/flow-detailed/{cityName}/content.proto[?flowType={flowType}]

The following shows an example cURL request with the required headers:

get
cURL request example
curl --request GET --compressed \
--url "https://api.tomtom.com/maps/orbis/intermediate-traffic/flow-detailed/{cityName}/content.proto" \
--header "TomTom-Api-Key: {yourTomTomApiKey}" \
--header "TomTom-Api-Version: 1" \
--header "Accept-Encoding: gzip" \
--output content.proto

Request parameters

The following table provides a detailed explanation of the available fields that were previously shown in the How do you make a request? section.

ParametersDescription

cityName


required

The name of the city you are requesting traffic flow data for. You can find the list of available cities in the Available cities section. The value is case-insensitive.


Example: amsterdam

flowType


optional

When the feed is requested without the parameter flowType it contains ALL messages covered by the feed. In that case, the field averageSpeed in a message represents the current speed for congested road segments and the free-flow speed for non-congested road segments. By using the flowType parameter, the response can be shaped to only support a certain speed type. This also affects the number of messages in the response. There are two values supported for this parameter:

  • ff, gets the messages for ALL road segments covered by the feed. The field averageSpeed in the message provides the free-flow speed for the affected road segment.

  • nff, only gets the messages for road segments that are NOT in a free-flow state. The field averageSpeed of a message provides the currently measured speed for the affected road segment.

When using this parameter, at the first request the free-flow information should be downloaded. Afterwards, non-free-flow information can be downloaded for each future request. The free-flow and non-free-flow data are related. The segments for both files should be in sync, otherwise there is a mismatch in the locations of the free-flow data. Therefore, every time the non-free-flow information is downloaded, it must be checked. This insures that the non-free-flow data corresponds to the free-flow data (that the user already has).

The verification is done by confirming the clientID within supplierAndClientInfo in protocol buffers format. If the clientID of the non-free-flow content does not match the clientID of the free-flow content that was downloaded with the first request, the free-flow information must be re-requested. See more details in the FAQ about speeds in non free flow feed page.


Values: flowType=nff, flowType=ff

Request headers

The following table provides a detailed explanation of the available headers that were previously shown in the How do you make a request? section.

HeadersDescription

TomTom-Api-Key


required

Authentication key for access to the API. If you don’t have an API key yet, see the Getting started section.


Value: Your TomTom API key.

TomTom-Api-Version


required

Version of the API to use. Currently, the only supported version is 1.


Value: 1

Accept-Encoding


required

Specifies the encoding algorithms that are acceptable for the response. The value must include gzip to receive gzip-compressed responses. Additionally, the value can also include other encodings.


Example: gzip

If-Modified-Since


optional

Since flow feeds can be very large, TomTom recommends optimizing information transmission as much as possible by using the standard HTTP header If-Modified-Since with the last value of Last-Modified received, which prevents unnecessary downloads of identical content. For details, see the HTTP/1.1 standard (RFC2616 section 14.25) .


Example: Wed, 21 Oct 2015 07:28:00 GMT

Response data

Response codes

Response codeDescription
200 OK

Indicates that the request has succeeded. The response body will contain the requested data.

304 Not Modified

Only used if the If-Modified-Since header has been set by the client. Indicates that the requested data has not been modified since the last request. For more information see Request headers .

401 Unauthorized

Indicates that the request requires user authentication information. The client MAY repeat the request with a suitable Authorization header field.

406 Not Acceptable

The server doesn’t find any content that conforms with the Accept-Encoding header sent in the request. This may happen if Accept-Encoding is set to identity or gzip;q=0 or if no Accept-Encoding header is present. If the Accept-Encoding header is not set or does not support gzip, the server will return a 406 status code with a message indicating the issue.

Response example

If you make the following request:

get
URL example
https://api.tomtom.com/maps/orbis/intermediate-traffic/flow-detailed/amsterdam/content.proto?flowType=nff

You can expect a response that contains protocol buffers binary data. The textual representation of this data could look like this:

metaInformation {
createTimeUTCSeconds: 1772619030
supplierAndClientInfo {
clientID: "e28bc9d4-4e05-4918-b662-2562029599565a2f2136"
supplierID: "TomTom Traffic Service"
}
mapVersion: "eur2026.01.140"
}
[...]
trafficFlowWithPredictionPerSection {
location {
openlr: "\013\003\276\347%;\3673\325\027\371\332\376\3552\005"
lengthInMeters: 1372
}
speedVector {
minutesInFuture: 0
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 39
travelTimeSeconds: 48
confidence: 81
relativeSpeed: 0.975
trafficCondition: FREE_TRAFFIC
}
}
sectionSpeed {
startOffsetInMeters: 520
speed {
averageSpeedKmph: 22
travelTimeSeconds: 102
confidence: 97
relativeSpeed: 0.741
trafficCondition: FREE_TRAFFIC
}
}
sectionSpeed {
startOffsetInMeters: 1129
speed {
averageSpeedKmph: 38
travelTimeSeconds: 23
confidence: 100
relativeSpeed: 1
trafficCondition: FREE_TRAFFIC
}
}
}
speedVector {
minutesInFuture: 15
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 27
travelTimeSeconds: 181
relativeSpeed: 0.803
trafficCondition: FREE_TRAFFIC
}
}
}
speedVector {
minutesInFuture: 30
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 26
travelTimeSeconds: 192
relativeSpeed: 0.756
trafficCondition: FREE_TRAFFIC
}
}
}
speedVector {
minutesInFuture: 45
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 26
travelTimeSeconds: 193
relativeSpeed: 0.753
trafficCondition: FREE_TRAFFIC
}
}
}
}
[...]

Response - Protobuf payload specification (analysis of the received output)

Protocol buffers is the de-facto standard for encoding and transmitting any structured information in a compact, platform-independent way. TomTom uses protocol buffers (version 2) format for the output payload. After defining the data structure an encoder and a decoder can be generated for integration into C++, Java and several other languages. Also see http://code.google.com/p/protobuf or https://protobuf.dev for more information.

Important: Protocol buffers schema

Our output type uses the proprietary TomTom protocol buffers message types. The data structure of the protocol buffers output is defined in the schema file ProtobufTrafficFlow_v12.proto . TomTom supports schema version 11 and above.

All fields are marked as optional, as recommended by Google, but the output always contains flow information (including a location).

The following table contains a brief description of the supported message types used in the data structure. More detailed information about the individual message fields can be found in the following sections: some fields are filled in by default, other fields require a specific feature to be enabled with the product.

Protocol buffers message typeDescription
TrafficFlowGroup

The traffic flow group is the top-level message. It provides meta data (see MetaInformation) and the flow entries themselves (see TrafficFlowWithPredictionPerSection).

MetaInformation

The meta information message provides data shared by all traffic flow messages.

SupplierAndClientInfo

The supplier and client information message identifies the client and the supplier.

TrafficFlowWithPredictionPerSection

This message assigns current and future speed information to sections of a location at several points in time.

Speed

The speed message contains all speed and travel time related information. Which fields are set depends on the customizable product configurations (see the section Optionally activatable features ).

SectionSpeed

The SectionSpeed message provides speed information for the section of a location. The section is indicated by the offset of the starting point from the start point of the location. The ending offset is either the end of the location or the start of the next section, if there is a next section. SectionSpeed may also identify road blockages.

SpeedVector

SpeedVector provides a set of section speed information details at a point in a future time. This time value indicates the number of minutes, relative to the creation time of this message, as established by the MetaInformation message.

Location referencing

OpenLR

Geographical representation of the road segments is an important part of the payload. The following geographical representations that are supported:

OpenLR is a dynamic location referencing method that allows referencing of any road on the complete digital map. Because of its flexibility, it is possible to describe traffic events on high-level and lower-level road classes. The method is available free of charge. The service uses binary format version 3, as described in the OpenLR whitepaper. The whitepaper, software developer kit, and open source reference implementations are available for download from the OpenLR website . TomTom offers support for third parties to implement and test their own implementations.

OpenLR example (here printed using C escape sequences)
location {
openlr: "\v\254\320.!\367\n\033l\a\000Z\376\223\033\000"
lengthInMeters: 425
}

Identifier-based location referencing using OSM way IDs

Identifier-based location referencing OSM way IDs (hereafter called ‘IDLR-OSM’) is offered as an alternative method of location referencing besides OpenLR and Identifier-based location referencing using GERS IDs .

  1. To obtain OSM way IDs from the feed, you must request them using the URL parameter flowType=ff. A detailed explanation of how to use this parameter can be found in the section on Request Parameters .
  2. Please note that OSM way IDs are static data. They should only be re-requested as part of the flowType=ff feed (as mentioned in the first point) when there has been a change to the ff feed.
  3. You can use the OpenLR codes to link messages from the nff feed to the corresponding messages in the ff feed, allowing you to identify the GERS IDs that were previously downloaded with the ff feed.

The following example shows a trafficFlowWithPredictionPerSection message with an IDLR-OSM in the segmentIds field indicated by type: OSM_WAY_ID that is composed of six OSM way IDs. All IDs use the forward direction, the first ID uses a start-offset, the second through fifth IDs have no offsets, and the sixth ID uses an end-offset. The affected location is the concatenation of all IDs minus the offset information.

Example
trafficFlowWithPredictionPerSection {
location {
openlr: "\v\211\302\310.P\211\033n\36418\324\253\033r\344\360I\324\036\033m\350>W\331\341\033l\3572Y\333t\033y\377\344"
lengthInMeters: 28533
segmentIds {
type: OSM_WAY_ID
segmentId {
id: 230910249
backwards: false
startOffsetInMeters: 3031
}
segmentId {
id: 631550315
backwards: false
}
12 collapsed lines
segmentId {
id: 631550313
backwards: false
}
segmentId {
id: 406702546
backwards: false
}
segmentId {
id: 406702549
backwards: false
}
segmentId {
id: 406702547
backwards: false
endOffsetInMeters: 11317
}
}
}
[...]
}

Identifier-based location referencing using GERS IDs

Identifier-based location referencing Global Entity Reference System (hereafter called ‘IDLR-GERS’) is offered as an alternative method of location referencing besides OpenLR and IDLR-OSM .

  1. To obtain GERS IDs from the feed, you must request them using the URL parameter flowType=ff. A detailed explanation of how to use this parameter can be found in the section on Request Parameters .
  2. Please note that GERS IDs are static data. They should only be re-requested as part of the flowType=ff feed (as mentioned in the first point) when there has been a change to the ff feed.
  3. You can use the OpenLR codes to link messages from the nff feed to the corresponding messages in the ff feed, allowing you to identify the GERS IDs that were previously downloaded with the ff feed.

The following example shows a trafficFlowWithPredictionPerSection message with an IDLR-GERS in the segmentIds field indicated by type: GERS_ID that is composed of five GERS IDs. All IDs use the backwards direction, the first ID uses a start-offset, the second through fourth IDs have no offsets, and the fifth ID uses an end-offset. The affected location is the concatenation of all IDs minus the offset information.

Example
trafficFlowWithPredictionPerSection {
location {
openlr: "\v\004\'|#U\0203\345C\001}\374\216#ffZ"
lengthInMeters: 979
segmentIds {
type: GERS_ID
segmentId {
id: 319719336117268785
backwards: false
startOffsetInMeters: 1594
idHigh: 604038967628660735
}
segmentId {
id: 319712699939139853
backwards: false
idHigh: 613046166810001407
}
10 collapsed lines
segmentId {
id: 323919439968428109
backwards: false
idHigh: 617549766435536895
}
segmentId {
id: 319695982581605327
backwards: false
idHigh: 613046166810001407
}
segmentId {
id: 319411736432914706
backwards: false
endOffsetInMeters: 1398
idHigh: 604038967628660735
}
}
}
[...]
}

Note that a 128-bit GERS ID is composed of two 64-bit values represented by the fields id and idHigh. The field idHigh contains the most significant bits, while id contains the least significant bits. The following pseudocode illustrates how these fields should be combined.

gers_id = (idHigh << 64) | id

For more information on how to use GERS IDs, please visit the Overture Maps website .

Available features

Dynamic sectioning

Dynamic sectioning describes the flow segments in smaller sections when conditions vary considerably within a longer road stretch. The Service uses the message type SectionSpeed to report sections. They are ordered by their offset relative to the start of the affected location. This offset is indicated by the startOffsetInMeters field of a SectionSpeed message. A section ends when the subsequent section starts. The last section ends at the end of the affected location indicated by the lengthInMeters field in the Location message.

Example
trafficFlowWithPredictionPerSection {
location {
openlr: "\v\254\320.!\367\n\033l\a\000Z\376\223\033\000"
lengthInMeters: 425
}
speedVector {
minutesInFuture: 0
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 2
travelTimeSeconds: 86
confidence: 81
relativeSpeed: 0.067
trafficCondition: STATIONARY_TRAFFIC
}
}
sectionSpeed {
startOffsetInMeters: 48
speed {
averageSpeedKmph: 46
travelTimeSeconds: 29
confidence: 81
relativeSpeed: 0.920
trafficCondition: FREE_TRAFFIC
}
}
}
[...]
}

Flow prediction

Flow prediction uses the message type TrafficFlowWithPredictionPerSection. The current speed and predictive speeds for 15, 30, 45 minutes in the future are reported with sectioning if applicable.

Example
trafficFlowWithPredictionPerSection {
location {
openlr: "\013\003\276\337%BL3\345\t\002\255\000\3273\024"
lengthInMeters: 585
}
speedVector {
minutesInFuture: 0
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 21
travelTimeSeconds: 100
confidence: 84
relativeSpeed: 0.875
trafficCondition: FREE_TRAFFIC
}
}
}
speedVector {
minutesInFuture: 15
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 20
travelTimeSeconds: 105
relativeSpeed: 0.838
trafficCondition: FREE_TRAFFIC
}
}
}
speedVector {
minutesInFuture: 30
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 20
travelTimeSeconds: 105
relativeSpeed: 0.833
trafficCondition: FREE_TRAFFIC
}
}
}
speedVector {
minutesInFuture: 45
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 21
travelTimeSeconds: 103
relativeSpeed: 0.854
trafficCondition: FREE_TRAFFIC
}
}
}
}

HOV Flow

Adds separate speed entries for lanes reserved for high-occupancy vehicles, for now only the current speed for the whole location is available.

The following example shows trafficFlowWithPredictionPerSection message with two speed entries, one for the regular lanes and one for the HOV lane(s).

Example
trafficFlowWithPredictionPerSection {
location {
openlr: "\v\251\003-!\331\326\001\f!\002K\371\264\001\037"
lengthInMeters: 1939
}
speedVector {
minutesInFuture: 0
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 76
travelTimeSeconds: 92
confidence: 100
}
}
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 90
travelTimeSeconds: 78
confidence: 100
speedCondition {
laneType: HIGH_OCCUPANCY
}
}
}
}
[...]
}

Meta information

The MetaInformation message type provides data shared by all traffic flow messages. It contains:

  • the creation time (TomTom uses the Epoch Linux Timestamp, which represents the number of seconds since January 1st, 1970 at UTC. For details, check https://www.unixtimestamp.com ) and
  • the supplier and client information in the SupplierAndClientInfo message.
  • the mapVersion field provides the name and version of the map that was used to create the content.
Example of MetaInformation with fields provided by default
metaInformation {
createTimeUTCSeconds: 1772626830
supplierAndClientInfo {
clientID: "e28bc9d4-4e05-4918-b662-2562029599565a2f2136"
supplierID: "TomTom Traffic Service"
}
mapVersion: "eur2026.01.140"
}

The SupplierAndClientInfo is crucial for accessing a flow feed using the recommended free-flow (ff) / non-free-flow (nff) update mechanism as explained in the section Request parameters under the optional URL parameter flowType. The same mechanism needs to be applied for requesting Identifier-based location referencing using OSM way IDs or GERS IDs .

Relative speed

The relative speed to the free-flowing speed is given as a ratio (e.g., 0.250 indicates a current real-time speed that is 25% of free flow speed) in field relativeSpeed in the Speed message.

Example
trafficFlowWithPredictionPerSection {
location {
openlr: "\013\265f\361\034J\374\001\0349\363A\006\013\001\014"
}
speedVector {
minutesInFuture: 0
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 23
travelTimeSeconds: 534
confidence: 99
relativeSpeed: 0.229
}
}
}
[...]
}

Speed message default information

The Speed message contains all speed and travel time related information. It consists of the following default information:

  • averageSpeedKmph: The current average speed on the affected location in kilometers per hour.
  • travelTimeSeconds: The current average travel time to pass the affected location or free-flow travel time if average speed is 0 km/h (in seconds).
  • confidence: A measure of confidence values that rates the reliability of this speed estimate. The quality, amount, and age of live data for the affected location contribute to this score. It scales from 0 (no confidence) to 100 (fully confident about the estimate).
trafficFlowWithPredictionPerSection {
4 collapsed lines
location {
openlr: "\v\254\320.!\367\n\033l\a\000Z\376\223\033\000"
lengthInMeters: 425
}
speedVector {
minutesInFuture: 0
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 11
travelTimeSeconds: 144
confidence: 81
}
}
}
[...]
}

Time to usual

Provides the time duration (in minutes) for the average speed (of the entire location) of a flow message to return to the usual speed (speed profile).

Example
trafficFlowWithPredictionPerSection {
45 collapsed lines
location {
openlr: "\v\n\031\\&\0032\v(\n\003q\377x\v\030"
lengthInMeters: 622
}
speedVector {
minutesInFuture: 0
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 13
travelTimeSeconds: 179
confidence: 100
}
}
}
speedVector {
minutesInFuture: 15
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 13
travelTimeSeconds: 179
}
}
}
speedVector {
minutesInFuture: 30
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 49
travelTimeSeconds: 46
}
}
}
speedVector {
minutesInFuture: 45
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 49
travelTimeSeconds: 46
}
}
}
timeToUsualInMinutes: 26
}

Traffic condition

Provides a textual traffic condition indicator which provides a categorization of current traffic condition. It can be any value out of seven values (see more details on FAQ about the definition of traffic conditions ):

  • FREE_TRAFFIC
  • HEAVY_TRAFFIC
  • SLOW_TRAFFIC
  • QUEUING_TRAFFIC
  • STATIONARY_TRAFFIC
  • CLOSED
  • UNKNOWN
Example
trafficFlowWithPredictionPerSection {
location {
openlr: "\013\265f\361\034J\374\001\0349\363A\006\013\001\014"
}
speedVector {
minutesInFuture: 0
sectionSpeed {
startOffsetInMeters: 0
speed {
averageSpeedKmph: 23
travelTimeSeconds: 534
confidence: 99
trafficCondition: STATIONARY_TRAFFIC
}
}
}
[...]
}