Get's a list of possible itineraries based on an origin and destination stop_id
.
https://developer.mtd.org/api/{version}/{format}/getplannedtripsbystops
The results provide up to three itineraries for completing the requested trip. Each itinerary contains legs which can either contain walk or service objects. Walk objects indicate a leg of the trip that will require walking. A service object indicates a leg of the trip that will require bus service.
There can be multiple service objects in a leg. This indicates an interline (i.e. A bus starts out as one route and switches to another) and means the passenger should stay on the bus! In this case both lines will show up as services on the same leg.
If itineraries
list is empty (e.g. there's no service at the time specified), you can use msg
to get more details.
key |
(required) your API key |
origin_stop_id |
(required) stop_id of the origin |
destination_stop_id |
(required) stop_id of the destination |
date |
(optional) date (YYYY-MM-DD) |
time |
(optional) time (HH:MM) |
max_walk |
(optional) Maximum allowed walking distance in miles (.1 : 1). default is .5 miles |
minimize |
(optional) minimize walking, transfers, or time. possible values are "walking", "transfers", and "time". default is "time" |
arrive_depart |
(optional) whether to plan the trip to arrive or depart at the specified time. possible values are "arrive" or "depart". default is "depart" |
start_time |
The time the itinerary will begin |
end_time |
The time the the itinerary will end |
travel_time |
The total travel time in minutes |
itinerary |
a single itinerary to complete the requested trip |
leg |
a single leg in an itinerary. this can be either riding or walking. |
walk |
a leg of the journey that requires walking. |
service |
a leg of the journey that requires riding. (see remarks for multiple services in a single leg) |
begin |
the starting point for a leg |
end |
the ending point for a leg |