Skip to main content
This guide shows you how to fetch current MTA service alerts covering delays, planned work, and service changes for subway and bus. You will call mta.alerts.current(), filter the results for the routes you care about, and display the relevant messages in your application.
1

Call mta.alerts.current()

Pass a mode of 'subway' or 'bus' to retrieve alerts for that transit type. You can call both and merge the results if your application covers multiple modes.
Example response:
2

Filter alerts by route or severity

The alerts array may contain many entries. Filter it down to only the routes your users care about before displaying anything.
You can also filter by severity to surface only the most urgent alerts:
3

Display alert messages to users

Use headerText as the alert title and descriptionText for the full detail. Always show both — headerText alone may not give users enough context to act on the disruption.
4

Poll for updates

Alerts can be issued or resolved at any time. Poll mta.alerts.current() on a regular interval to keep your UI up to date.
Sixty seconds is a reasonable interval for alerts. Unlike arrival times, service alerts change less frequently, so you don’t need to poll as aggressively.

Complete example

Filtering by route

When you need alerts for multiple routes at once, extend the filter to check any route in a set:
This is useful for transit apps that let users follow several lines and want a unified alert feed across all of them.
Filter to active alerts before displaying anything. An alert with a startTime in the future is scheduled but not yet in effect, and an alert with a past endTime is resolved. Check both fields before rendering.
Alert severity levels indicate how disruptive an event is:
  • INFO — general notices, such as weekend service changes or planned work during off-peak hours
  • WARNING — moderate disruptions, such as delays or reduced service frequency
  • SEVERE — significant disruptions, such as suspended service or major reroutes
Use severity to prioritize which alerts you surface prominently in your UI. Consider showing SEVERE alerts in a banner or push notification, and INFO alerts inline with scheduled service information.