v3 the real-time data of arrival time and departure time

64 views
Skip to first unread message

Huang Leon

unread,
Jan 2, 2018, 12:29:28 PM1/2/18
to MBTA Developers
Hello,

I am playing with the v3 API, and I would like to know the real-time data of arrival time and departure time.
However, I found the data do not match with the MBTA official website.

1. Wellington → Forest Hills


The data do not match.
In this case, I found the arrival time will match if I use "filter[direction_id]=0", but I don't know why.
What is the difference between the filter[direction_id]=0 and filter[direction_id]=Southbound?




The data also do not match.
In this case, I found some departure times are null.
The arrival times and departure times seems to be the same all the time. Is there any difference between them?


Best Regards,
Leon

Developer at MBTA

unread,
Jan 2, 2018, 1:18:52 PM1/2/18
to MBTA Developers
Hi Leon,

Looks like a few factors at work. 

You asked about direction_id 0/1 vs Northbound/Southbound. 0 and 1 are valid direction_id values. Northbound and Southbound are not, so calls that use those won't filter by direction.

You may already be aware of this, but you're getting all service at the station, not just orange line service. To filter out bus routes that begin or end at Wellington, add flter[route]=Orange.

Those bus routes are why you're seeing some null departure times. Those are trips for which Wellington is the last stop, so the vehicle arrives there and is then out of service. It doesn't depart, at least not in service on that trip.

Other than that, arrival_time and departure_time will currently be the same for most modes, but can be a little different for commuter rail, reflecting the actual expected arrival and departure times. It's possible that they'll differ for other modes in the future.

Hope this helps!

Sincerely,
developer@mbta

Huang Leon

unread,
Jan 3, 2018, 3:14:20 PM1/3/18
to MBTA Developers
Hi,

Your explanation is very clear, and it works now.
Thank you so much!

Best Regards,
Leon
Reply all
Reply to author
Forward
0 new messages