Commuter Rail Schedules vs. Predictions

Skip to first unread message

Dave Platt

Nov 18, 2020, 9:07:45 AM11/18/20
to MBTA Developers

I'm writing a better commuter rail schedule app. Question: when a scheduled train is late or cancelled, does that change ever appear in the /schedules, or only in the /predictions?

Or to put it another way, if I fetch the schedule for a commuter rail line first thing in the morning, is that data guaranteed not to change, regardless of the performance of the line? And any changes to the actual performance then reflected in predictions?  Thanks.  

Developer at MBTA

Dec 1, 2020, 4:56:23 PM12/1/20
to MBTA Developers
Hello and welcome!

You have the right idea: `/schedules` represent planned service, and `/predictions` are real-time updates informed by vehicle tracking and other data sources. Anything "unplanned", such as a train running late, will only be reflected in predictions and not schedules. For the Commuter Rail in particular, note that the specific platform a train will depart from or arrive at is typically "unplanned".

There are no particular guarantees about when schedule data can change, but it is rare for a given day's schedule to change during that day. You can efficiently update your local copy of the data whenever you need to by using `If-Modified-Since`, as described in our Best Practices (section: Caching). If nothing has changed since the last time you checked, you will get a tiny "not modified" response and the request will not count against your rate limit.

Let us know if you have any further questions!

Reply all
Reply to author
0 new messages