Traffic API Developer's Guide

Examples

This section provides examples of requests reflecting typical use cases for the Traffic API, along with the corresponding results.

For readability, in some responses, line breaks are used and long strings are shortened with ellipsis (...).

The following example demonstrates search request for a traffic incident. The request uses bounding box coordinates to define the area to search. The request uses the HTTP GET method and sets the bounding box coordinates with a bbox. The value of the parameter is the latitude and longitude of the top left and bottom right corners of the area for which to retrieve traffic incident data. The last parameter, criticality, indicates the severity of the accidents about which to obtain information.

https://traffic.cit.api.here.com/traffic/6.3/incidents.json
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&bbox=52.516,13.355;52.511,13.400
&criticality=minor
Where a request uses the Mercator Projection addressing scheme in the examples, it is possible to use the Quadkey addressing scheme instead, or vice versa. For example, the following request using the Mercator Projection addressing scheme and specifying JSON as the desired response format:
https://traffic.cit.api.here.com/traffic/6.2/flow/json/8/134/86
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
looks as follows when using the Quadkey addressing scheme instead, with the XML response format specified:
https://traffic.cit.api.here.com/traffic/6.2/flow.xml
?quadkey=12020330
&app_code={YOUR_APP_CODE}
&app_id={YOUR_APP_ID}
Other ways to specify a location are to use the query parameters proximity (prox) or a bounding box filter (bbox). For more information, see Limitations and Selecting a Request Pattern.

The response structure is based on the TML Formal Specification. For more information on TML, contact Technical Customer Support.