Understanding How TomTom Handles Data Used by the Traffic API
![](/_next/image/?url=https%3A%2F%2Fa.storyblok.com%2Ff%2F178460%2F297x297%2Fee11d8479c%2Fducket.png%2Fm%2F112x112%2Ffilters%3Aquality(90)&w=256&q=90)
![](/_next/image/?url=https%3A%2F%2Fa.storyblok.com%2Ff%2F178460%2F1181x886%2Ffa999afa61%2F50970060392_f34d6f1496_k.jpg&w=3840&q=90)
TomTom’s Traffic API gives application developers a simple way to add real-time traffic information to their applications. In this article, we’ll look at the TomTom Traffic API, what data TomTom collects to operate the API services, how TomTom collects and protects the data, and how that data is used to provide accurate traffic information needed for Traffic API responses, as well as for other TomTom services such as the Routing API.
TomTom’s Traffic API gives application developers a simple way to add real-time traffic information to their applications. Traffic information is critical to effectively getting a user from point A to point B in the shortest amount of time while minimizing the chance to encounter traffic incidents or other obstacles.
ETA calculations, departure time, and route recalculations need to take into account real-time traffic conditions if they are to be useful. For electric vehicle (EV) applications, traffic information provided by the Traffic API is even more critical because charging stations within range must take traffic into account.
Point of Interest (POI) applications also need to incorporate traffic information. For example, someone looking for vegan dining options within a 15-minute drive would need the information provided by the Traffic API to accurately search for relevant POIs — vegan restaurants in this case — within the travel-time radius.
In short, the ability to advise users of real-time traffic conditions is an essential piece of any application seeking to incorporate mapping and routing.
In this article, we’ll look at the TomTom Traffic API, what data TomTom collects to operate the API services, how TomTom collects and protects the data, and how that data is used to provide accurate traffic information needed for Traffic API responses, as well as for other TomTom services such as the Routing API.
Learn how the traffic layer works in the TomTom SDK for Web v6 in this quick video:
Information Feeding the Traffic API
The TomTom Traffic API reflects a massive data collection and analytics effort. TomTom gathers data from more than 600 million devices worldwide. These devices include mobile applications or in-dash systems. So, in effect, a moving vehicle becomes a traffic sensor.
It’s important to note that all of the data on the movement of mobile devices is stripped of any personally identifiable information before it reaches the back-end database. Only relevant information, such as location, speed of travel, device type, and time is collected — amounting to billions of data points from millions of devices.
This information is known as Floating Car Data (FCD), which is timestamped with geolocation and speed data collected directly from moving vehicles. The information helps determine traffic speed and generate traffic reports on congestion and average travel time.
In contrast to the roadway sensors installed by municipalities, collecting FCD doesn’t require additional hardware.
The data is analyzed and stored to allow the Traffic API to return granular details that include:
Information about traffic jams or incidents
Start and end location of traffic problems
Road name (impacted by the issue)
Type of delay
Delay length (time)
Significance (degree of congestion)
Distance to problem location (from current user's location)
TomTom Traffic Index
The TomTom Traffic Index can assist city planners, automobile manufacturers, and policymakers in making planning decisions. This report includes information about congestion levels in 416 cities in 57 countries and six continents.
The report uses a congestion index that expresses the amount of extra time that drivers spend getting from place to place, by location, over an entire year. TomTom starts by establishing a baseline by determining travel time under uncongested conditions (free flow) on each road segment in each city. Actual travel times on these same road segments are collected over an entire year (24x7x365).
The congestion index is then derived by comparing the real time to the free-flow times to determine the congestion index or percent of extra time a driver would spend getting from place to place. The report is broken down by several categories, including the time of day and road type. This report guides construction projects, air pollution reduction, traffic control efforts.
Based on the functionality that an application needs, this information can be used for features such as routing, geofencing of distance based on the time from current location, or heat maps of the degree of congestion.
![traffic index](https://live.staticflickr.com/65535/50969271528_49ccf28cba_c.jpg)
While the statistics and information used to create the Traffic Index are available for licensing, it is primarily a thought leadership and market awareness effort.
Using the Traffic API
The Traffic API is a collection of services designed to create web and mobile applications that make use of real-time traffic data. The Traffic API services use real-time traffic data from TomTom Traffic. The API endpoints provide two kinds of information:
Traffic incidents provide an up-to-date view of traffic delays and incidents for a given road network.
Traffic flow provides real-time speeds and travel time based on observed information.
The traffic incident endpoints provide data, along with raster and vector tile visualizations, regarding Traffic Model reports within a "viewport" or bounding box and zoom level. The Traffic Model is updated every minute, and is valid for two minutes before it times out.
Traffic data can include a variety of incident types, from roadwork, accidents, and broken down vehicles to lane closures to weather-related traffic issues like rain, ice, and fog.
Here's an excerpt from a call to the Traffic API Incident Details service that shows examples of a traffic detour due to construction ("roadworks") and an accident:
{
"id": "4a3cb6330175f87eb166ac5158ca2c4e",
"p": {
"x": 542553.6016223,
"y": 6879403.7048553
},
"ic": 9,
"ty": 0,
"cs": 0,
"d": "roadworks",
"c": "new roadworks layout",
"sd": "2020-12-16T10:42:28Z",
"f": "Oostzaan (N516)",
"t": "A8: Zaanstad-Zuid - A8/s118 (N516)",
"l": 12,
"r": "s150"
},
{
"id": "d839302a863cb20a3478640f2e45c455",
"p": {
"x": 560437.363569,
"y": 6882400.4445541
},
"ic": 1,
"ty": 0,
"cs": 0,
"d": "accident",
"sd": "2020-12-24T17:04:05Z",
"f": "",
"t": "Marken - N518 (N247)",
"l": 90
},
You can also call the Raster Incident Tiles or Vector Incident Tiles endpoints to get visual layer tiles showing traffic incidents, which you can incorporate into a map display. Using the TomTom Maps SDK handles some of these layer display details for you.
![trafficred](https://live.staticflickr.com/65535/50969440403_4d597e3a8d_o.png)
The Flow Segment Data endpoint provides speeds and travel times for the road segment closest to a given set of coordinates.
{
"flowSegmentData": {
"frc": "FRC3",
"currentSpeed": 73,
"freeFlowSpeed": 73,
"currentTravelTime": 42,
"freeFlowTravelTime": 42,
"confidence": 0.5,
"roadClosure": false,
"coordinates": {
"coordinate": [
{
"latitude": 52.40606308516981,
"longitude": 4.839773568917934
},
...
As for incidents, the Traffic API provides Raster Flow Tiles and Vector Flow Tiles endpoints to generate visualizations of traffic flow.
![trafficgreen](https://live.staticflickr.com/65535/50969440398_6e15a349a0_o.png)
To learn more about the Traffic API and see examples of using traffic data in applications, see the blog posts Using Traffic Data with Maps and Routes and How To Add Traffic APIs to Your Location-Based App. You can also experiment with the Maps SDK for Web functional examples, which include interactive Traffic API examples with code.
How the Search and Routing APIs use Traffic Data
The data behind the Traffic API is used by other TomTom APIs and services to produce additional functionality and accurate calculations. In particular, the Routing and Extended Routing APIs use current and historical traffic data to calculate optimal routes and more accurate estimated time of arrival (ETA) and estimated travel time (ETT).
The Routing API to determine real-time travel times and traffic incidents. The Routing API is capable of calculating the reachable range of a vehicle given parameters of fuel consumption and energy budget.
The Extended Routing API creates routes between origin and destination, incorporating charging stops if necessary. These stops are automatically added based on the vehicle's consumption and charging model.
The same data used by Traffic API services provide real-time information to the Routing and Extended Routing APIs that can be critical in determining the reachable range.
As a developer, you can combine features of the Routing and Traffic APIs. For example, while the Routing API calculates and returns an optimal route based on traffic conditions, it doesn't display the traffic status directly. The Traffic API can be used to add a visualization of the traffic situation on the map along with the route. This gives the user more actionable information in your app: both the route and the traffic context.
Wrapping Up
TomTom’s Traffic API is the result of a massive worldwide data collection effort that touches over 600 million devices. It uses data collected from mobile devices and vehicles with in-dash navigation using FCD, which doesn’t require the installation of additional hardware. Personal information is removed, anonymizing the individuals during further analytics. This data is analyzed to provide real-time traffic information to applications via the Traffic API and it doesn’t require much coding.
The Traffic API offers a powerful addition to applications especially if other TomTom’s services are integrated, such as Routing and Search APIs.
Whether it’s getting someplace on time or searching for fuel or a POI within a short distance, the TomTom API suite provides a valuable addition to applications that include a navigation component.
To learn more and to try using the Traffic API in your own applications, see the TomTom Developer Portal and register for a free developer account.
![traffic index](https://live.staticflickr.com/65535/50970273807_44bba19a24_z.jpg)
* Required field. By submitting your contact details to TomTom, you agree that we can contact you about marketing offers, newsletters, or to invite you to webinars and events. We could further personalize the content that you receive via cookies. You can unsubscribe at any time by the link included in our emails. Review our privacy policy.