How to send a request to the Public Transit Next Departures API
To send a request to the Public Transit Station Search you need the basic elements shown in the following tables.
Search public transit stations by means of the following query parameters:
ids: station identifier,in: station geographic location,nameandin: station name and geographic location.
Request by ID
ids: list of station identifiers.
Table 1. Required request parameters to query departures by IDs
| Name | Format | Description |
|---|---|---|
| Base URL | string, https://transit.hereapi.com | Production environment |
| Version | string, /v8 | The API version to use |
| Resource | string, /stations | The endpoint to access the resource |
ids | string, id1,... | Specifies a comma-separated list of station IDs |
For more information, see how to Search Stations By Ids.
Request by location
in: circle area defined using center point and radius parameters.
Table 2. Required request parameters to query departures by location
| Name | Format | Description |
|---|---|---|
| Base URL | string, https://transit.hereapi.com | Production environment |
| Version | string, /v8 | The API version to use |
| Resource | string, /stations | The endpoint to access the resource |
in | string, {lat},{lng}[;r={radius}] | Specifies the center point and the optional radius of the search |
For more information, see how to Search Stations By Location.
Request by name location
name and in: full or partial station name and circle area defined using center
point and radius parameters.
Table 3. Required request parameters to query departures by location
| Name | Format | Description |
|---|---|---|
| Base URL | string, https://transit.hereapi.com | Production environment |
| Version | string, /v8 | The API version to use |
| Resource | string, /stations | The endpoint to access the resource |
name | string, Roma Termini | The station name or part of the name to search for. It is composed of one or more space separated words. |
in | string, {lat},{lng}[;r={radius}] | Specifies the center point and the optional radius of the search |
For more information, see how to Search Stations By Name and Location.
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
stationsobject with a list of stations, one for each specified id or
name and/or in a defined circular area.
For more information on the request parameters, see the Station Search section of the Public Transit API Reference
Updated 14 days ago