GuidesAPI Reference
Guides

How to calculate a park and ride route

User Story

You request an intermodal route from Nauener Tor in Potsdam to Invalidenstraße in Berlin with the Intermodal Routing API v8 using a combination of vehicle and transit transport types. We call this Park and Ride intermodal route. You want to drive until the outskirts of Berlin, park the car and reach your destination through public transportation.

Request

Authentication

Intermodal Routing supports authentication using both API Key and Bearer Token. To get started, join the HERE platform.

To learn more about the available authentication methods, see Identity and Access Management Developer Guide.

📘

Note

You can get started for free with the HERE Base Plan. For detailed pricing information, see HERE Location Service Rates.

Construct a Park and Ride Route Request

GET https://intermodal.router.hereapi.com/v8/routes
    ?destination=52.53105637575095,13.384944833815183
    &origin=52.40358749909618,13.058351363288239
    &vehicle[enable]=routeHead
    &vehicle[modes]=car
    &transit[enable]=routeTail
    &rented[enable]=
    &apiKey=<YOUR API KEY>

The only required parameters for an Intermodal Route Request in general are origin and destination, given in the form <latitude>,<longitude> format. For a Park and Ride request in particular, set the parameters vehicle[modes]=car, vehicle[enable]=routeHead, transit[enable]=routeTail, and rented[enable]= to ensure the Park and Ride intermodal route in the response.

The vehicle[modes]=car and vehicle[enable]=routeHead parameters tell the intermodal router to return the (personal) vehicle transport type in the head section of the route, whereas the transit[enable]=routeTail parameter tells the intermodal algorithm to return public transit route options in the tail section of the route. The rented[enable]= parameter is needed to disable the rented transport type in the response which is enabled by default for all sections of the route.

By default, the Intermodal Routing API v8 returns only one optimal intermodal route. The optional parameter alternatives represents the number of alternative routes to return aside from the optimal route. By default, alternatives=0 is assumed and only one optimal route is returned.

In cases where also a pedestrian route is available it will be also returned. This may lead to two routes being returned in total (one intermodal route and one pedestrian route) even though only one is expected when alternatives=0 is given.

📘

Note

Park and Ride sends a car routing request to the Routing API to identify suitable areas along the route where to search for parking lots.

Note

By default, the vehicle[enable]= parameter is disabled because we assume that not everyone has a personal vehicle, such as a car, at their disposal.

Response

A successful response contains the following details about the calculated route:

  • One optimal route divided into sections
  • Departure and arrival times, duration, coordinates, and other per-section information for each section
  • Per section, one of the following transport types:
    • vehicle - route section in which you drive from your origin to the location of transfer
    • pedestrian - route section in which you park the car and transfer from vehicle to transit
    • transit - route section with the public transit departure and arrival stations
      • Optionally, all intermediate stops can be returned by setting the return=intermediate request parameter.
  • A set of operators that run the services including operator code, operator name, and links to operator websites
{
  "routes": [
    {
      "id": "R005495-C0",
      "sections": [
        {
          "id": "R005495-C0-S0",
          "type": "vehicle",
          "postActions": [
            {
              "action": "park",
              "duration": 300
            }
          ],
          "departure": {
            "time": "2020-04-29T11:51:55+02:00",
            "place": {
              "type": "place",
              "location": {
                "lat": 52.4035943,
                "lng": 13.0583453
              }
            }
          },
          "arrival": {
            "time": "2020-04-29T12:07:24+02:00",
            "place": {
              "name": "P+R Wannsee S-Bahn",
              "waypoint": 0,
              "type": "parkingLot",
              "location": {
                "lat": 52.41976,
                "lng": 13.18058
              },
              "id": "276u3365-1679b528d63c4c7e9719561ae6c9e787",
              "attributes": [
                "parkAndRide"
              ]
            }
          },
          "transport": {
            "mode": "car"
          }
        },
        {
          "id": "R005495-C0-S1",
          "type": "pedestrian",
          "departure": {
            "time": "2020-04-29T12:12:24+02:00",
            "place": {
              "type": "place",
              "location": {
                "lat": 52.41976,
                "lng": 13.18058
              }
            }
          },
          "arrival": {
            "time": "2020-04-29T12:18:24+02:00",
            "place": {
              "name": "S Wannsee Bhf",
              "type": "station",
              "location": {
                "lat": 52.421457,
                "lng": 13.179099
              },
              "id": "216041100"
            }
          }
        },
        {
          "id": "R005495-C0-S2",
          "type": "transit",
          "departure": {
            "time": "2020-04-29T12:27:00+02:00",
            "place": {
              "name": "S Wannsee Bhf",
              "type": "station",
              "location": {
                "lat": 52.421457,
                "lng": 13.179099
              },
              "id": "216041100"
            }
          },
          "arrival": {
            "time": "2020-04-29T12:44:00+02:00",
            "place": {
              "name": "S+U Berlin Hauptbahnhof",
              "type": "station",
              "location": {
                "lat": 52.525847,
                "lng": 13.368924
              },
              "id": "216022539"
            }
          },
          "transport": {
            "mode": "regionalTrain",
            "name": "RE7",
            "category": "Regional Train",
            "color": "#269900",
            "textColor": "#FFFFFF",
            "headsign": "Wünsdorf-Waldstadt, Bahnhof"
          },
          "agency": {
            "id": "cKO10800",
            "name": "DB Regio AG",
            "website": "http://www.bahn.de/brandenburg"
          }
        },
        {
          "id": "R005495-C0-S3",
          "type": "pedestrian",
          "departure": {
            "time": "2020-04-29T12:44:00+02:00",
            "place": {
              "name": "S+U Berlin Hauptbahnhof",
              "type": "station",
              "location": {
                "lat": 52.525847,
                "lng": 13.368924
              },
              "id": "216022539"
            }
          },
          "arrival": {
            "time": "2020-04-29T12:45:00+02:00",
            "place": {
              "name": "S+U Berlin Hauptbahnhof",
              "type": "station",
              "location": {
                "lat": 52.525847,
                "lng": 13.368924
              },
              "id": "216000126"
            }
          }
        },
        {
          "id": "R005495-C0-S4",
          "type": "transit",
          "departure": {
            "time": "2020-04-29T12:47:00+02:00",
            "place": {
              "name": "S+U Berlin Hauptbahnhof",
              "type": "station",
              "location": {
                "lat": 52.525847,
                "lng": 13.368924
              },
              "id": "216000126"
            }
          },
          "arrival": {
            "time": "2020-04-29T12:51:00+02:00",
            "place": {
              "name": "U Naturkundemuseum",
              "type": "station",
              "location": {
                "lat": 52.530339,
                "lng": 13.382224
              },
              "id": "216005176"
            }
          },
          "transport": {
            "mode": "lightRail",
            "name": "M10",
            "category": "Tram",
            "color": "#FF3300",
            "textColor": "#FFFFFF",
            "headsign": "S+U Warschauer Str."
          },
          "agency": {
            "id": "cKO79600",
            "name": "Berliner Verkehrsbetriebe",
            "website": "http://www.bvg.de"
          }
        },
        {
          "id": "R005495-C0-S5",
          "type": "pedestrian",
          "departure": {
            "time": "2020-04-29T12:51:00+02:00",
            "place": {
              "name": "U Naturkundemuseum",
              "type": "station",
              "location": {
                "lat": 52.530339,
                "lng": 13.382224
              },
              "id": "216005176"
            }
          },
          "arrival": {
            "time": "2020-04-29T12:54:00+02:00",
            "place": {
              "type": "place",
              "location": {
                "lat": 52.531056,
                "lng": 13.384945
              }
            }
          }
        }
      ]
    }
  ]
}