REST API - Stops

Stops

The REST API routes endpoint provides a fast and flexible way to browse stops and to visualize their representative locations.

When visualizing many stop points over a large region, consider using Transitland's vector tiles instead of the REST API.

Request overview

Geographic queries require all three parameters of lat, lon, and radius to be specified. The maximum radius is 10km.

The stop API returns "active" feed versions unless requesting a specific feed version.

Stop API results are based on this GraphQL query.


Request parameters

GET/api/v2/rest/stops Stops — Search for stops

GET/api/v2/rest/stops.{format}Request stops in specified format

GET/api/v2/rest/stops/{stop_key}Request a stop

GET/api/v2/rest/stops/{stop_key}.{format}Request a stop in a specified format

ParameterTypeDescriptionExample
include_alertsstring enum
truefalse
Include alerts from GTFS Realtime feeds
idinteger
0 ... unlimited
Search for a specific internal ID
stop_keystring

Stop lookup key; can be an integer ID, a '<feed onestop_id>:<gtfs stop_id>' key, or a Onestop ID
afterinteger

Return records past this record ID
limitinteger
0 ... 100
Maximum number of records to returnlimit=1
format enum
jsongeojsongeojsonlpng
Response formatformat=geojson
searchstring

Full text searchsearch=embarcadero
onestop_idstring

Search for a specific Onestop IDonestop_id=...
stop_idstring

Search for records with this GTFS stop_idstop_id=EMBR
served_by_onestop_idsstring

Search stops visited by a route or agency OnestopID. Accepts comma separated values.served_by_onestop_ids=o-9q9-bart,o-9q9-caltrain
served_by_route_typeinteger

Search for stops served by a particular route (vehicle) typeserved_by_route_type=1
feed_version_sha1string

Search for records in this feed versionfeed_version_sha1=1c4721d4...
feed_onestop_idstring

Search for records in this feedfeed_onestop_id=f-9q9-bart
radiusnumber
0 ... 10000
Search for stops geographically; radius is in meters, requires lon and latlon=-122&lat=37&radius=1000
lonnumber
-180 ... 180
Longitude
latnumber
-90 ... 90
Latitude
bboxstring

Geographic search using a bounding box, with coordinates in (min_lon, min_lat, max_lon, max_lat) order as a comma separated stringbbox=-122.269,37.807,-122.267,37.808
license_commercial_use_allowed enum
yesnounknownexclude_no
Filter entities by feed license 'commercial_use_allowed' value. Please see Source Feed concept for details on license values. 'exclude_no' is equivalent to 'yes' and 'unknown'.
license_share_alike_optional enum
yesnounknownexclude_no
Filter entities by feed license 'share_alike_optional' value. Please see Source Feed concept for details on license values. 'exclude_no' is equivalent to 'yes' and 'unknown'.
license_create_derived_product enum
yesnounknownexclude_no
Filter entities by feed license 'create_derived_product' value. Please see Source Feed concept for details on license values. 'exclude_no' is equivalent to 'yes' and 'unknown'.
license_redistribution_allowed enum
yesnounknownexclude_no
Filter entities by feed license 'redistribution_allowed' value. Please see Source Feed concept for details on license values. 'exclude_no' is equivalent to 'yes' and 'unknown'.
license_use_without_attribution enum
yesnounknownexclude_no
Filter entities by feed license 'use_without_attribution' value. Please see Source Feed concept for details on license values. 'exclude_no' is equivalent to 'yes' and 'unknown'.

Response format

Array of objects
Description
id
(integer)
Unique integer ID
onestop_id
(string)
Onestop ID for this stop, if available

Examples-dr5ruvgnyk-madisonav~e69st

stop_id
(string)
GTFS stop_id

Example400029

stop_name
(string)
GTFS stop_name

ExampleMADISON AV/E 69 ST

stop_desc
(string)
GTFS stop_desc

ExampleFind this stop at the end of a long journey

stop_url
(uri)
GTFS stop_url
stop_timezone
(timezone)
GTFS stop_timezone, if overriding agency/route timezone

ExampleAmerica/Los_Angeles

stop_code
(string)
GTFS stop_code
zone_id
(string)
GTFS zone_id
wheelchair_boarding
(integer)
GTFS wheelchair_boarding
location_type
(integer)
GTFS location_type
platform_code
(string)
GTFS platform_code
tts_stop_name
(string)
GTFS tts_stop_name
feed_version
(object)
A subset of the fields for this stop's feed version
parent
(object)
A subset of fields for the parent station for this stop, if defined
level
(object)
GTFS level
level_id
(string)
GTFS level_id
level_name
(string)
GTFS level_name
level_index
(integer)
GTFS level_index
route_stops
(array)
Routes associated with this stop
route
()
A subset of fields for the routes that visit this stop. This field is only populated when requesting a single stop.
geometry
(object)
Geometry in GeoJSON format
type
(string)
GeoJSON geometry type

ExampleLineString

coordinates
(number array)
An array of coordinates; may be nested arrays if geometry is Polygon or MultiLineString

Example[ [ -122.496, 37.778 ], [ -122.425, 37.786 ] ]