Traffic API Developer's Guide

Requesting Traffic Flow Data

A basic scenario involving the use of the Traffic API is to obtain traffic flow data for a specific area. The two request examples below provide working illustrations.

All requests for traffic flow data must address the flow resource and indicate the area for which to obtain data.

Traffic Flow Data, [Z]/[X]/[Y] Addressing, XML Output

User Story

The user wants to obtain traffic flow data for an area around Frankfurt am Main, Germany . The area is to be identified using the [Z]/[X]/[Y] addressing scheme. 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]
URL variables: {data_format} [xml], response data format specification, here XML (to indicate that JSON is required, use json)
  {zoom}/{column}/{row} [8/134/86 ], the [Z]/[X]/[Y] (tile) addressing scheme, see also The Mercator Projection

Request

A request matching the user story is formulated as follows:

https://traffic.cit.api.here.com/traffic/6.2/flow/xml/8/134/86
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}

To specify the tile for which to obtain traffic flow data, the request indicates the zoom level as 8, the tile column as 134, and row as 86.

Response

The response carries the following XML contents:

<?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="201301" TMC_TABLE_VERSION="11.0"
    CREATED_TIMESTAMP="2013-03-14T20:47:24" VERSION="y"
    UNITS="metric">
    <RWS TY="TMC" EBU_COUNTRY_CODE="D" EXTENDED_COUNTRY_CODE="E0" TABLE_ID="1" TMC_TABLE_VERSION="11.0">
      <RW LI="D01+07125" DE="A485" PBT="2013-03-14T20:47:10Z"
        mid="13ecd0f5f1f|23b6c310-0f15-4fd5-b76d-46382b027a6d">
        <FIS>
          <FI>
            <TMC PC="11530" DE="Gießener Südkreuz" QD="-" LE="2.35725"/>
            <CF TY="TR" SP="65.79" FF="69.00" JF="0.58" CN="0.70"/>
          </FI>
          <!-- .... -->
        </FIS>
      </RW>
    </RWS>
    <diagnostic sfile="RealtimeFlowE0D01-1369239960627.xml.gz" pdd="c964101e-e61b-4a49-be84-b954a00b2a4a"/>
  </TRAFFICML_REALTIME>
  

Traffic Flow Data, Quadkey Addressing, JSON Output

User Story

The user wants to obtain traffic flow data for an area around Frankfurt am Main, Germany . The area is to be identified using a quadkey. The response must deliver data in JSON.

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.json], the resource and resource extension indicating the required response data format, here JSON (to indicate XML, use flow.xml)
Parameters: quadkey [quadkey=12020330] , map tile location specified as a single value, see also Quadkeys

Request

A request matching the user story, is formulated as follows:

https://traffic.cit.api.here.com/traffic/6.2/flow.json
?quadkey=12020330
&app_code={YOUR_APP_CODE}
&app_id={YOUR_APP_ID}

Response

The code block below shows the JSON response:

{
  "RWS": [
  {
    "RW": [
    {
      "FIS": [
      {
        "FI": [
        {
          "TMC": {
          "PC": 6467,
          "DE": "Gladenbach",
          "QD": "+",
          "LE": 12.52997
          },
          "CF": [
          {
            "SP": 55.2,
            "CN": 0.73,
            "TY": "TR",
            "JF": 0,
            "SU": 55.2,
            "FF": 52.6
          }
          ]
        }
        ]
      }
      ],
      "LI": "D01-06464",
      "DE": "L3048",
      "PBT": "2015-08-20T08:27:45Z",
      "mid": "ff3e7aab-eece-438c-818b-5920e4581330|"
    },
    {
      "FIS": [
      {
        "FI": [
        {
          "TMC": {
          "PC": 6468,
          "DE": "Fronhausen",
          "QD": "-",
          "LE": 12.55204
          },
          "CF": [
          {
            "SP": 56.95,
            "CN": 0.7,
            "TY": "TR",
            "JF": 0,
            "SU": 56.95,
            "FF": 53.6
          }
          ]
        }
        ]
      }
      ],
      "LI": "D01+06464",
      "DE": "L3048",
      "PBT": "2015-08-20T08:27:45Z",
      "mid": "77ede063-8d38-409a-a986-c8d91cdf3eb2|"
    }
    ],
    "TY": "TMC",
    "MAP_VERSION": "201503",
    "EBU_COUNTRY_CODE": "D",
    "EXTENDED_COUNTRY_CODE": "E0",
    "TABLE_ID": "1",
    "UNITS": "metric"
  }
  ],
  "MAP_VERSION": "",
  "CREATED_TIMESTAMP": "2015-08-20T08:27:43.000+0000",
  "VERSION": "3.1",
  "UNITS": "metric"
}

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.