Finding stop by station

63 views
Skip to first unread message

Jacky Boot

unread,
Apr 24, 2022, 7:02:57 PMApr 24
to MBTA Developers
Hello! I am trying to find a stop by the name of the station.
Currently I am using :
What am I doing wrong?
Thanks!

Developer at MBTA

unread,
May 13, 2022, 3:20:30 PMMay 13
to MBTA Developers
Hi there, 

The answer to your question depends on exactly what you're trying to do. 

If you're trying to query all stops associated with a station, then that can be provided through our API endpoint of /stops/{station_id}?include=child_stops, given that you know the stop id of the station. Hence, instead of querying by name, you query by stop_id of that station, followed by including its associated child stops (e.g. - for Copley station, the stop id for that station is `place-coecl`, thus you query /stops/place-coecl?include=child_stops for all the stops associated with that station). 

 On the other hand, if you want to just query by station name for the stop id of that station in particular, we don't support that currently. You would have to query all the stations, for example, with /stops?filter[route_type]=0 and then filter by the name on the client side. 

 -Developer@MBTA

Reply all
Reply to author
Forward
0 new messages