How to search Stations by location
User story
You want to search for stations within a certain distance from their current geographic location.
Request
Search stations 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 search for stations within 500
meters from your location:
GET https://transit.hereapi.com/v8/stations?in=41.90123,12.50091
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 station identifiers are allowed in a single query.
- each station element in
stationsresponse object includes the following high-level elements:placewith station/stop information such as name, location, ID, type.transportswith information about the transports serving the station. Addreturn=transportin request to enable it.accessPointswith information about points that are used to access the station/stop.
{
"stations": [
{
"place": {
"name": "Piazza Dei Cinquecento",
"type": "station",
"location": {
"lat": 41.901297,
"lng": 12.50042
},
"id": "415701325"
},
"transports": [
{
"mode": "bus",
"name": "P02",
"color": "#4C8DC1",
"textColor": "#000000",
"headsign": "Piazza Dei Cinquecento"
}
],
"accessPoints": [
{
"location": {
"lat": 41.901298,
"lng": 12.500427
},
"name": "West Entrance",
"type": "accessPoint"
},
{
"location": {
"lat": 41.901299,
"lng": 12.500429
},
"name": "Piazza Mall",
"type": "accessPoint"
}
]
}
]
}Updated 14 days ago