Developer Resources

getdeparturesbystop

Get a list of real-time departures for a specific stop_id.
Do not poll this more than once a minute per stop or attempt to retrieve data for every stop.

URL

https://developer.mtd.org/api/{version}/{format}/getdeparturesbystop

Remarks

These are live, stop-centric results based on GPS and the latest information in our system. We've tried to pack as much useful data into the results so you can use this in conjunction with the other methods to piece together all the information about a given bus in real-time.

There are a few things to note about the data provided here. The is_monitored field does not imply you should show the scheduled time! The expected value is based on the last known location of the bus and could still be more accurate. If is_scheduled field is false, the trip element will be blank because this trip was no scheduled previously. It was added supplementary to the regularly scheduled service.

The trip and shape_id depict the trip that the bus will use to pass this given stop; however, this may not be the values for the bus at this moment. For instance, you may see a 5E Green that's 40 minutes out. The trip and shape_id will be for a 5E, but the bus might currently be a 5W Green that will eventually become a 5E! Please keep this in mind when you're mapping results. We hope to be able to provide the current values later.

To get results for all the stops at an intersection, drop the number and colon from the stop_id (ex. IT:1 -> IT).

The vehicle_id is unique to each vehicle and also indicates the date the vehicle was acquired (e.g. 0958 is from 2009).

With the iStop field, MTD is making an exception to our policy of not allowing co-branding of MTD's names or logos. You may use the iStop logo and identify data as such. You may not misidentify any departure as an iStop that is not identified as such through the API. You may not use this name or logo to seek to mislead or misinform your users. You can download the iStop logo as an SVG or a high resolution PNG. Visit our website to learn more about how iStops work.

Parameters

key (required) your API key
stop_id (required) id of the stop (ex. IT:1 or IT)
route_id (optional) semi-colon separated list of route ids
pt (optional) preview time in minutes between 0 and 60 (30 by default)
count (optional) maximum number of departures you would like to recieve

Response

destination trip's destination stop
expected expected departure time of the bus for the given stop
expected_mins number of minutes before expected departure time
headsign information usually shown on headsign
location latitude and longitude of vehicle
is_monitored whether the vehicle is communicating
is_scheduled whether this trip was scheduled
is_istop if this trip can be boarded without a fare/pass
origin trip's origin stop
route route information for the trip
scheduled scheduled departure time of the bus for the given stop
stop_id id of the stop the bus will be at
trip trip information for the departure
vehicle_id id associated with vehicle

Sample