Stops / Routes / Recommended routes help

Skip to first unread message

Sam Pullman

Jan 2, 2022, 8:58:48 PMJan 2
to MBTA Developers
Hi MBTA, I am trying to create a query to find the recommended route between two stops. I only care about stops that have light/heavy subway rail vehicles (type=0,1). I have so far used the following queries:

Query #1
Get all routes that are of heavy/light rail type:

Query #2
Returns all stops for given route:

Query #3
For each stop, I use the following query to get the detailed stop info, like id.
stops/{place}?api_key= {API_Key} &include=connecting_stops,child_stops

But I feel like I may be stuck. My goal is to supply any two stops for any of the Subway routes I get back from query #1, and to return a recommended route between the two. For example, I want to find a way to choose Haymarket (Orange Line) and Milton (Mattapan Trolley) and get a reccomended route between the two. My ideal functionality would be a query based JSON API version of what is available through

Thank you in advance!

Developer at MBTA

Feb 15, 2022, 11:56:02 AMFeb 15
to MBTA Developers
Hi there,

We do not currently provide an API for trip planning, but there are other paid and open-source services that can do trip planning using our GTFS feeds. Google's Directions API is a straightforward pay-per-request option. OpenTripPlanner (2.0 or later) is a good open-source option, but you will need to set it up on your own servers and point it to our GTFS and GTFS-rt URLs.

Reply all
Reply to author
0 new messages