Contents
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:
- The scheduled arrival and/or departure times for a given stop, as defined in a static GTFS feed's
stop_times.txt
file. - 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.
- When available, Transitland will make use of
shape_dist_traveled
values inshapes.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 notTripUpdates
), 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 usingstop_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
Parameter | Type | Description | Example |
---|---|---|---|
id | integer 0 ... unlimited | Search for a specific internal ID | |
stop_key | string | Stop lookup key; can be an integer ID, a '<feed onestop_id>:<gtfs stop_id'> key, a Onestop ID | f-sf~bay~area~rg:LAKEs-9q9p1bc1td-lakemerritt |
include_alerts | string enum | Include alerts from GTFS Realtime feeds | |
after | integer | Return records past this record ID | |
limit | integer 0 ... 100 | Maximum number of records to return | limit=1 |
service_date | string | Search for departures on a specified date, in YYYY-MM-DD format | service_date=2022-09-28 |
next | integer | Search for departures leaving within the next specified number of seconds in local time | next=600 |
start_time | string | Search for departures leaving after a specified local time, in HH:MM:SS format. Requires service_date. | start_time=10:00:00 |
end_time | string | Search for departures leaving before a specified local time, in HH:MM:SS format. Requires service_date. | end_time=11:00:00 |
include_geometry | string enum | Include route geometry | include_geometry=true |
use_service_window | string enum | 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
Reference GTFS specification for trips.txt
id
(integer)
(integer)
Unique integer ID
onestop_id
(string)
(string)
Onestop ID for this stop, if available
Examples-dr5ruvgnyk-madisonav~e69st
stop_id
(string)
(string)
GTFS stop_id
Example400029
stop_name
(string)
(string)
GTFS stop_name
ExampleMADISON AV/E 69 ST
stop_desc
(string)
(string)
GTFS stop_desc
ExampleFind this stop at the end of a long journey
stop_url
(uri)
(uri)
GTFS stop_url
stop_timezone
(timezone)
(timezone)
GTFS stop_timezone, if overriding agency/route timezone
ExampleAmerica/Los_Angeles
stop_code
(string)
(string)
GTFS stop_code
zone_id
(string)
(string)
GTFS zone_id
wheelchair_boarding
(integer)
(integer)
GTFS wheelchair_boarding
location_type
(integer)
(integer)
GTFS location_type
platform_code
(string)
(string)
GTFS platform_code
tts_stop_name
(string)
(string)
GTFS tts_stop_name
feed_version
(object)
(object)
A subset of fields for the feed version
departures
(object)
(object)
Departures from this stop
arrival_time
(seconds)
(seconds)
Arrival time
Example10:02:03
departure_time
(seconds)
(seconds)
Departure time
Example11:04:05
arrival
(object)
(object)
Arrival details
scheduled
(string)
(string)
Scheduled local event time
Example10:00:00
estimated
(string)
(string)
Estimated local event time based on GTFS Realtime data
Example10:01:30
estimated_utc
(string)
(string)
Estimated event time in absolute UTC
Example2022-09-29T23:16:12Z
delay
(integer)
(integer)
Estimated schedule delay, in seconds. See GTFS Realtime documentation.
Example15
uncertainty
(integer)
(integer)
Estimation uncertainty. See GTFS Realtime documentation.
Example30
departure
(object)
(object)
Departure details
scheduled
(string)
(string)
Scheduled local event time
Example10:00:00
estimated
(string)
(string)
Estimated local event time based on GTFS Realtime data
Example10:01:30
estimated_utc
(string)
(string)
Estimated event time in absolute UTC
Example2022-09-29T23:16:12Z
delay
(integer)
(integer)
Estimated schedule delay, in seconds. See GTFS Realtime documentation.
Example15
uncertainty
(integer)
(integer)
Estimation uncertainty. See GTFS Realtime documentation.
Example30
stop_sequence
(integer)
(integer)
GTFS stop_sequence
Example1
stop_headsign
(string)
(string)
GTFS stop_headsign
ExampleSouth San Francisco
pickup_type
(integer)
(integer)
GTFS pickup_type
drop_off_type
(integer)
(integer)
GTFS drop_off_type
timepoint
(integer)
(integer)
GTFS timepoint
shape_dist_traveled
(number)
(number)
GTFS shape_dist_traveled
continuous_pickup
(integer)
(integer)
GTFS continuous_pickup
continuous_drop_off
(integer)
(integer)
GTFS continuous_drop_off
interpolated
(integer)
(integer)
Non-zero if interpolated time values were set during import
trip
(object)
(object)
A subset of fields for the associated trip