Documentation

REST API - Stops

Stops

The REST API routes stops 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 Search for stops

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

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

GET/api/v2/rest/stops/{stop_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
location_typeinteger

Filter by location_type: 0=stop/platform, 1=station, 2=entrance/exit, 3=generic node, 4=boarding arealocation_type=1
include_alertsstring enum
truefalse
Include alerts from GTFS Realtime feeds
include_routesstring enum
truefalse
Include routes that serve this stopinclude_routes=true
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
jsongeojsongeojsonl
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
List or search for Stops
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; overrides agency timezone; inherits from parent station if empty

ExampleAmerica/Los_Angeles

stop_desc
string
GTFS stops.stop_desc

ExampleNW Corner of Broadway and 14th

stop_code
string
GTFS stops.stop_code; short text or number identifying the location for riders
zone_id
string
GTFS stops.zone_id; identifies the fare zone for a stop; required only on stops referenced by fare_rules.txt
platform_code
string
GTFS stops.platform_code; platform identifier without a 'platform' prefix (e.g. G or 3)
tts_stop_name
string
GTFS stops.tts_stop_name; readable version of stop_name for use with text-to-speech systems
stop_access
integer
GTFS stops.stop_access [0=access only via station entrance/pathways, 1=route directly to the stop]; only valid for platforms (location_type 0) with a parent_station
wheelchair_boarding
integer
GTFS stops.wheelchair_boarding [0=no information, 1=some accessible path exists, 2=no accessible path]
location_type
integer
GTFS stops.location_type [0=stop/platform, 1=station, 2=entrance/exit, 3=generic node, 4=boarding area]
onestop_id
string
Onestop ID for this stop, or empty string if not registered

Examples-dr5ruvgnyk-madisonav~e69st

geometry
Geographic location of this stop as a GeoJSON Point
place
object: StopPlace
Administrative place (country and state/province) associated with this stop's location
adm0_name
string
Best-matched country name
adm1_name
string
Best-matched state or province name
adm0_iso
string
Best-matched country ISO code
adm1_iso
string
Best-matched state or province ISO code
feed_version
object: FeedVersion
Source feed version for this entity
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
Level within the station that this stop/platform belongs to
level_id
string
GTFS levels.level_id
level_name
string
GTFS levels.level_name; rider-facing level name (e.g. Mezzanine, Upper Level)
level_index
number
GTFS levels.level_index; higher values are upper levels, 0 is ground, negative values are underground
parent
object: Stop
Parent station for this stop; for platforms and entrances (location_type 2, 3, 4), this is the enclosing station (location_type 1)
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
Geographic location of this stop as a GeoJSON Point
alerts
array: Alert
GTFS-RT service alerts for this stop; pass active: true to return only currently active alerts
alerts
array: Alert
GTFS-RT service alerts for this stop; pass active: true to return only currently active alerts
cause
string
GTFS-RT Alert cause
effect
string
GTFS-RT Alert effect
severity_level
string
Alert severity: UNKNOWN_SEVERITY, INFO, WARNING, or SEVERE
url
array: RTTranslation
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
Header text optimized for text-to-speech (TTS) systems
tts_description_text
array: RTTranslation
Description text optimized for text-to-speech (TTS) systems
active_period
array: RTTimeRange
Time ranges during which this alert is active. See https://gtfs.org/realtime/reference/#message-timerange