How to search next departures by location
User story
You want to request next departures information within a certain distance from the geographic location of Rome Termini central station.
Request
Find next departures through a single GET request. The only required
parameter in specifies the center of the searching area which is
defined as a pair of WGS84 coordinates in the form
<latitude>,<longitude>. The optional parameter r specifies the
radius in meters specifies the size of the searching area. By default,
r=500. The following request will find next departures within 500
meters from the given location 41.900138,12.501924:
GET https://transit.hereapi.com/v8/departures
?in=41.900138,12.501924;r=500
Authorization: Bearer {TOKEN}Note
For more information on the currently available authentication methods, see the Identity & Access Management Developer Guide.
Response
The response to the request contains the following information blocks:
- a maximum of 50 departure board elements per station for all nearby stations.
The number of departure board elements depends on the proximity of the nearby stations to the specified location within a default radius of 500 meters.
The optional maxPlaces request parameter sets the maximum number of stations
the response should include.
- Each departure element in
departureswithin theboardsresponse object
includes the following high-level elements:
placewith station/stop information such as name, location, ID, type.departureswith transport information such as departure time, delay, status, operator and so on.attributionswith required information to be displayed such as disclaimers.
{
"boards": [
{
"place": {
"name": "Roma Termini",
"type": "station",
"location": {
"lat": 41.900503,
"lng": 12.502027
},
"id": "722068214"
},
"departures": [
{
"time": "2020-04-21T10:28:00+02:00",
"transport": {
"mode": "regionalTrain",
"name": "Regionale 7213",
"category": "Regional Train",
"color": "#05655D",
"textColor": "#FFFFFF",
"headsign": "Velletri"
},
"agency": {
"id": "fKf00800",
"name": "TRENITALIA",
"website": "http://www.trenitalia.com"
}
},
{
"time": "2020-04-21T10:35:00+02:00",
"transport": {
"mode": "regionalTrain",
"name": "Regionale Veloce 3270",
"category": "Regional Train",
"color": "#05655D",
"textColor": "#FFFFFF",
"headsign": "Fiumicino Aeroporto"
},
"agency": {
"id": "fKf00800",
"name": "TRENITALIA",
"website": "http://www.trenitalia.com"
}
},
{
"time": "2020-04-21T10:36:00+02:00",
"transport": {
"mode": "regionalTrain",
"name": "Regionale 2383",
"category": "Regional Train",
"color": "#05655D",
"textColor": "#FFFFFF",
"headsign": "Napoli Centrale"
},
"agency": {
"id": "fKf00800",
"name": "TRENITALIA",
"website": "http://www.trenitalia.com"
}
},
{
"time": "2020-04-21T10:42:00+02:00",
"transport": {
"mode": "regionalTrain",
"name": "Regionale 12240",
"category": "Regional Train",
"color": "#05655D",
"textColor": "#FFFFFF",
"headsign": "Civitavecchia"
},
"agency": {
"id": "fKf00800",
"name": "TRENITALIA",
"website": "http://www.trenitalia.com"
}
},
{
"time": "2020-04-21T10:42:00+02:00",
"transport": {
"mode": "regionalTrain",
"name": "Regionale 12165",
"category": "Regional Train",
"color": "#05655D",
"textColor": "#FFFFFF",
"headsign": "Nettuno"
},
"agency": {
"id": "fKf00800",
"name": "TRENITALIA",
"website": "http://www.trenitalia.com"
}
}
],
"attributions": [
{
"id": "-link-0",
"href": "https://www.trenitalia.com/tcom",
"text": "TRENITALIA",
"type": "disclaimer"
}
]
},
{
"place": {
"name": "Roma Termini",
"type": "station",
"location": {
"lat": 41.90054,
"lng": 12.502168
},
"id": "415712984"
},
"departures": [
{
"time": "2020-04-21T10:28:00+02:00",
"transport": {
"mode": "regionalTrain",
"name": "FL4",
"category": "Regional Train",
"color": "#7A2900",
"textColor": "#FFFFFF",
"headsign": "Velletri"
},
"agency": {
"id": "aDmtre00",
"name": "Trenitalia",
"website": "https://www.trenitalia.com/"
}
},
{
"time": "2020-04-21T10:35:00+02:00",
"transport": {
"mode": "regionalTrain",
"name": "LE",
"category": "Regional Train",
"color": "#4C8DC1",
"textColor": "#000000",
"headsign": "Fiumicino Aeroporto"
},
"agency": {
"id": "aDmtre00",
"name": "Trenitalia",
"website": "https://www.trenitalia.com/"
}
},
{
"time": "2020-04-21T10:42:00+02:00",
"transport": {
"mode": "regionalTrain",
"name": "FL8",
"category": "Regional Train",
"color": "#00B85C",
"textColor": "#FFFFFF",
"headsign": "Nettuno"
},
"agency": {
"id": "aDmtre00",
"name": "Trenitalia",
"website": "https://www.trenitalia.com/"
}
},
{
"time": "2020-04-21T10:50:00+02:00",
"transport": {
"mode": "regionalTrain",
"name": "LE",
"category": "Regional Train",
"color": "#4C8DC1",
"textColor": "#000000",
"headsign": "Fiumicino Aeroporto"
},
"agency": {
"id": "aDmtre00",
"name": "Trenitalia",
"website": "https://www.trenitalia.com/"
}
},
{
"time": "2020-04-21T11:05:00+02:00",
"transport": {
"mode": "regionalTrain",
"name": "LE",
"category": "Regional Train",
"color": "#4C8DC1",
"textColor": "#000000",
"headsign": "Fiumicino Aeroporto"
},
"agency": {
"id": "aDmtre00",
"name": "Trenitalia",
"website": "https://www.trenitalia.com/"
}
}
],
"attributions": [
{
"id": "-link-0",
"href": "http://creativecommons.org/licenses/by/3.0/it/",
"text": "Some line names used in this product or service were edited to align with official transportation maps.",
"type": "disclaimer"
}
]
}
]
}Updated 14 days ago