Public Transit API Developer's Guide

Station Search by Name

Use the resource stations/by_name to request a list of stations matching a name specified in the request.

.../v3/stations/by_name.{format}?<parameter>=<value>...
  

The list of stations in the response is sorted either by distance or a combination of distance and name matching score. In other words, with optional parameter method=strict, all stations that contain an exact match in their names with the search string, are in the response, sorted by distance. But in case of method=fuzzy, the list of stations in the response is sorted by distance and by closest name matching.

Note: In order to avoid duplicate results being returned when requesting stations by name, all stations having the same name and within 300 m of each other are grouped into a single result in the response. However, when making a station search by geo-coordinates, all stations will be returned individually.

Table 1. Mandatory Parameters
Parameter Data Type Description
app_id String

A 20 bytes Base64 URL-safe encoded string used for the authentication of the client application.
You must include an app_id and app_code with every request. To get an app_code assigned to you, please see Acquiring Credentials.

app_code String

A 20 bytes Base64 URL-safe encoded string used for the authentication of the client application.
You must include an app_id and app_code with every request. To get an app_code assigned to you, please see Acquiring Credentials.

name String Specifies the name or a part of the name of the station to search for and can be one word, multiple words or partial word separated by either comma or space.
center Double,Double Specifies the latitude and the longitude of the center point of your search separated by a comma. Where the latitude is in WGS 84-compliant degrees between -90 and 90 and the longitude in WGS 84-compliant degrees between -180 and 180.
Table 2. Optional Parameters
Parameter Data Type Description
callbackFunc String Specifies an arbitrary string used to wrap the JSON object in the response.
callbackId String If you specify the parameter callbackId, specifies the first argument to the function specified by the callbackFunc.
details Integer Requests line information for every station. The possible values are:

1 (enabled), 0 (disabled)

The default value is 0.

lang String Specifies the language of the response. The value complies with the ISO 639-1 standard and defaults to en.
max Integer Specifies the maximum number of stations/stops included in the response.

The default value is 5. The minimum value is 1 and the maximum value is 25.

method String Specifies if the match is fuzzy or strict.

The default value is fuzzy.

  • fuzzy - search for a station with the name similar to one of the names requested
  • strict - search for a station with the name exactly match one of the names requested or contains it as its part
For example, if the station name in the request is "maurer", then if the method is fuzzy the response contains "AMBOY AVE AT MAURER RD" and "LAUREL HILL BL/48 ST". If the method is strict the response contains "AMBOY AVE AT MAURER RD" but not "LAUREL HILL BL/48 ST".
radius Integer Specifies a radius in meters that when combined with a centerpoint defines the area of the search.

The default value is 20000km. The minimum value is 0 and the maximum value is not limited.