Get's a list of possible itineraries based on an origin and destination latitude and longitude.
https://developer.mtd.org/api/{version}/{format}/getplannedtripsbylatlon
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.
Although this method will accept any valid latitude/longitude coordinates it will only return meaningful results for coordinates near our service area.
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_lat |
(required) latitude of the origin (-90 : 90) |
origin_lon |
(required) longitude of the origin (-180 : 180) |
destination_lat |
(required) latitude of the destination (-90 : 90) |
destination_lon |
(required) longitude of the destination (-180 : 180) |
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 |