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.ls.hereapi.com/traffic/6.3/incidents.json
?apiKey={YOUR_API_KEY}
&bbox=52.516,13.355;52.511,13.400
&criticality=minor
https://traffic.ls.hereapi.com/traffic/6.2/flow/json/8/134/86
?apiKey={YOUR_API_KEY}
looks as follows when using the Quadkey addressing scheme instead, with the XML response format specified: https://traffic.ls.hereapi.com/traffic/6.2/flow.xml
?quadkey=12020330
&apiKey={YOUR_API_KEY}
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.