Sorry, you need to enable JavaScript to visit this website.

Incident Viewport


Service version: 4
Last edit: 2021.07.20

On this page


This service returns legal and technical information for the viewport described in the request. It should be called by client applications whenever the viewport changes (for instance, through zooming, panning, going to a location, or displaying a route).

The request should contain the bounding box and zoom level of the viewport whose information is needed.

  • The return will contain map version information, as well as the current Traffic Model ID and copyright IDs.
  • The Traffic Model ID returned by the Viewport Description is used by other services to retrieve last traffic information for further processing.

Run this endpoint

You can easily run this and other endpoints.

  1. Go to the TomTom API Explorer page.
  2. Click an endpoint.
    1. Click Try it out.
    2. Enter/select all required parameter values and any optional parameter values.
    3. At the bottom of the form, click Execute.
  3. Review the response.

Request data

HTTPS method: GET

URL format

For ease of viewing and identification:

  • Required constants and parameters are shown in bold text.
  • Optional parameters are shown in plain text.


curl command


▲ Return to top

Request parameters

The following table describes the parameters that can be used in a request.

  • Required parameters must be used or the call will fail.
  • Parameters and values are case-sensitive.
  • Optional parameters may be used.
Required parameters
Parameter Description
The base URL for calling TomTom services.
Version of the service to call.
Value: The current value is 4.
Bounding box of the map viewport in an EPSG:900913 projection.
  • The maximum size of the bounding box that can be passed is dependent on the requested zoom level.
  • The width and height cannot exceed the square of a side of 16 tiles for a given zoom level.
  • See the Maximum bounding box section for details.
Value: minY,minX,maxY,maxX
See below for boxes crossing the 180° meridian.
The zoom level of the map viewport. Used to determine whether the view can be zoomed in.
Value: 0..22
Bounding box of the overview map in EPSG:900913 projection.
  • Used in case the overview box/mini map has different copyright data than the main map.
  • If there is no mini map, use the same coordinates as in the preceding boundingBox parameter.
Value: minY,minX,maxY,maxX
See below for boxes crossing the 180° meridian.
Zoom level of the overview map. If there is no mini map, use the same zoom level as in the preceding boundingZoom parameter.
Value: 0..22
Determines what copyright information to return.
  • When true the copyright text is returned.
  • When false only the copyright index is returned.
Default value: true
Other value: false
The content type of the response structure.
If the content type is jsonp, a callback method must be specified at the end of the service call.
  • xml
  • json
  • jsonp
The Authorization key for access to the API.
Value: Your valid API Key.
Optional parameters
Parameter Description
Specifies the callback method.
It is only used where the contentType parameter value is jsonp.
Value: jsonp

▲ Return to top

Maximum bounding box

In EPSG:900913 projection we use an extent of the world from -20037508.34 to 20037508.34 in each direction.

  • On each zoom level the world is divided into 2zoom x 2zoom tiles.
  • The maximum allowed size of the requested bounding box is a square of size 16 x 16 tiles.

For zoom level 5 and greater, the width and height cannot exceed 40075016.68 / 2zoom - 4.

Note that bounding boxes that cross the 180° meridian require special treatment.

  • For such boxes, the eastern maxX value will be negative, and thus less than the minX value west of the 180° meridian.
  • To address that, the value 40075016.6855874 should be added to the true maxX value before it is passed in the request.

▲ Return to top

HTTP request headers

The following table lists HTTP request headers of particular interest to clients of the Traffic Incident Viewport API endpoint.

Required headers
There are no required headers in this endpoint.
Optional headers
Parameter Description
Tracking-ID Specifies an identifier for the request.
  • It can be used to trace a call.
  • The value must match the regular expression '^[a-zA-Z0-9-]{1,100}$'.
  • An example of the format that matches this regular expression is a UUID (e.g., 9ac68072-c7a4-11e8-a8d5-f2801f1b9fd1). For details check RFC 4122.
  • If specified, it is replicated in the Tracking-ID response header.
  • It is only meant to be used for support and does not involve tracking of you or your users in any form.
Value: <string>

▲ Return to top

Response data

Successful response

The Incident Viewport API endpoint for a valid single request returns a response in XML, JSON, or JSONP format.

XML response body example

The following XML code block demonstrates a successful response from the API server.

Note: An XSD response schema is available for download.

The XML response of the preceding sample request would look like this:

<viewpResp xmlns="" maps="world" version="traffic-service 2.0.004">
  <trafficState trafficModelId="1400143970784" trafficAge="28320"/>

A typical response in JSON would be:

   "@version":"traffic-service 2.0.004",

Response field structure

The following table describes all of the XML/JSON element fields that can appear in a response. The types of the fields refer to a JSON response.

Field Description
The main response element. The key attributes are:
  • maps: Indicates the TomTom internal names for the map data used in the viewport
  • version: Indicates the software version that generated the response.
Traffic information.
  • trafficModelId: The unique ID called Traffic Model ID is used in calls to Traffic Incident services.
    • It allows to obtain information from particular traffic updates.
    • Traffic Model ID is updated every minute, and is valid for two minutes before it times out.
  • trafficAge:
  • The elapsed time (in seconds) from the Traffic Model ID creation.
Copyright information for the map viewport.
  • When the copyright parameter value is true, this contains the full text of the copyright information that must be displayed with the tiles in the viewport.
  • When it is false, it indicates which copyright holders must be cited but does not list them.

▲ Return to top

Error response

If there is an error in the supplied parameters or any other internal problem:

  • An error response is generated in the requested format.
  • If the contentType parameter could not be parsed, XML is returned.

Error response field structure

Field Description
Main object of the error response.
One of a server-defined set of error codes.
A human-readable description of the error code.

Error response JSON example

  "errorResponse" : {
    "@errorCode" : 400,
    "@description" : "Error validating overviewBbox: ",
    "@version" : "traffic-service 4.0.010"
  "detailedError" : {
    "code" : "INVALID_REQUEST",
    "message" : "Error validating overviewBbox: "

Error response XML example

<errorResponse description="Error validating overviewBbox: "errorCode"="400" version="traffic-service 4.0.010">
    <message>Error validating overviewBbox: </message>

HTTP response codes

Code Meaning & possible causes
200 OK
400 Bad request
403 Forbidden: The supplied API Key is not valid for this request.
405 Method Not Allowed: The provided HTTP Request method is known by the server, but is not supported by the target resource.
429 Too Many Requests: Too many requests were sent in a given amount of time for the supplied API Key.
500 Internal Server Error
503 Service currently unavailable: The service is currently unavailable.
596 Service Not Found: Unknown version of the service.

▲ Return to top

HTTP response headers

The following table lists HTTP response headers of particular interest to clients of the Traffic Incident Viewport API endpoint.

Header Description
Access-Control-Allow-Origin Indicates that cross-origin resource sharing (CORS) is allowed.
Value: *
Allow Lists the set of supported HTTP methods. The header is sent in case a 405 HTTP Response Code is returned.
Value: GET, HEAD
Cache-Control Contains directives for a caching mechanism.
Values: <private, no-cache, no-store, max-age=0, must-revalidate>
Content-Length Contains information about the size of the response body.
Value: <decimal number>
Content-Type Indicates the media type of the resource returned.
  • <application/json; charset=utf-8>
  • <application/javascript; charset=utf-8>
  • <text/xml; charset=utf-8>
Date Contains the date and time when the message was originated.
Value: <http-date>
Tracking-ID An identifier for the request.
  • If the Tracking-ID header was specified in the request, it is replicated in the response.
  • Otherwise, it is generated automatically by the service. For details check RFC 4122.
  • It is only meant to be used for support and does not involve tracking of you or your users in any form.
Value: <string>

▲ Return to top