REST API - Stop departures

Stop departures

The stop-departures endpoint provides information about when transit trips serve a given stop.

To instead see departures for a specific transit trip, use the trips endpoint.

How are departure times calculated?

Transitland calculates scheduled arrivals/departures from static GTFS feeds using the following approaches:

  1. The scheduled arrival and/or departure times for a given stop, as defined in a static GTFS feed's stop_times.txt file.
  2. If the static GTFS feed does not provide an arrival or departure time for the specified stop, Transitland will interpolate times between "timepoint" stops before and after the specified stops.
  3. When available, Transitland will make use of shape_dist_traveled values in shapes.txt to improve interopolation accuracy.

For operators that also provide GTFS Realtime feeds with TripUpdates, Transitland also provides real-time arrivals/departures. Real-time and scheduled values are listed separately in API responses. Note that "added" trips will only have real-time values, but not scheduled values.

Limitations

  • For operators that provide GTFS Realtime feeds with VehiclePositions (but not TripUpdates), Transitland does not use vehicle positions to independently estimate real-time arrivals/departures.
  • For operators that define route schedules using frequencies.txt (a much less popular approach than using stop_times.txt), Transitland does not currently calculate stop departure times.

Request parameters

GET/api/v2/rest/stops/{stop_key}/departures Stop departures — Departures from a given stop based on static and real-time data

ParameterTypeDescriptionExample
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, a Onestop IDf-sf~bay~area~rg:LAKEs-9q9p1bc1td-lakemerritt
include_alertsstring enum
truefalse
Include alerts from GTFS Realtime feeds
afterinteger

Return records past this record ID
limitinteger
0 ... 100
Maximum number of records to returnlimit=1
service_datestring

Search for departures on a specified date, in YYYY-MM-DD formatservice_date=2022-09-28
nextinteger

Search for departures leaving within the next specified number of seconds in local timenext=600
start_timestring

Search for departures leaving after a specified local time, in HH:MM:SS format. Requires service_date.start_time=10:00:00
end_timestring

Search for departures leaving before a specified local time, in HH:MM:SS format. Requires service_date.end_time=11:00:00
include_geometrystring enum
truefalse
Include route geometryinclude_geometry=true
use_service_windowstring enum
truefalse
Use a fall-back service date if the requested service_date is outside the active service period of the feed version. The fall-back date is selected as the matching day-of-week in the week which provides the best level of scheduled service in the feed version.use_service_window=true

Response format

Array of objects
Description GTFS stop_time entities, with some modifications
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 fields for the feed version
departures
(object)
Departures from this stop
arrival_time
(seconds)
Arrival time

Example10:02:03

departure_time
(seconds)
Departure time

Example11:04:05

arrival
(object)
Arrival details
scheduled
(string)
Scheduled local event time

Example10:00:00

estimated
(string)
Estimated local event time based on GTFS Realtime data

Example10:01:30

estimated_utc
(string)
Estimated event time in absolute UTC

Example2022-09-29T23:16:12Z

delay
(integer)
Estimated schedule delay, in seconds. See GTFS Realtime documentation.

Example15

uncertainty
(integer)
Estimation uncertainty. See GTFS Realtime documentation.

Example30

departure
(object)
Departure details
scheduled
(string)
Scheduled local event time

Example10:00:00

estimated
(string)
Estimated local event time based on GTFS Realtime data

Example10:01:30

estimated_utc
(string)
Estimated event time in absolute UTC

Example2022-09-29T23:16:12Z

delay
(integer)
Estimated schedule delay, in seconds. See GTFS Realtime documentation.

Example15

uncertainty
(integer)
Estimation uncertainty. See GTFS Realtime documentation.

Example30

stop_sequence
(integer)
GTFS stop_sequence

Example1

stop_headsign
(string)
GTFS stop_headsign

ExampleSouth San Francisco

pickup_type
(integer)
GTFS pickup_type
drop_off_type
(integer)
GTFS drop_off_type
timepoint
(integer)
GTFS timepoint
shape_dist_traveled
(number)
GTFS shape_dist_traveled
continuous_pickup
(integer)
GTFS continuous_pickup
continuous_drop_off
(integer)
GTFS continuous_drop_off
interpolated
(integer)
Non-zero if interpolated time values were set during import
trip
(object)
A subset of fields for the associated trip