GuidesAPI Reference
Guides

Get started with HERE Traffic API v7

📘

Note

This section provides information on the minimum setup required to quickly begin using HERE Traffic API v7. For more detailed information on HERE account setup, project creation, service linking, app registration, and authentication, see the Identity and Access Management Developer Guide.

Get a HERE account

Obtain access to the HERE platform through your organization administrator's invitation or get started for free.

  • If your company has already established a HERE platform organization, contact your organization admin who can invite you to join the organization.
  • If your company hasn’t established a HERE platform organization yet, you can get started for free. For more information, see the HERE platform pricing.

Get an API key

To get an API key, follow these steps:

  1. Sign in to the HERE platform using your HERE account.
  2. Select the Access Manager from the launcher.
  3. Select the Apps tab and click Register new app.
  4. Enter a name for the app.
  5. Click Register. The HERE platform creates a new app with a unique app ID.
  6. On the Credentials tab, select API Keys and then click Create API key to generate a maximum of two API Keys for your application authentication credentials. The API key is created and displayed.

Send a request

The Traffic API v7 provides flow and incident information. The example below will focus on flow data. The endpoint has two required parameters:

  • in - the region to request flow data within
  • locationReferencing - the location data used in the response

Parameters can be specified either in the URL with a GET request, or with a POST request as JSON data. We will use a bounding box for the in parameter. For more details on geospatial filtering, see Geospatial Filtering.

For the locationReferencing parameter, we will specify shape, which uses WGS84 coordinates to describe the shape of the affected roadway. For more information on the available location referencing formats, see Location Referencing.

curl -H "Authorization: Bearer $TOKEN" "https://data.traffic.hereapi.com/v7/flow?locationReferencing=shape&in=bbox:13.400,52.500,13.405,52.505"
📘

Note

The above request provides examples of both API key and OAuth token authentication. For more information on OAuth token authentication, see the Identity and Access Management Developer Guide.

The response contains the flow information within the provided area. In the example below, the results array has been truncated for readability.

{
  "sourceUpdated": "2021-07-01T13:53:03Z",
  "results": [
      {
          "location": {
              "length": 988.0,
              "shape": {
                  "links": [
                      {
                          "points": [
                              {
                                  "lat": 52.50708997249603,
                                  "lng": 13.398289997130632
                              },
                              {
                                  "lat": 52.506989976391196,
                                  "lng": 13.39867003262043
                              }
                          ],
                          "length": 28.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.506989976391196,
                                  "lng": 13.39867003262043
                              },
                              {
                                  "lat": 52.506729969754815,
                                  "lng": 13.399609979242086
                              }
                          ],
                          "length": 70.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.506729969754815,
                                  "lng": 13.399609979242086
                              },
                              {
                                  "lat": 52.50655001029372,
                                  "lng": 13.40023996308446
                              }
                          ],
                          "length": 47.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50655001029372,
                                  "lng": 13.40023996308446
                              },
                              {
                                  "lat": 52.506150025874376,
                                  "lng": 13.401690032333136
                              }
                          ],
                          "length": 109.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.506150025874376,
                                  "lng": 13.401690032333136
                              },
                              {
                                  "lat": 52.506060004234314,
                                  "lng": 13.402009969577193
                              }
                          ],
                          "length": 24.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.506060004234314,
                                  "lng": 13.402009969577193
                              },
                              {
                                  "lat": 52.50577996484935,
                                  "lng": 13.403040021657944
                              }
                          ],
                          "length": 77.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50577996484935,
                                  "lng": 13.403040021657944
                              },
                              {
                                  "lat": 52.50564996153116,
                                  "lng": 13.403479987755418
                              }
                          ],
                          "length": 33.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50564996153116,
                                  "lng": 13.403479987755418
                              },
                              {
                                  "lat": 52.505549965426326,
                                  "lng": 13.403879972174764
                              }
                          ],
                          "length": 29.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.505549965426326,
                                  "lng": 13.403879972174764
                              },
                              {
                                  "lat": 52.5053199660033,
                                  "lng": 13.404720006510615
                              }
                          ],
                          "length": 63.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.5053199660033,
                                  "lng": 13.404720006510615
                              },
                              {
                                  "lat": 52.505160039290786,
                                  "lng": 13.40528997592628
                              }
                          ],
                          "length": 43.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.505160039290786,
                                  "lng": 13.40528997592628
                              },
                              {
                                  "lat": 52.50504001043737,
                                  "lng": 13.405700018629432
                              }
                          ],
                          "length": 31.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50504001043737,
                                  "lng": 13.405700018629432
                              },
                              {
                                  "lat": 52.504900032654405,
                                  "lng": 13.406239980831742
                              }
                          ],
                          "length": 40.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.504900032654405,
                                  "lng": 13.406239980831742
                              },
                              {
                                  "lat": 52.50478000380099,
                                  "lng": 13.406659997999668
                              }
                          ],
                          "length": 32.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50478000380099,
                                  "lng": 13.406659997999668
                              },
                              {
                                  "lat": 52.50475997105241,
                                  "lng": 13.40675001963973
                              }
                          ],
                          "length": 7.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50475997105241,
                                  "lng": 13.40675001963973
                              },
                              {
                                  "lat": 52.504729963839054,
                                  "lng": 13.406850015744567
                              }
                          ],
                          "length": 8.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.504729963839054,
                                  "lng": 13.406850015744567
                              },
                              {
                                  "lat": 52.50464002601802,
                                  "lng": 13.407210018485785
                              }
                          ],
                          "length": 27.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50464002601802,
                                  "lng": 13.407210018485785
                              },
                              {
                                  "lat": 52.504429975524545,
                                  "lng": 13.407960031181574
                              }
                          ],
                          "length": 56.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.504429975524545,
                                  "lng": 13.407960031181574
                              },
                              {
                                  "lat": 52.50422998331487,
                                  "lng": 13.408669978380203
                              },
                              {
                                  "lat": 52.50405999831855,
                                  "lng": 13.409310020506382
                              }
                          ],
                          "length": 101.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50405999831855,
                                  "lng": 13.409310020506382
                              },
                              {
                                  "lat": 52.504020016640425,
                                  "lng": 13.409470031037927
                              }
                          ],
                          "length": 12.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.504020016640425,
                                  "lng": 13.409470031037927
                              },
                              {
                                  "lat": 52.503869980573654,
                                  "lng": 13.410019967705011
                              }
                          ],
                          "length": 41.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.503869980573654,
                                  "lng": 13.410019967705011
                              },
                              {
                                  "lat": 52.50376998446882,
                                  "lng": 13.410369995981455
                              }
                          ],
                          "length": 26.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50376998446882,
                                  "lng": 13.410369995981455
                              },
                              {
                                  "lat": 52.503720028325915,
                                  "lng": 13.410349963232875
                              },
                              {
                                  "lat": 52.50365003943443,
                                  "lng": 13.410330014303327
                              },
                              {
                                  "lat": 52.503590025007725,
                                  "lng": 13.410349963232875
                              },
                              {
                                  "lat": 52.50353001058102,
                                  "lng": 13.410390028730035
                              },
                              {
                                  "lat": 52.50347997061908,
                                  "lng": 13.410439984872937
                              },
                              {
                                  "lat": 52.503439988940954,
                                  "lng": 13.410520032048225
                              }
                          ],
                          "length": 41.0,
                          "functionalClass": 3
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.503439988940954,
                                  "lng": 13.410520032048225
                              },
                              {
                                  "lat": 52.503420040011406,
                                  "lng": 13.410599995404482
                              },
                              {
                                  "lat": 52.503420040011406,
                                  "lng": 13.410699991509318
                              },
                              {
                                  "lat": 52.50343001447618,
                                  "lng": 13.41079001314938
                              },
                              {
                                  "lat": 52.50344996340573,
                                  "lng": 13.410890009254217
                              },
                              {
                                  "lat": 52.50347997061908,
                                  "lng": 13.410969972610474
                              },
                              {
                                  "lat": 52.50350997783244,
                                  "lng": 13.411029987037182
                              },
                              {
                                  "lat": 52.503549959510565,
                                  "lng": 13.411080026999116
                              }
                          ],
                          "length": 43.0,
                          "functionalClass": 3
                      }
                  ]
              }
          },
          "currentFlow": {
              "speed": 3.6111112,
              "speedUncapped": 3.6111112,
              "freeFlow": 10.555556,
              "jamFactor": 8.2,
              "confidence": 0.99,
              "traversability": "open",
              "subSegments": [
                  {
                      "length": 418.0,
                      "speed": 7.2222223,
                      "speedUncapped": 7.2222223,
                      "freeFlow": 11.111112,
                      "jamFactor": 3.2,
                      "jamTendency": 1,
                      "confidence": 0.99,
                      "traversability": "open"
                  },
                  {
                      "length": 570.0,
                      "speed": 2.777778,
                      "speedUncapped": 2.777778,
                      "freeFlow": 10.277778,
                      "jamFactor": 8.7,
                      "jamTendency": 1,
                      "confidence": 0.99,
                      "traversability": "open"
                  }
              ]
          }
      }
  ]
}

Next steps

  • For an overview of the flow data structure, see Flow.
  • To learn how to request flow data, see Request flow data.
  • For example of events that affect specific section of a roadway, see Incidents.
  • For information on Traffic API, see the API Reference.