Skip to main content
GET
https://www.mtaapi.dev
/
api
/
v1
/
alerts
Get current service alerts
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://www.mtaapi.dev/api/v1/alerts', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
[
  {
    "id": "<string>",
    "routes": [
      {
        "id": "<string>",
        "shortName": "<string>",
        "longName": "<string>",
        "type": 123,
        "color": "<string>",
        "textColor": "<string>"
      }
    ],
    "stops": [
      {
        "id": "<string>",
        "name": "<string>",
        "displayName": "<string>",
        "lat": 123,
        "lon": 123,
        "parentId": "<string>"
      }
    ],
    "activePeriods": [
      {
        "start": "<string>",
        "end": "<string>"
      }
    ],
    "source": "<string>",
    "header": "<string>",
    "description": "<string>",
    "url": "<string>",
    "effect": "<string>",
    "raw": "<unknown>"
  }
]

Documentation Index

Fetch the complete documentation index at: https://mtaapi.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

The mta.alerts namespace surfaces active MTA service alerts pulled from the agency’s GTFS-Realtime alerts feed. Use mta.alerts.current to retrieve delays, planned service changes, and route suspensions for either the subway or bus network, filtered to only what’s happening right now.

mta.alerts.current(params)

Returns all active service alerts for the specified transit mode. Alerts include human-readable header and description text, affected routes, a severity classification, and the time window during which the alert applies.

Parameters

mode
string
required
The transit mode to fetch alerts for. Accepted values are 'subway' or 'bus'. Pass 'subway' to get alerts affecting subway routes, or 'bus' to get alerts affecting bus routes.

TypeScript signature

type AlertMode = 'subway' | 'bus'

interface AlertsCurrentParams {
  mode: AlertMode
}

interface ServiceAlert {
  id: string
  headerText: string
  descriptionText: string
  affectedRoutes: string[]
  severity: string
  startTime: number        // Unix timestamp (seconds)
  endTime: number | null   // null if the alert has no scheduled end
}

interface AlertsCurrentResponse {
  alerts: ServiceAlert[]
}

mta.alerts.current(params: AlertsCurrentParams): Promise<AlertsCurrentResponse>

Response fields

alerts
object[]
required
An array of active service alerts for the requested mode, ordered by startTime descending. Returns an empty array if there are no active alerts.

Severity values

The severity field uses the following string values, from least to most severe:
ValueMeaning
'INFO'General informational notice with no service impact.
'WARNING'Minor disruption; service is affected but operating.
'SEVERE'Significant disruption such as major delays or reroutes.
'NO_SERVICE'The affected route or portion of it is suspended.
'NO_SERVICE' alerts often accompany planned weekend work or emergency shutdowns. Filter on this severity value to surface outages that require riders to seek alternative routes.

Code example

import { MTA } from 'mta-js'

const mta = new MTA({ apiKey: process.env.MTA_API_KEY })

const response = await mta.alerts.current({ mode: 'subway' })

const severe = response.alerts.filter(
  (alert) => alert.severity === 'SEVERE' || alert.severity === 'NO_SERVICE'
)

for (const alert of severe) {
  console.log(`[${alert.severity}] ${alert.headerText}`)
  console.log(`Affected routes: ${alert.affectedRoutes.join(', ')}`)
  console.log(alert.descriptionText)
  console.log('---')
}

Example response

{
  "alerts": [
    {
      "id": "lmm:planned_work:127307",
      "headerText": "A trains skip Howard Beach–JFK Airport",
      "descriptionText": "Due to track maintenance, A trains will not stop at Howard Beach–JFK Airport (A27) from 11:30 PM Friday to 5 AM Monday. Take the AirTrain from Jamaica station as an alternative.",
      "affectedRoutes": ["A"],
      "severity": "WARNING",
      "startTime": 1748991000,
      "endTime": 1749214800
    },
    {
      "id": "lmm:service_change:130841",
      "headerText": "No F trains between 47–50 Sts–Rockefeller Ctr and Jay St–MetroTech",
      "descriptionText": "F trains are suspended between 47–50 Sts–Rockefeller Ctr and Jay St–MetroTech due to an emergency signal repair. Use the A, C, or E trains as alternatives.",
      "affectedRoutes": ["F"],
      "severity": "NO_SERVICE",
      "startTime": 1748994600,
      "endTime": null
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

mode
enum<string>
Available options:
subway,
bus,
lirr,
metro-north
route
string
Minimum string length: 1
stopId
string
Minimum string length: 1
includeRaw
boolean

Response

200 - application/json

Response for status 200

id
string
required
routes
object[]
required
stops
object[]
required
activePeriods
object[]
required
source
string
required
mode
enum<string>
Available options:
subway,
bus,
lirr,
metro-north
header
string
description
string
url
string
effect
string
raw
any