Traffic API Developer's Guide

Requesting Traffic Flow Data with a Bounding Box Filter

The two examples below demonstrate requests for traffic flow data for an area defined by a bounding box. By default, all available traffic flow information is returned, but filters can be applied to the response, for example, to exclude flow information for roads matching a particular functional class.

Traffic flow is provided using TMC references.

Bounding Box Filter

User Story

The user wants to obtain traffic flow data for an area near Indianapolis, IN, USA. The area is a rectangle defined by the latitude and longitude of its top-left and bottom-right corners. The response must deliver data in XML.

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: flow [flow.xml], the resource and resource extension indicating the required response data format, here XML (to indicate JSON, use flow.json)
Parameters: bbox [bbox=39.8485715,-86.0969867;39.8358934,-86.0757964] , a rectangular area for which to obtain traffic data defined by the geographic coordinates of its top left and bottom-right corners

Request

A request matching the user story is formulated as follows:

https://traffic.cit.api.here.com/traffic/6.2/flow.xml
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&bbox=39.8485715,-86.0969867;39.8358934,-86.0757964

Response

Below is the response in XML format.

<?xml version="1.0" encoding="UTF-8"?>
<TRAFFICML_REALTIME xmlns="http://traffic.nokia.com/trafficml-flow-3.1" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" MAP_VERSION="lD.CkO7u" 
  TMC_TABLE_VERSION="oiqDtKM4iE" CREATED_TIMESTAMP="2014-04-17T10:16:04" VERSION="y" UNITS="metric">
  <RWS TY="TMC" EBU_COUNTRY_CODE="1" EXTENDED_COUNTRY_CODE="A0" TABLE_ID="7" TMC_TABLE_VERSION="10.1">
    <RW LI="107-01073" DE="EMERSON AVE" PBT="2013-03-14T20:47:10Z" 
      mid="0152c6dc-1359-4790-bbeb-41fed705275a|">
      <FIS>
        <FI>
          <TMC PC="8354" DE="E 46TH ST" QD="+" LE="0.02346" FC="1"/>
          <CF TY="TR" SP="21.70" FF="26.80" JF="2.82049" CN="0.70"/>
        </FI>
        <FI>
          <TMC PC="8352" DE="E 38TH ST" QD="+" LE="0.52029"/>
          <CF TY="TR" SP="31.52" FF="31.10" JF="0.0" CN="0.77"/>
        </FI>
        <FI>
          <TMC PC="5655" DE="IL-122/EXIT 15" QD="-" LE="4.16074"/>
          <CF TY="TR" SP="65.00" FF="65.00" JF="0.0" CN="0.85">
            <SSS>
              <SS LE="677.50603" SP="21.75" FF="12.02" JF="8.64613"/>
              <SS LE="364.78040" SP="48.91" FF="78.88" JF="9.50912"/>
              <SS LE="304.21572" SP="64.86" FF="60.19" JF="5.86003"/>
            </SSS>
          </CF>
        </FI>
      </FIS>
    </RW>
  </RWS>
</TRAFFICML_REALTIME>

Bounding Box and Response Filters

User Story

The user wants to obtain traffic flow data for an area near Indianapolis, IN, USA. The area is a rectangle defined by the latitude and longitude of its top-left and bottom-right corners. The response must deliver data in XML, containing road shape and functional class information.

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: flow [flow.xml], the resource and resource extension indicating the required response data format, here XML (to indicate JSON, use flow.json)
Parameters: bbox [bbox=39.8485715,-86.0969867;39.8358934,-86.0757964], a rectangular area for which to obtain traffic data defined by the geographic coordinates of its top-left and bottom-right corners
  responseattributes [responseattributes=sh,fc], a rectangular area for which to obtain traffic data defined by the geographic coordinates of its top-left and bottom-right corners

Request

A request matching the user story is formulated as follows:

https://traffic.cit.api.here.com/traffic/6.2/flow.xml
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&bbox=39.8485715,-86.0969867;39.8358934,-86.0757964
&responseattributes=sh,fc

Response

Shown below is an example response in XML format. Note the<SHP> element and the FC attribute which carry the shape and functional class information for the roadway corresponding to the flow items.

<?xml version="1.0" encoding="UTF-8"?>
<TRAFFICML_REALTIME xmlns="http://traffic.nokia.com/trafficml-flow-3.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" MAP_VERSION="lD.CkO7u" TMC_TABLE_VERSION="oiqDtKM4iE" CREATED_TIMESTAMP="2014-04-17T10:16:04" VERSION="y" UNITS="metric">
  <RWS TY="TMC" EBU_COUNTRY_CODE="1" EXTENDED_COUNTRY_CODE="A0" TABLE_ID="7" TMC_TABLE_VERSION="10.1">
    <RW LI="107-01073" DE="EMERSON AVE" PBT="2013-03-14T20:47:10Z" mid="0152c6dc-1359-4790-bbeb-41fed705275a|">
      <FIS>
        <FI>
          <TMC PC="8354" DE="E 46TH ST" QD="+" LE="0.02346" FC="1"/>
          <SHP FC="3">39.8183517,-86.0836105 39.8184586,-86.0836105</SHP>
          <SHP FC="3">39.8184586,-86.0836105 39.8188705,-86.0836105</SHP>
          <CF TY="TR" SP="21.70" FF="26.80" JF="2.82049" CN="0.70"/>
        </FI>
        <FI>
          <TMC PC="8352" DE="E 38TH ST" QD="+" LE="0.52029"/>
          <SHP FC="4">39.8330688,-86.0837326 39.8342285,-86.0837173</SHP>
          <SHP FC="4">39.8342285,-86.0837173 39.835289,-86.0837402 39.8359108,-86.0837479 39.8363304,-86.0837402</SHP>
          <CF TY="TR" SP="31.52" FF="31.10" JF="0.0" CN="0.77"/>
        </FI>
        <FI>
          <TMC PC="5655" DE="IL-122/EXIT 15" QD="-" LE="4.16074"/>
          <SHP FC="1">40.3239594,-89.4540329 40.3242989,-89.4540405 40.3274689,-89.4541321 40.3372917,-89.454361 40.3400307,-89.454422 40.3411407,-89.4544601 40.3460007,-89.454567 40.3483315,-89.454628 40.3495216,-89.4546509 40.3530693,-89.4547424 40.3542404,-89.4547729 40.3577309,-89.4548492 40.3591003,-89.4548874 40.3633614,-89.4549866 40.3664207,-89.4550705 40.3713608,-89.4551773</SHP>
          <CF TY="TR" SP="65.00" FF="65.00" JF="0.0" CN="0.85">
            <SSS>
              <SS LE="677.50603" SP="21.75" FF="12.02" JF="8.64613"/>
              <SS LE="364.78040" SP="48.91" FF="78.88" JF="9.50912"/>
              <SS LE="304.21572" SP="64.86" FF="60.19" JF="5.86003"/>
            </SSS>
          </CF>
        </FI>
      </FIS>
    </RW>
  </RWS>
</TRAFFICML_REALTIME>

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.