How to send a request to the Intermodal Routing API v8
To send a request to the Intermodal Routing API v8, the basic elements shown in the following table are required: Table 1. Required request parameters
| Name | Format | Description |
|---|---|---|
| Base URL | string, https://intermodal.router.hereapi.com | Production environment |
| Version | string, /v8 | The API version to use |
| Resource | string, /routes | The endpoint to access the resource |
origin | string, "{lat},{lng}" | The origin WGS-84 compliant coordinates of the request |
destination | string, "{lat},{lng}" | The destination WGS-84 compliant coordinates of the request |
For more information, see the following response examples:
Notes
The response to the above request delivers the following high-level elements:
- metadata – a
notices(optional) object with a list of issues related to the response - response – a
routesobject with a list of sections for each transit route alternative.
Useful Common Request Parameters
For a comprehensive list of request parameters available to the Intermodal Routing API, see the Routing section of the Intermodal Routing API Reference.
These are some commonly used request parameters available for all services of the Intermodal Routing API:
-
Set the
departureTimeparameter to request a route for a later time. By default, a route starting right now is computed. -
By default, the Intermodal Routing API v8 returns only one optimal intermodal route. The optional parameter
alternativesrepresents the number of alternative routes to return aside from the optimal route. By default,alternatives=0is 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=0is given. -
By default, the
routesobject only contains departure, arrival and transport mode nodes for each section of the journey. Set thereturnparameter for additional attributes such as fare information (if present), turn-by-turn navigation or geometry information about the route taken.See the API Reference for more details.
-
To limit the number of changes permitted in the route response, set the
changesparameter to a value from 0 to 6. By default, an unlimited number of changes is permitted.
Updated 10 days ago