GuidesAPI Reference
Guides

How to calculate a bike share and ride route

You request an intermodal route from West Side Ave./Union St. in New York City to the Manhattan Mall on 33rd Street, using a combination of rented bicycle and transit transport types, a so-called Bike Share and Ride intermodal route.

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 Bike Share and Ride Route Request

GET https://intermodal.router.hereapi.com/v8/routes
    ?origin=40.718211,-74.083639
    &destination=40.74912,-73.98827
    &rented[modes]=bicycle
    &rented[enable]=routeHead
    &transit[enable]=routeTail
    &taxi[enable]=
    &alternatives=2
    &apiKey=<YOUR API KEY>

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

The rented[modes]=bicycle and rented[enable]=routeHead parameters tell the intermodal router to return shared bike route options in the head section of the route, whereas the transit[enable]=routeTail parameter tells the intermodal router to return public transit route options in the tail section of the route. The taxi[enable]= parameter is needed to disable the taxi transport type in the response, which is enabled by default.

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.

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:
    • rented - route section in which you ride from your origin to the location of transfer
    • pedestrian - route section in which you walk from the rented bike stand to the transit station
    • 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": "R0040e5-C0",
            "sections": [
                {
                    "id": "R0040e5-C0-S0",
                    "type": "rented",
                    "departure": {
                        "time": "2021-01-27T10:02:00-05:00",
                        "place": {
                            "type": "place",
                            "location": {
                                "lat": 40.718211,
                                "lng": -74.083639
                            }
                        }
                    },
                    "arrival": {
                        "time": "2021-01-27T10:14:00-05:00",
                        "place": {
                            "type": "place",
                            "location": {
                                "lat": 40.73367,
                                "lng": -74.0625
                            }
                        }
                    },
                    "transport": {
                        "mode": "bicycle"
                    }
                },

                ...
                ... walk section from bike stand to station access point
                ...

                {
                    "id": "R0040e5-C0-S2",
                    "type": "transit",
                    "departure": {
                        "time": "2021-01-27T10:19:00-05:00",
                        "place": {
                            "name": "Journal Square",
                            "type": "station",
                            "location": {
                                "lat": 40.73301,
                                "lng": -74.06289
                            }
                        }
                    },
                    "arrival": {
                        "time": "2021-01-27T10:42:00-05:00",
                        "place": {
                            "name": "33rd Street",
                            "type": "station",
                            "location": {
                                "lat": 40.74912,
                                "lng": -73.98827
                            }
                        }
                    },
                    "transport": {
                        "mode": "regionalTrain",
                        "name": "PATH",
                        "category": "Rail",
                        "color": "#ff9900",
                        "textColor": "#000000",
                        "headsign": "33rd Street"
                    },
                    "agency": {
                        "id": "3XQ15100",
                        "name": "Port Authority Trans-Hudson Corporation",
                        "website": "http://www.panynj.gov/path/"
                    }
                }
            ]
        },

        ...
        ... additional routes as requested per the alternatives parameter
    ]
}