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:
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:
1curl --request GET --compressed \2 --url "https://api.tomtom.com/maps/orbis/intermediate-traffic/flow-detailed/{cityName}/content.proto" \3 --header "TomTom-Api-Key: {yourTomTomApiKey}" \4 --header "TomTom-Api-Version: 1" \5 --header "Accept-Encoding: gzip" \6 --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.
| Parameters | Description |
|---|---|
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: |
optional | When the feed is requested without the parameter
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 Values: |
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.
| Headers | Description |
|---|---|
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. |
required | Version of the API to use.
Currently, the only supported version is Value: |
required | Specifies the encoding algorithms that are acceptable for the response.
The value must include Example: |
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 Example: |
Response data
Response codes
| Response code | Description |
|---|---|
| 200 OK | Indicates that the request has succeeded. The response body will contain the requested data. |
| 304 Not Modified | Only used if the |
| 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 |
Response example
If you make the following request:
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:
1metaInformation {2 createTimeUTCSeconds: 17726190303 supplierAndClientInfo {4 clientID: "e28bc9d4-4e05-4918-b662-2562029599565a2f2136"5 supplierID: "TomTom Traffic Service"6 }7 mapVersion: "eur2026.01.140"8}9[...]10trafficFlowWithPredictionPerSection {11 location {12 openlr: "\013\003\276\347%;\3673\325\027\371\332\376\3552\005"13 lengthInMeters: 137214 }15 speedVector {16 minutesInFuture: 017 sectionSpeed {18 startOffsetInMeters: 019 speed {20 averageSpeedKmph: 3921 travelTimeSeconds: 4822 confidence: 8123 relativeSpeed: 0.97524 trafficCondition: FREE_TRAFFIC25 }26 }27 sectionSpeed {28 startOffsetInMeters: 52029 speed {30 averageSpeedKmph: 2231 travelTimeSeconds: 10232 confidence: 9733 relativeSpeed: 0.74134 trafficCondition: FREE_TRAFFIC35 }36 }37 sectionSpeed {38 startOffsetInMeters: 112939 speed {40 averageSpeedKmph: 3841 travelTimeSeconds: 2342 confidence: 10043 relativeSpeed: 144 trafficCondition: FREE_TRAFFIC45 }46 }47 }48 speedVector {49 minutesInFuture: 1550 sectionSpeed {51 startOffsetInMeters: 052 speed {53 averageSpeedKmph: 2754 travelTimeSeconds: 18155 relativeSpeed: 0.80356 trafficCondition: FREE_TRAFFIC57 }58 }59 }60 speedVector {61 minutesInFuture: 3062 sectionSpeed {63 startOffsetInMeters: 064 speed {65 averageSpeedKmph: 2666 travelTimeSeconds: 19267 relativeSpeed: 0.75668 trafficCondition: FREE_TRAFFIC69 }70 }71 }72 speedVector {73 minutesInFuture: 4574 sectionSpeed {75 startOffsetInMeters: 076 speed {77 averageSpeedKmph: 2678 travelTimeSeconds: 19379 relativeSpeed: 0.75380 trafficCondition: FREE_TRAFFIC81 }82 }83 }84}85[...]
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 type | Description |
|---|---|
TrafficFlowGroup | The traffic flow group is the top-level message.
It provides meta data (see |
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 |
SpeedVector |
|
Location referencing
OpenLR
Geographical representation of the road segments is an important part of the payload. The following geographical representations that are supported:
- OpenLR location referencing,
- Identifier-based location referencing based on OSM way IDs, and
- Identifier-based location referencing based on GERS IDs.
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.
1location {2 openlr: "\v\254\320.!\367\n\033l\a\000Z\376\223\033\000"3 lengthInMeters: 4254}
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.
- 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.- Please note that OSM way IDs are static data. They should only be re-requested as part of the
flowType=fffeed (as mentioned in the first point) when there has been a change to thefffeed.- You can use the OpenLR codes to link messages from the
nfffeed to the corresponding messages in thefffeed, allowing you to identify the GERS IDs that were previously downloaded with thefffeed.
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.
1trafficFlowWithPredictionPerSection {2 location {3 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"4 lengthInMeters: 285335 segmentIds {6 type: OSM_WAY_ID7 segmentId {8 id: 2309102499 backwards: false10 startOffsetInMeters: 303111 }12 segmentId {13 id: 63155031514 backwards: false15 }28 segmentId {29 id: 40670254730 backwards: false31 endOffsetInMeters: 1131732 }33 }34 }35 [...]36}
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.
- 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.- Please note that GERS IDs are static data. They should only be re-requested as part of the
flowType=fffeed (as mentioned in the first point) when there has been a change to thefffeed.- You can use the OpenLR codes to link messages from the
nfffeed to the corresponding messages in thefffeed, allowing you to identify the GERS IDs that were previously downloaded with thefffeed.
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.
1trafficFlowWithPredictionPerSection {2 location {3 openlr: "\v\004\'|#U\0203\345C\001}\374\216#ffZ"4 lengthInMeters: 9795 segmentIds {6 type: GERS_ID7 segmentId {8 id: 3197193361172687859 backwards: false10 startOffsetInMeters: 159411 idHigh: 60403896762866073512 }13 segmentId {14 id: 31971269993913985315 backwards: false16 idHigh: 61304616681000140717 }28 segmentId {29 id: 31941173643291470630 backwards: false31 endOffsetInMeters: 139832 idHigh: 60403896762866073533 }34 }35 }36 [...]37}
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.
1trafficFlowWithPredictionPerSection {2 location {3 openlr: "\v\254\320.!\367\n\033l\a\000Z\376\223\033\000"4 lengthInMeters: 4255 }6 speedVector {7 minutesInFuture: 08 sectionSpeed {9 startOffsetInMeters: 010 speed {11 averageSpeedKmph: 212 travelTimeSeconds: 8613 confidence: 8114 relativeSpeed: 0.06715 trafficCondition: STATIONARY_TRAFFIC16 }17 }18 sectionSpeed {19 startOffsetInMeters: 4820 speed {21 averageSpeedKmph: 4622 travelTimeSeconds: 2923 confidence: 8124 relativeSpeed: 0.92025 trafficCondition: FREE_TRAFFIC26 }27 }28 }29 [...]30}
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.
1trafficFlowWithPredictionPerSection {2 location {3 openlr: "\013\003\276\337%BL3\345\t\002\255\000\3273\024"4 lengthInMeters: 5855 }6 speedVector {7 minutesInFuture: 08 sectionSpeed {9 startOffsetInMeters: 010 speed {11 averageSpeedKmph: 2112 travelTimeSeconds: 10013 confidence: 8414 relativeSpeed: 0.87515 trafficCondition: FREE_TRAFFIC16 }17 }18 }19 speedVector {20 minutesInFuture: 1521 sectionSpeed {22 startOffsetInMeters: 023 speed {24 averageSpeedKmph: 2025 travelTimeSeconds: 10526 relativeSpeed: 0.83827 trafficCondition: FREE_TRAFFIC28 }29 }30 }31 speedVector {32 minutesInFuture: 3033 sectionSpeed {34 startOffsetInMeters: 035 speed {36 averageSpeedKmph: 2037 travelTimeSeconds: 10538 relativeSpeed: 0.83339 trafficCondition: FREE_TRAFFIC40 }41 }42 }43 speedVector {44 minutesInFuture: 4545 sectionSpeed {46 startOffsetInMeters: 047 speed {48 averageSpeedKmph: 2149 travelTimeSeconds: 10350 relativeSpeed: 0.85451 trafficCondition: FREE_TRAFFIC52 }53 }54 }55}
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).
1trafficFlowWithPredictionPerSection {2 location {3 openlr: "\v\251\003-!\331\326\001\f!\002K\371\264\001\037"4 lengthInMeters: 19395 }6 speedVector {7 minutesInFuture: 08 sectionSpeed {9 startOffsetInMeters: 010 speed {11 averageSpeedKmph: 7612 travelTimeSeconds: 9213 confidence: 10014 }15 }16 sectionSpeed {17 startOffsetInMeters: 018 speed {19 averageSpeedKmph: 9020 travelTimeSeconds: 7821 confidence: 10022 speedCondition {23 laneType: HIGH_OCCUPANCY24 }25 }26 }27 }28 [...]29}
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
SupplierAndClientInfomessage. - the
mapVersionfield provides the name and version of the map that was used to create the content.
1metaInformation {2 createTimeUTCSeconds: 17726268303 supplierAndClientInfo {4 clientID: "e28bc9d4-4e05-4918-b662-2562029599565a2f2136"5 supplierID: "TomTom Traffic Service"6 }7 mapVersion: "eur2026.01.140"8}
The
SupplierAndClientInfois 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 parameterflowType. 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.
1trafficFlowWithPredictionPerSection {2 location {3 openlr: "\013\265f\361\034J\374\001\0349\363A\006\013\001\014"4 }5 speedVector {6 minutesInFuture: 07 sectionSpeed {8 startOffsetInMeters: 09 speed {10 averageSpeedKmph: 2311 travelTimeSeconds: 53412 confidence: 9913 relativeSpeed: 0.22914 }15 }16 }17 [...]18}
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).
1trafficFlowWithPredictionPerSection {6 speedVector {7 minutesInFuture: 08 sectionSpeed {9 startOffsetInMeters: 010 speed {11 averageSpeedKmph: 1112 travelTimeSeconds: 14413 confidence: 8114 }15 }16 }17 [...]18}
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).
1trafficFlowWithPredictionPerSection {47 timeToUsualInMinutes: 2648}
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_TRAFFICHEAVY_TRAFFICSLOW_TRAFFICQUEUING_TRAFFICSTATIONARY_TRAFFICCLOSEDUNKNOWN
1trafficFlowWithPredictionPerSection {2 location {3 openlr: "\013\265f\361\034J\374\001\0349\363A\006\013\001\014"4 }5 speedVector {6 minutesInFuture: 07 sectionSpeed {8 startOffsetInMeters: 09 speed {10 averageSpeedKmph: 2311 travelTimeSeconds: 53412 confidence: 9913 trafficCondition: STATIONARY_TRAFFIC14 }15 }16 }17 [...]18}