Get started

This section outlines how to get started quickly using the HERE Traffic API v7 on the HERE platform:

  1. Get a HERE account
  2. Create a project
  3. Get an API key
  4. Send a request
  5. Next steps

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 & Access Management Developer Guide.

Get a HERE account

You can get started with a free HERE platform account from the flexible HERE Base Plan. For more information, see the HERE Base Plan Pricing. Alternatively, if your company has already established a HERE platform organization, contact your organization admin who can invite you to join your company's organization.

Create a project

To create a project, follow these steps:

  1. Sign in to the HERE platform using your HERE account.
  2. Open the Projects manager from the launcher.
  3. Click Create new project.
  4. Enter a name for the project. Project names don't have to be unique.
  5. Enter a project ID. Project IDs must be unique within an organization and cannot be changed for the lifetime of the organization. Project IDs must be between 4 and 16 characters in length.
  6. Optional: Enter a description.
  7. Click Save.
  8. On the Resources tab, select Services and then click Link a Service.
  9. Search for the HERE Traffic API service and click Link.
  10. Click Done.

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. Optional: Enter a description for the app.
  6. Under New app, select Create.
  7. Optional: Select the project you created in the previous procedure from the Default access to a project field.
  8. Click Register. The HERE platform creates a new app with a unique app ID.
  9. 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 request consists of a single GET request to fetch either flow or 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

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.

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

Note

The above request provides examples of both API key and OAuth token authentication. For more information on OAuth token authentication, see the Identity & 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
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.506989976391196,
                                  "lng": 13.39867003262043
                              },
                              {
                                  "lat": 52.506729969754815,
                                  "lng": 13.399609979242086
                              }
                          ],
                          "length": 70.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.506729969754815,
                                  "lng": 13.399609979242086
                              },
                              {
                                  "lat": 52.50655001029372,
                                  "lng": 13.40023996308446
                              }
                          ],
                          "length": 47.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50655001029372,
                                  "lng": 13.40023996308446
                              },
                              {
                                  "lat": 52.506150025874376,
                                  "lng": 13.401690032333136
                              }
                          ],
                          "length": 109.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.506150025874376,
                                  "lng": 13.401690032333136
                              },
                              {
                                  "lat": 52.506060004234314,
                                  "lng": 13.402009969577193
                              }
                          ],
                          "length": 24.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.506060004234314,
                                  "lng": 13.402009969577193
                              },
                              {
                                  "lat": 52.50577996484935,
                                  "lng": 13.403040021657944
                              }
                          ],
                          "length": 77.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50577996484935,
                                  "lng": 13.403040021657944
                              },
                              {
                                  "lat": 52.50564996153116,
                                  "lng": 13.403479987755418
                              }
                          ],
                          "length": 33.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50564996153116,
                                  "lng": 13.403479987755418
                              },
                              {
                                  "lat": 52.505549965426326,
                                  "lng": 13.403879972174764
                              }
                          ],
                          "length": 29.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.505549965426326,
                                  "lng": 13.403879972174764
                              },
                              {
                                  "lat": 52.5053199660033,
                                  "lng": 13.404720006510615
                              }
                          ],
                          "length": 63.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.5053199660033,
                                  "lng": 13.404720006510615
                              },
                              {
                                  "lat": 52.505160039290786,
                                  "lng": 13.40528997592628
                              }
                          ],
                          "length": 43.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.505160039290786,
                                  "lng": 13.40528997592628
                              },
                              {
                                  "lat": 52.50504001043737,
                                  "lng": 13.405700018629432
                              }
                          ],
                          "length": 31.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50504001043737,
                                  "lng": 13.405700018629432
                              },
                              {
                                  "lat": 52.504900032654405,
                                  "lng": 13.406239980831742
                              }
                          ],
                          "length": 40.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.504900032654405,
                                  "lng": 13.406239980831742
                              },
                              {
                                  "lat": 52.50478000380099,
                                  "lng": 13.406659997999668
                              }
                          ],
                          "length": 32.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50478000380099,
                                  "lng": 13.406659997999668
                              },
                              {
                                  "lat": 52.50475997105241,
                                  "lng": 13.40675001963973
                              }
                          ],
                          "length": 7.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50475997105241,
                                  "lng": 13.40675001963973
                              },
                              {
                                  "lat": 52.504729963839054,
                                  "lng": 13.406850015744567
                              }
                          ],
                          "length": 8.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.504729963839054,
                                  "lng": 13.406850015744567
                              },
                              {
                                  "lat": 52.50464002601802,
                                  "lng": 13.407210018485785
                              }
                          ],
                          "length": 27.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50464002601802,
                                  "lng": 13.407210018485785
                              },
                              {
                                  "lat": 52.504429975524545,
                                  "lng": 13.407960031181574
                              }
                          ],
                          "length": 56.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.504429975524545,
                                  "lng": 13.407960031181574
                              },
                              {
                                  "lat": 52.50422998331487,
                                  "lng": 13.408669978380203
                              },
                              {
                                  "lat": 52.50405999831855,
                                  "lng": 13.409310020506382
                              }
                          ],
                          "length": 101.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.50405999831855,
                                  "lng": 13.409310020506382
                              },
                              {
                                  "lat": 52.504020016640425,
                                  "lng": 13.409470031037927
                              }
                          ],
                          "length": 12.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.504020016640425,
                                  "lng": 13.409470031037927
                              },
                              {
                                  "lat": 52.503869980573654,
                                  "lng": 13.410019967705011
                              }
                          ],
                          "length": 41.0
                      },
                      {
                          "points": [
                              {
                                  "lat": 52.503869980573654,
                                  "lng": 13.410019967705011
                              },
                              {
                                  "lat": 52.50376998446882,
                                  "lng": 13.410369995981455
                              }
                          ],
                          "length": 26.0
                      },
                      {
                          "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
                      },
                      {
                          "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
                      }
                  ]
              }
          },
          "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.

results matching ""

    No results matching ""