Get Started - HERE developer portal

This section outlines how to get started quickly using the Public Transit API v8 on the HERE developer portal.

  1. Get a HERE Account
  2. Register your App
  3. Get an API Key
  4. Send a Request

Note

This section provides information on the minimum setup required to begin quickly using the Public Transit API v8. For more detailed information on HERE account setup, app registration, and authentication, see the Identity & Access Management Developer Guide.

Get a HERE Account

If you are an individual developer who has signed up for one of the plans listed on our Developer plans page on developer.here.com, you received a HERE account ID when you signed up. You can use your HERE account to log in to developer.here.com to create applications. Applications (uniquely identified by an app ID) enable development with HERE products and services.

Register your App

To register your app, follow these steps:

  1. Sign in to developer.here.com.
  2. Click your name, select Projects, and then choose your project from the list. Your project details and available application credentials are then displayed.
  3. Select JavaScript or REST and click Generate App. When your application is created, its app ID is displayed.

Get an API key

To get an API key, follow these steps:

  1. Sign in to developer.here.com.
  2. Click your name, select Projects, and then choose your project from the list. Your project details and available application credentials are then displayed.
  3. Click Create API key to generate a maximum of two API keys for your application. The API key is created and displayed.

Send a Request

This example request calculates a transit route.

GET https://transit.router.hereapi.com/v8/routes
    ?apiKey={YOUR_API_KEY}
    &origin=41.79457,12.25473
    &destination=41.90096,12.50243

If the route calculation was successful, the /routes response contains the requested details about the calculated route:

  • One optimal transit route, unless the alternatives is greater than zero.
  • Multiple transit sections with each segment, representing either a pedestrian or a transit segment, containing departure and arrival times, duration, and coordinates.
  • The transit segment shows the actual stops or stations of departure and arrival. Optionally, all intermediate stops in between can be also requested using the parameter return=intermediate.
  • A set of operators that run the services included in the alternatives, including the operator code, operator name, and links to operator websites, if any.
{
  "routes": [
    {
      "id": "R008001-C0",
      "sections": [
        {
          "id": "R008001-C0-S0",
          "type": "pedestrian",
          "actions": [
            {
              "action": "depart",
              "duration": 74,
              "instruction": "Head northwest on Via Arturo Ferrarin. Go for 74 m.",
              "offset": 0
            },
            {
              "action": "turn",
              "duration": 19,
              "instruction": "Turn left. Go for 10 m.",
              "offset": 1,
              "direction": "left"
            },
            {
              "action": "turn",
              "duration": 21,
              "instruction": "Turn right onto Via Generale Felice Santini. Go for 21 m.",
              "offset": 2,
              "direction": "right"
            },
            {
              "action": "turn",
              "duration": 19,
              "instruction": "Turn left onto Elevator. Go for 19 m.",
              "offset": 3,
              "direction": "left"
            },
            {
              "action": "continue",
              "duration": 72,
              "instruction": "Head west. Go for 72 m.",
              "offset": 4
            },
            {
              "action": "turn",
              "duration": 141,
              "instruction": "Turn slightly left. Go for 141 m.",
              "offset": 5,
              "direction": "left",
              "severity": "light"
            },
            {
              "action": "turn",
              "duration": 77,
              "instruction": "Turn left. Go for 77 m.",
              "offset": 7,
              "direction": "left"
            },
            {
              "action": "arrive",
              "duration": 0,
              "instruction": "Arrive at your destination on the right.",
              "offset": 8
            }
          ],
          "travelSummary": {
            "duration": 420,
            "length": 413
          },
          "polyline": "BHkrsl9Y6503pHq9Gr1O9uB9uBijC5sE3G5sEuNj_Q_jH7zN_jHjtNrjLovK",
          "departure": {
            "time": "2019-12-09T12:31:00+01:00",
            "place": {
              "type": "place",
              "location": {
                "lat": 41.79457,
                "lng": 12.25473
              }
            }
          },
          "arrival": {
            "time": "2019-12-09T12:38:00+01:00",
            "place": {
              "name": "Fiumicino Aeroporto",
              "type": "station",
              "location": {
                "lat": 41.793572,
                "lng": 12.251733
              },
              "id": "722068831"
            }
          }
        },
        {
          "id": "R008001-C0-S1",
          "type": "transit",
          "travelSummary": {
            "duration": 1920,
            "length": 31726
          },
          "polyline": "BHg-4k9Y0871pH_wwE4vwEzjGooJ7wFw9J_mE0iJngDg1Hn9Bw_IvC8jJkcg1H08BkkHgj9Bkh3E0rhDkriHoi6Nkl9egmqB4g3D4qJ49vBz9D0isB3-d89qI8gIwr_Bw2oB87_Ds9oB41oEgvUoyoD0xJ4rjE7jEgqjBrhiBs8jF4Swqa8sHghlBkm4BwngF8x-B4m3Ekq7BsixCgw0B8rmC4gTolrB8oE04rBngIgo8E_qHsqwD44CktyBs4KoppB0mgBg7sBgggF8vnD88sBoyY0k3F41kB88Y0mMgzSstXs4tB8jgCsorB40YkhpB7zBos-BnppBwlQrpF08V0rC8zV8kLo-NgsTolIw-a4hGwrkCoGgkDoGo4BA4rBoGo4Bg9D464B4SoyJAo4B4rBgxTo4B45YojEol9CoG4vEnG4vEvMwienGgvFv3CowU_xBolSn4BolS_nG4qsBnrKohhCn8E4zgB_6Oo8oDAo1FAoxCAg9DvMw2UwM4zyCnGw3CoG4mQ4rBw9TwwDw9TofwiFg-KgyaozQgxToqc41Vg9D4rBg7OwuOg-K40Ow3Cw7FwiFg-KghHo8doxCwpd4kCw9sBoqDw_hBgvFwzY4rBwwD4So4BofwiFgvFo9L4kbgmqB4yZw1mBsvHs9K03asuUoyd0oLk0J3D8mK7nCoiHvjCs9ZzkNwhcrtSsyDnzGw5QnrjBw3C_uFwla3uvBgZ3rBomZ3gxB4kCvpE4_Q36fgyB39C4kC_8Dkmaz10Bwlfn75Boh6Cz-zD89Q72b",
          "departure": {
            "time": "2019-12-09T12:38:00+01:00",
            "place": {
              "name": "Fiumicino Aeroporto",
              "type": "station",
              "location": {
                "lat": 41.793572,
                "lng": 12.251733
              },
              "id": "722068831"
            }
          },
          "arrival": {
            "time": "2019-12-09T13:10:00+01:00",
            "place": {
              "name": "Roma Termini",
              "type": "station",
              "location": {
                "lat": 41.900503,
                "lng": 12.502027
              },
              "id": "722068214"
            }
          },
          "transport": {
            "mode": "regionalTrain",
            "name": "Regionale Veloce 3281",
            "category": "Regional Train",
            "color": "#05655D",
            "textColor": "#FFFFFF",
            "headsign": "Roma Termini"
          },
          "intermediateStops": [],
          "agency": {
            "id": "fKf00800",
            "name": "TRENITALIA",
            "website": "http://www.trenitalia.com"
          },
          "attributions": [
            {
              "id": "R008001-C0-S1-link-0",
              "href": "http://www.trenitalia.com/tcom",
              "text": "TRENITALIA",
              "type": "disclaimer"
            }
          ]
        },
        {
          "id": "R008001-C0-S2",
          "type": "pedestrian",
          "actions": [
            {
              "action": "depart",
              "duration": 61,
              "instruction": "Head northeast on Galleria Termini. Go for 61 m.",
              "offset": 0
            },
            {
              "action": "arrive",
              "duration": 0,
              "instruction": "Arrive at Galleria Termini. Your destination is on the right.",
              "offset": 1
            }
          ],
          "travelSummary": {
            "duration": 60,
            "length": 60
          },
          "polyline": "BHqhmm_Y6hsuuH4qIy7I",
          "departure": {
            "time": "2019-12-09T13:10:00+01:00",
            "place": {
              "name": "Roma Termini",
              "type": "station",
              "location": {
                "lat": 41.900503,
                "lng": 12.502027
              },
              "id": "722068214"
            }
          },
          "arrival": {
            "time": "2019-12-09T13:11:00+01:00",
            "place": {
              "type": "place",
              "location": {
                "lat": 41.90096,
                "lng": 12.50243
              }
            }
          }
        }
      ]
    }
  ]
}

Note

When you do not specify departureTime/arrivalTime parameters, the current time when the request is triggered is taken. As a result, you may not obtain the same response.

results matching ""

    No results matching ""