Alerts Feed updates

93 views
Skip to first unread message

jge...@gmail.com

unread,
Jul 8, 2021, 10:51:21 AM7/8/21
to mtadeveloperresources
Howdy all,

I'm hopeful that everyone has moved onto our alerts feed. There are a few changes coming to the feed in the next month or so I wanted to make sure you were aware of.

You can sign up for an API key for free here and see the new feed - https://api.mta.info/#/landing

If you haven't been using the current feed, things that are changes:
  • This isn't a change if you've been using the current feed (which has been up for a year or so), but we are no longer displaying alerts by trunk (4/5/6). Each alert floats by line (4) (5) etc.
  • We are also moving away from the concept of "service status" -- we're starting to focus more on "alerts". So rather than "this is how the 4 train is going" it's "here are the alerts that are currently active on the 4 train". You can sorta see this on new.mta.info homepage, and we are probably moving even further in that direction (towards showing all alerts, even if there are multiple 4 train alerts).
  • If you want to stack alerts by trunk or by line, reference the sort_order field. You'll see something like MTASBWY:7:10 breaks down to agency_id: (MTASBWAY – Agency – Subway),  route_id: (7 – route id – 7 line) and the alert priority number (10 – priority – level ten priority). Lower numbers having lesser priority than higher numbers. Then just sub in the alert type.
    • So if two alerts are active on the 7 train, 10 (Planned - Boarding Change) and 18 (Dleays) you should show just Delays. You may want to show both since your viewer can't click in, but that's your call. 
Things that are changes if you've been using the current feed:
  • We've been messaging this for a while, but just a reminder the number of alert names / service statuses are expanding. You should pass it through as a text string rather than as a set of fixed values. We will be rolling out longer alert names for planned work alerts, so "Planned - Local to Express" that try to capture both the cause and the effect. If you run out of space you might want to programmatically cut "planned - ". We might be breaking "cause" and "effect" into separate fields in the future to further get in line with the GTFS-rt standard. 
  • The current feed only shows active alerts. With a coming update there will be a feed of ALL alerts, both current and active. You'll need to filter out by the timecode on the alert if you only want to show active ones.

Thanks,
Josh
Reply all
Reply to author
Forward
0 new messages