Traffic API Developer's Guide

Request a Subset of Incident Data

Requests to the Traffic API for incident data can limit the response to a data subset.

Common subsets include:
  • limiting the total number of responses
  • limiting responses to a certain type, status, criticality, TMC table, profile or timeframe
  • excluding certain geospatial areas

Incident Data Subset, Bounding Box Area Filter

User Story

The user wants to obtain traffic incident information that uses the parameters to limit the response to 50 active incidents near Frankfurt am Main, Germany. The request is to use the bounding box area filter. (Further possibilities are to use proximity (prox) or corridor (corridor) instead of the bounding box (bbox).)

Request Summary

The following list summarizes the elements required to create a request matching the user story and shows, in square brackets, how those elements are used in the request example below. Note that the request example also uses the authentication parameters.

Resource: incidents [incidents]
URL variables: {data_format} [xml], response data format specification, here XML (to indicate that JSON is required, use json)
  bbox [bbox=48.8379,8.4375;50.7364,9.84375] , a rectangular area for which to obtain traffic data defined by the geographic coordinates of its top left and bottom-right corners
Parameters:  status [status=active], indicates that results are to be filtered according to status, the example requests only "active" incidents
  maxresults [maxresults=50], the maximum number of incidents for which to retrieve information

Request

A request matching the user story is formulated as follows:

https://traffic.cit.api.here.com/traffic/6.2/incidents.xml?bbox=48.8379,8.4375;50.7364,9.84375
&app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&negBBox=37.5000,126.9700;37.4900,126.9800
&status=active
&maxresults=50

Response

The following code block shows the response to the request for subset of incident data. Note that this response is abbreviated because of space limitations. In reality, the XML may contain a very large number of <TRAFFIC_ITEM> elements.


<?xml version="1.0" encoding="UTF-8"?>
<TRAFFICML_INCIDENTS TIMESTAMP="05/23/2017 17:23:06 GMT" VERSION="2.3">
  <TRAFFIC_ITEMS>
    <TRAFFIC_ITEM>
      <TRAFFIC_ITEM_ID>445066184</TRAFFIC_ITEM_ID>
      <ORIGINAL_TRAFFIC_ITEM_ID>445066184</ORIGINAL_TRAFFIC_ITEM_ID>
      <TRAFFIC_ITEM_STATUS_SHORT_DESC>ACTIVE</TRAFFIC_ITEM_STATUS_SHORT_DESC>
      <TRAFFIC_ITEM_TYPE_DESC>CONSTRUCTION</TRAFFIC_ITEM_TYPE_DESC>
      <START_TIME>10/06/2013 22:00:00</START_TIME>
      <END_TIME>10/16/2013 12:00:00</END_TIME>
      <ENTRY_TIME>10/06/2013 20:25:34</ENTRY_TIME>
      <CRITICALITY>
        <ID>2</ID>
        <DESCRIPTION>minor</DESCRIPTION>
      </CRITICALITY>
      <VERIFIED>true</VERIFIED>
      <COMMENTS></COMMENTS>
      <RDS-TMC_LOCATIONS>
        <RDS-TMC>
          <ORIGIN>
            <EBU_COUNTRY_CODE>D</EBU_COUNTRY_CODE>
            <TABLE_ID>1</TABLE_ID>
            <LOCATION_ID>36612</LOCATION_ID>
            <LOCATION_DESC>Feldatal-Ermenrod</LOCATION_DESC>
            <RDS_DIRECTION>-</RDS_DIRECTION>
          </ORIGIN>
          <DIRECTION>+</DIRECTION>
          <ALERTC>
            <TRAFFIC_CODE>701</TRAFFIC_CODE>
            <QUANTIFIERS>0</QUANTIFIERS>
            <DESCRIPTION>(Q)(Baustelle//Baustellen)</DESCRIPTION>
            <ALERTC_DURATION>L</ALERTC_DURATION>
            <ALERTC_DIRECTION>1</ALERTC_DIRECTION>
            <UPDATE_CLASS>11</UPDATE_CLASS>
            <PHRASE_CODE>E1</PHRASE_CODE>
            <EXTENT>0</EXTENT>
            <DURATION>0</DURATION>
          </ALERTC>
        </RDS-TMC>
      </RDS-TMC_LOCATIONS>
      <LOCATION>
        <DEFINED>
          <ORIGIN>
            <ROADWAY ID="50396">
              <DESCRIPTION TYPE="NTCSA">B49</DESCRIPTION>
              <DESCRIPTION TYPE="RDSGN">B49</DESCRIPTION>
              <DESCRIPTION TYPE="LOCAL">B49</DESCRIPTION>
            </ROADWAY>
            <POINT ID="36612">
              <DESCRIPTION TYPE="NTCSA">Feldatal-Ermenrod</DESCRIPTION>
              <DESCRIPTION TYPE="RDSGN">Feldatal-Ermenrod</DESCRIPTION>
              <DESCRIPTION TYPE="LOCAL">Feldatal-Ermenrod</DESCRIPTION>
              <DESCRIPTION TYPE="BNAME">B49</DESCRIPTION>
            </POINT>
            <DIRECTION ID="0">
              <DESCRIPTION TYPE="LOCAL">ALSFELD</DESCRIPTION>
              <DESCRIPTION TYPE="NTCSA">ALSFELD</DESCRIPTION>
              <DESCRIPTION TYPE="RDSGN">ALSFELD</DESCRIPTION>
            </DIRECTION>
            <PROXIMITY>
              <ID>At</ID>
              <DESCRIPTION>at</DESCRIPTION>
            </PROXIMITY>
          </ORIGIN>
          <TO>
            <ROADWAY ID="50396">
              <DESCRIPTION TYPE="NTCSA">B49</DESCRIPTION>
              <DESCRIPTION TYPE="RDSGN">B49</DESCRIPTION>
              <DESCRIPTION TYPE="LOCAL">B49</DESCRIPTION>
            </ROADWAY>
            <POINT ID="36612">
              <DESCRIPTION TYPE="NTCSA">Feldatal-Ermenrod</DESCRIPTION>
              <DESCRIPTION TYPE="RDSGN">Feldatal-Ermenrod</DESCRIPTION>
              <DESCRIPTION TYPE="LOCAL">Feldatal-Ermenrod</DESCRIPTION>
              <DESCRIPTION TYPE="BNAME">B49</DESCRIPTION>
            </POINT>
            <DIRECTION ID="0">
              <DESCRIPTION TYPE="LOCAL">ALSFELD</DESCRIPTION>
              <DESCRIPTION TYPE="NTCSA">ALSFELD</DESCRIPTION>
              <DESCRIPTION TYPE="RDSGN">ALSFELD</DESCRIPTION>
            </DIRECTION>
            <PROXIMITY>
              <ID>At</ID>
              <DESCRIPTION>at</DESCRIPTION>
            </PROXIMITY>
          </TO>
        </DEFINED>
        <GEOLOC>
          <ORIGIN>
            <LATITUDE>50.6528</LATITUDE>
            <LONGITUDE>9.1382</LONGITUDE>
          </ORIGIN>
          <TO>
            <LATITUDE>50.6528</LATITUDE>
            <LONGITUDE>9.1382</LONGITUDE>
          </TO>
        </GEOLOC>
        <NAVTECH>
          <EDGE>
            <EDGE_ID>61778142</EDGE_ID>
            <EDGE_ID>61778159</EDGE_ID>
            ...
          </EDGE>
          <VERSION_ID>201301</VERSION_ID>
        </NAVTECH>
      </LOCATION>
      <TRAFFIC_ITEM_DETAIL>
        <ROAD_CLOSED>false</ROAD_CLOSED>
          <EVENT>
            <EVENT_ITEM_CANCELLED>false</EVENT_ITEM_CANCELLED>
            <SCHEDULED_CONSTRUCTION_EVENT>
              <SCHEDULED_CONSTRUCTION_TYPE_DESC>
                CONSTRUCTION
              </SCHEDULED_CONSTRUCTION_TYPE_DESC>
              <SCHEDULED_CONSTRUCTION_DETAIL>
                construction
              </SCHEDULED_CONSTRUCTION_DETAIL>
            </SCHEDULED_CONSTRUCTION_EVENT>
          </EVENT>
      </TRAFFIC_ITEM_DETAIL>
      <TRAFFIC_ITEM_DESCRIPTION TYPE="short_desc">
        bei Feldatal-Ermenrod - Baustelle.
      </TRAFFIC_ITEM_DESCRIPTION>
      ...
    </TRAFFIC_ITEM><TRAFFIC_ITEM>
  </TRAFFIC_ITEM>
</TRAFFIC_ITEMS></TRAFFICML_INCIDENTS>

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.