Public Transit API Developer's Guide

Transit Stations by Name

User Story

The user wants to search for transit stations in New York City (40.7510, 73.9916) with the name "New York".

Request

The query parameter center specifies the location of the search.

https://cit.transit.api.here.com/v3/stations/by_name.json
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&center=40.7510,-73.9916
&name="New%20York"

Response

The response to the request contains the following information blocks:
  • a maximum of 15 transit stations by default, can be configured using the optional max parameter
  • each station element includes the following information:
    • name, ID, longitude, and latitude of the station
    • distance in meters from the station, available only when you query for stations around you
    • expcted time to reach the station from your current location, available only when you query for stations around you
    • if a Next Nearby Departures request can be performed
    • the country where the x and y parameters point to
    • country code compliant to ISO 3166-1
    • state in the country
    • postal code
    • district in the state
    • name of the street, square, or boulevard
    • name of the city closest to the center parameter point to
{
  "Res": {
    "serviceUrl": "http://search.st.transit.api.here.com/t0k2/stations_v2/stations_v2",
    "Stations": {
      "Stn": [
        {
          "id": "717080445",
          "name": "14 St - Union Sq",
          "distance": 70,
          "duration": "PT0H1M10S",
          "x": -73.989951,
          "y": 40.734673,
          "has_board": 1,
          "country": "United States",
          "ccode": "USA",
          "state": "NY",
          "postal": "10003",
          "district": "Gramercy Park",
          "street": "Union Sq E",
          "number": "6",
          "city": "New York"
        },
        {
          "id": "717061414",
          "name": "Union SQ E/E 15 St",
          "distance": 34,
          "duration": "PT0H0M34S",
          "x": -73.989609,
          "y": 40.73555,
          "has_board": 1,
          "country": "United States",
          "ccode": "USA",
          "state": "NY",
          "postal": "10003",
          "district": "Gramercy Park",
          "street": "Union Sq E",
          "number": "24",
          "city": "New York"
        },
        {
          "id": "717081137",
          "name": "Union Sq - 14 St",
          "distance": 93,
          "duration": "PT0H1M33S",
          "x": -73.99073,
          "y": 40.734789,
          "has_board": 1,
          "country": "United States",
          "ccode": "USA",
          "state": "NY",
          "postal": "10003",
          "district": "Flatiron District",
          "city": "New York"
        }
      ]
    }
  }
}