REST API - Stops

Stops

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

When visualizing many stop points over a large region, consider using Transitland's 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" unless requesting a specific feed version.

Stop API results are based on this GraphQL query.


Request parameters

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

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

GET/api/v2/rest/stops/{route_key} Request a stop by ID or Onestop ID

GET/api/v2/rest/stops/{route_key}.format Request a stop by ID or Onestop ID in specified format

ParameterTypeDescriptionExample
stop_keystring

Stop lookup key; can be an integer ID, a '<feed onestop_id>:<gtfs stop_id>' key, or a Onestop 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) type.served_by_route_type=1
served_by_route_typesstring

Search for stops served by particular route (vehicle) types. Accepts comma separated values.served_by_route_types=1,2
include_alertsstring enum
truefalse
Include alerts from GTFS Realtime feeds
idinteger

Search for a specific internal ID
afterinteger

Pagination cursor value. This should be treated as an opaque value created by the server and returned as the link to the next result page, which may be empty. For historical reasons, this is based on the integer record ID values, but that should not be assumed to be the case in the future.
limitinteger

Maximum number of records to returnlimit=1
formatstring enum
jsongeojsongeojsonlpng
Response formatformat=geojson
searchstring

Full text searchsearch=embarcadero
onestop_idstring

Search for a specific Onestop IDonestop_id=...
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-c20-trimet
radiusnumber

Search radius (meters); requires lat and lonlon=-122.3&lat=37.8&radius=1000
lonnumber

Longitude
latnumber

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_allowedstring 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_optionalstring 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_productstring 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_allowedstring 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_attributionstring 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


stops
array: Stop
Currently imported stops. If no feed version is specified, defaults to active feed versions.
id
integer
Internal integer ID
stop_id
string
GTFS stops.stop_id

Example400029

stop_name
string
GTFS stops.stop_name

ExampleMADISON AV/E 68 ST

stop_url
string
GTFS stops.stop_url
stop_timezone
string
GTFS stops.stop_timezone; if overriding agency/route timezone

ExampleAmerica/Los_Angeles

stop_desc
string
GTFS stops.stop_desc

ExampleNW Corner of Broadway and 14th

stop_code
string
GTFS stops.stop_code
zone_id
string
GTFS stops.zone_id
platform_code
string
GTFS stops.platform_code
tts_stop_name
string
GTFS stops.tts_stop_name
wheelchair_boarding
integer
GTFS stops.wheelchair_boarding
Enum012
location_type
integer
GTFS stops.location_type; this is optional in GTFS spec
Enum01234
onestop_id
string
OnestopID for this stop, if available

Examples-dr5ruvgnyk-madisonav~e69st

geometry
Stop geometry
place
object: StopPlace
State/Province associated with this stop
adm0_name
string
Best-matched country name
adm1_name
string
Best-matched state or province name
adm0_iso
string
Best-mached country ISO code
adm1_iso
string
Best-matched state or province ISO code
feed_version
object: FeedVersion
Feed version
id
integer
Internal integer ID
sha1
string
SHA1 hash of the zip file

Exampleab5bdc8b6cedd06792d42186a9b542504c5eef9a

fetched_at
string
Time when the file was fetched from the url

Example2019-11-15T00:45:55.409906

feed
object: Feed
Feed associated with this feed version
level
object: Level
Stop level
level_id
string
GTFS levels.level_id
level_name
string
GTFS levels.level_name
level_index
number
GTFS levels.level_index
parent
object: Stop
Stop parent station
id
integer
Internal integer ID
stop_id
string
GTFS stops.stop_id

Example400029

stop_name
string
GTFS stops.stop_name

ExampleMADISON AV/E 68 ST

geometry
Stop geometry
alerts
array: Alert
GTFS-RT Alerts for this stop
alerts
array: Alert
GTFS-RT Alerts for this stop
cause
string
GTFS-RT Alert cause
effect
string
GTFS-RT Alert effect
severity_level
string
GTFS-RT Alert severity level
url
array: RTTranslation
GTFS-RT Alert uRL for more information
header_text
array: RTTranslation
GTFS-RT Alert header text
description_text
array: RTTranslation
GTFS-RT Alert description text
tts_header_text
array: RTTranslation
GTFS-RT Alert TTS header text
tts_description_text
array: RTTranslation
GTFS-RT Alert TTS description text
active_period
array: RTTimeRange
GTFS-RT Alert active alert period. See https://gtfs.org/realtime/reference/#message-timerange