Skip to main content
← Home

API Docs

Real-time NYC subway arrival times. No authentication required.

Quick Start

  1. Search for a station: GET /api/search?q=72+st+q
  2. Get arrivals using the returned slug: GET /api/stops/72-st-n-q-r/lines/q

REST Endpoints

GET/api

Discovery endpoint. Lists all available endpoints and tips.

GET/api/search?q={query}

Search stations and routes by name. Returns matching stations with slugs, route lists, and a suggested arrivals URL when both a station and route match.

qSearch query (required)

Example: /api/search?q=union+square

GET/api/stops

List all stations, optionally filtered by route.

routeFilter by route slug, e.g. q (optional)

GET/api/stops/{stationSlug}realtime

Realtime arrivals for all routes at a station. Returns uptown/downtown arrivals and a per-route breakdown.

Example: /api/stops/14-st-union-sq

GET/api/stops/{stationSlug}/lines/{routeSlug}realtime

Realtime arrivals for a specific route at a station. The most precise endpoint.

Example: /api/stops/72-st-n-q-r/lines/q

GET/api/lines

List all subway routes with station counts and colors.

GET/api/lines/{routeSlug}realtime

Next arrival at every station on a route. Each station includes next_uptown and next_downtown with minutes_away.

Example: /api/lines/q

GET/api/trips/{tripId}?route={routeSlug}realtime

Track a specific train. Returns every stop on the trip with arrival times, station names, and minutes_away. Get trip IDs from any arrivals endpoint.

routeRoute slug (required), e.g. q

Example: /api/trips/051800_Q..N03R?route=q

Response Format

All JSON responses use this envelope:

{
  "ok": true,
  "data": { ... },
  "_meta": {
    "timestamp": "2025-01-01T00:00:00.000Z",
    "endpoint": "/api/...",
    "realtime": true
  }
}

Errors return:

{
  "ok": false,
  "error": { "code": "NOT_FOUND", "message": "..." },
  "_meta": { ... }
}

Slugs

Use /api/search to find slugs — don't guess them.

Stations: 14-st-union-sq, 72-st-n-q-r, times-sq-42-st, fulton-st

Routes: a, q, 7, si, gs (always lowercase)

MCP Server

For AI agents that support the Model Context Protocol, connect directly via Streamable HTTP:

POST https://nyc-subway-status.com/mcp

Tools

search_subway

Search stations and routes by name. Start here.

Input: { "query": "72 st q" }

get_arrivals

Realtime arrivals for a route at a station.

Input: { "station_slug": "72-st-n-q-r", "route_slug": "q" }

get_station_arrivals

Realtime arrivals for all routes at a station.

Input: { "station_slug": "14-st-union-sq" }

list_stations

List all stations. Optional route filter.

Input: { "route_slug": "q" }

list_routes

List all 29 subway routes.

Input: {}

get_trip

Track a specific train by trip ID. Returns every stop with arrival times.

Input: { "trip_id": "051800_Q..N03R", "route_slug": "q" }

Client Configuration

Claude Desktop, Cursor, Windsurf, and other MCP-compatible clients:

{
  "mcpServers": {
    "nyc-subway": {
      "url": "https://nyc-subway-status.com/mcp"
    }
  }
}

For stdio-only clients, use the mcp-remote bridge:

{
  "mcpServers": {
    "nyc-subway": {
      "command": "npx",
      "args": ["-y", "mcp-remote",
        "https://nyc-subway-status.com/mcp"]
    }
  }
}

Tips

Machine-Readable

/llms.txt — Plain text API guide for LLMs

/api — JSON discovery endpoint