# Mochi P.I.: live NYC-area transit for AI agents

Live departures, service alerts and planned work for the **NYC subway, MTA buses, LIRR, Metro-North, PATH, NYC
Ferry, NY Waterway, Westchester Bee-Line, Suffolk County Transit and CTtransit (Connecticut, incl. CTfastrak)**; subway
**elevator/escalator status**; **bike-share** availability (NYC, Jersey City, Hoboken); and **published timetables** for
**NJ Transit rail and light rail** (with NJ TRANSIT's advisories; live trains coming), the **Staten Island Ferry,
Seastreak and the Roosevelt Island Tram**, which have no live data. No key, no signup, no SDK: every page
is HTML and also JSON. Append `.json`, add `?format=json`, or send `Accept: application/json`.
Everything for agents lives under `https://mochipi.com/agents`; the site root is the interactive map for people.

Data comes live from each operator's public feeds, fetched by our server and cached for 20–60 seconds. Nothing here is
predicted, ranked or written by an AI. Alert text is the operator's own, unmodified.

## Start here

- **Know the place?** Search by name across every system: `https://mochipi.com/agents/search?q=<name>&format=json`
  (e.g. `q=union sq`, `q=jamaica`, `q=hoboken`, `q=5 av 42 st`). Add `&system=<system>` for more results in one
  system. Systems: subway, bus, lirr, metro-north, nj-transit, path, ferry, ny-waterway, si-ferry, seastreak, ri-tram, bee-line, suffolk, cttransit, bikes. "42nd Street" matches "42 St"; bus stop names look like "5 AV/W 42 ST".
- **Know the location?** `https://mochipi.com/agents/nearby?lat=<lat>&lon=<lon>&format=json` lists subway stations, bus stops, rail
  and PATH stations, ferry landings and bike docks within 400 m, with their **next departures** and live bike counts.
  Options: `&radius_m=` (up to 2000), `&system=subway,bus`, `&live=0` to skip departures.
- Then open a result's `url` (+ `.json`) for its full live page.

## Plan a journey

`https://mochipi.com/agents/plan.json?from=<place>&to=<place>` where a place is a station name, an NYC address or place ("Barclays
Center", "350 5th Av"), a US street address, or `lat,lon`. Options: `&step_free=1` (avoid stations without step-free
access, and subway stations with an elevator out right now), `&at=2026-09-29T08:30` (leave at; New York time;
within two days of now, either way, or a 400).
Returns up to 3 journeys (faster, or fewer changes), each with `depart`, `arrive`, `duration_min`, `changes` and `legs`:
walks (`seconds`, `meters`: estimates from straight-line distance) and rides (`system`, `route_label`, `headsign`,
`from`/`to` stations with their page `url`, `depart`/`arrive`, `stops`, and for the first ride `live_next`, the next
live departures). Rides carry the operator's `alerts` and subway `elevator_out` flags; `live_note` warns when the live
feed contradicts the timetable. Covers subway, PATH, LIRR, Metro-North, NJ Transit rail and light rail, and ferries;
buses aren't routed yet; fares aren't considered. `https://mochipi.com/agents/geocode?q=` resolves a place on its own.

## Pages

| What | URL | Returns |
|---|---|---|
| Subway station | `/agents/stations/<id-slug>` | `next_departures` (each with `direction` and `platform`); `alerts`; each elevator/escalator's `working_now`, outage reason, expected return, planned outages and the MTA's alternative route; ADA status per platform |
| Subway line | `/agents/lines/<route>` | `alert_types_now`, alerts now, planned work in the next 7 days, stations in order with elevator outages |
| Bus stop | `/agents/bus/stops/<id-slug>` | `next_departures` (route, destination sign, minutes), `serves` (route + direction), alerts |
| Bus route | `/agents/bus/routes/<route>` (e.g. `m15`, `m15-sbs`, `bx12`) | alerts now and planned, stops in order each way |
| LIRR / Metro-North / PATH station | `/agents/lirr/stations/<slug>`, `/agents/metro-north/stations/<slug>`, `/agents/path/stations/<slug>` | next departures (branch/line, destination, minutes, `delay_minutes`), alerts (none for PATH) |
| LIRR branch / Metro-North line / PATH line | `/agents/lirr/branches/<slug>`, `/agents/metro-north/lines/<slug>`, `/agents/path/lines/<slug>` | alerts now and planned, stations in order |
| Ferry landing / route | `/agents/ferry/...`, `/agents/ny-waterway/...`, `/agents/si-ferry/...`, `/agents/seastreak/...` (`stops/<id-slug>`, `routes/<slug>`) | next departures; alerts where published |
| Other buses | `/agents/bee-line/...`, `/agents/suffolk/...`, `/agents/cttransit/...` (`stops/<id-slug>`, `routes/<slug>`) | next departures; alerts |
| Roosevelt Island Tram and buses | `/agents/ri-tram/stops/<id-slug>` | scheduled departures |
| NJ Transit rail and light rail | `/agents/nj-transit/stations/<slug>`, `/agents/nj-transit/lines/<slug>` | scheduled departures; NJ TRANSIT advisories naming the station or line (`matched_by`) |
| Bike-share station | `/agents/bikes/stations/<id-slug>` | bikes, e-bikes and open docks now; renting/returning; transit within 300 m |
| System overview | `/agents` covers the subway; `/agents/<system>` for the rest (e.g. `/agents/bus`, `/agents/lirr`, `/agents/cttransit`) | every route with its alert types in effect now |
| Alerts | `/agents/alerts?system=<system>&route=<id>` | alerts in effect now and planned within 7 days |
| Where vehicles are on a line | `/map/data?system=<system>&route=<route id or slug>` (e.g. `system=subway&route=A`), or `&routes=A,C,E` for several | `stations` (with lat/lon), `patterns` (the line's branches as station-ID lists), and `vehicles`, each with `pattern`, `position` (index along that pattern; 2.5 = halfway between its 3rd and 4th station), `heading` (1 = toward the pattern's last station), `status` (stopped/moving/approaching/waiting), `next_stop`, `seconds_to_next`, `destination`. People: the live map at `/` |
| Elevators | `/agents/elevators` | every subway elevator/escalator out of service now, and planned outages |

Subway routes: `A`, `C`, `E`, `B`, `D`, `F`, `FX`, `M`, `G`, `J`, `Z`, `L`, `N`, `Q`, `R`, `W`, `GS`, `FS`, `H`, `1`, `2`, `3`, `4`, `5`, `6`, `6X`, `7`, `7X`, `SI`
(`GS` = 42 St Shuttle, `FS` = Franklin Av Shuttle, `H` = Rockaway Park Shuttle, `SI` = Staten Island Railway).

## How to read it

- Every stop page has the same core: `system`, `id`, `name`, `url`, `routes` (each `{id, label, url}`), `location`,
  `next_departures` (each: `route`, `route_label`, `destination`, `departs`, `minutes`, plus `direction`/`platform` on the
  subway, `track`/`status`/`delay_minutes` on rail, `crowding` on MTA buses, `scheduled` for timetable times), `alerts`,
  `freshness`, `feed_errors`, `notes`.

- `freshness` on every response: `as_of` is the feed's own timestamp and `fetched_from_source` is when our server fetched
  it. If a `note` appears, the data may not be real time: say so to the user.
- An empty alert list means the operator has no active alert, not a guarantee of normal service. An omitted `alerts`
  field means alerts aren't available for that system (PATH).
- Departure times are live predictions and shift minute to minute; allow a margin. `delay_minutes` is the operator's own
  delay figure, where given.
- `"scheduled": true` marks a **timetable** time, not a live prediction (NJ Transit for now, Staten Island Ferry,
  Seastreak, Roosevelt Island Tram): delays and cancellations are not reflected. Tell the user it's the schedule, and
  check the advisories.
- NJ TRANSIT advisories carry no station or line IDs; they're attached where their text names the station or line
  (`matched_by`). The full list is on `/agents/nj-transit` and `/agents/alerts?system=nj-transit`.
- LIRR and Metro-North departures include `track` once the railroad posts it, and Metro-North a `status` ("On-Time",
  "Late", "Departed"). MTA buses include `crowding` ("Many seats available", "Standing room only") when the bus reports it.
- Bus stops are one per direction: check `serves` for which way a stop goes.
- Times are New York local time with a UTC offset (ISO 8601). Distances in `/agents/nearby` are straight-line, not walking.
- When citing, link the HTML page (the `url`) so the user can check it.

## Not covered

NJ Transit buses and live NJ Transit trains (pending API access), Amtrak, Nassau NICE buses, AirTrain, and bus
routing in journey plans. 

## Sources

- MTA (subway, buses, LIRR, Metro-North): data obtained from the MTA's public data feeds and redistributed through our
  own server. Not affiliated with or endorsed by the MTA; neither the MTA nor we guarantee the data is accurate,
  complete or timely.
- PATH arrival times come from the open community feed path.transitdata.nyc, which republishes the Port Authority's real-time data; station and line names come from PATH's GTFS schedule. Not affiliated with or endorsed by the Port Authority. Not guaranteed accurate, complete or timely. PATH service alerts are not included.
- Ferry data from NYC Ferry's public developer feeds, redistributed through our own server. Not affiliated with or endorsed by NYC Ferry. Not guaranteed accurate, complete or timely.
- Bike share availability comes from NYC Bike Share, LLC's public system data (GBFS), used under its data license. Not affiliated with, approved, endorsed or sponsored by NYC Bike Share or its sponsors.
- NJ Transit times are the published schedule from NJ TRANSIT's public GTFS (live train data is not connected yet, so delays and cancellations are not shown); advisories are NJ TRANSIT's own, from its public RSS feeds, unmodified. NJ TRANSIT data is provided as-is and is not to be relied on for any commercial purpose. Not affiliated with or endorsed by NJ TRANSIT.
- Ferry data from NY Waterway's public GTFS and real-time feeds, redistributed through our own server. Not affiliated with or endorsed by NY Waterway. Not guaranteed accurate, complete or timely.
- Staten Island Ferry times are the published schedule from NYC DOT's GTFS (NYC Open Data); no live data exists for this ferry, so delays and cancellations are not shown. Not affiliated with or endorsed by NYC DOT.
- Seastreak times are the published schedule from its GTFS; no live data is available, so delays and cancellations are not shown. Not affiliated with or endorsed by Seastreak.
- Roosevelt Island Tram and bus times are the published schedule (RIOC's GTFS); no live data exists. Not affiliated with or endorsed by RIOC.
- Bee-Line schedules from 511NY (OPEN-NY terms) and live predictions from Westchester County's public transit API, shown to help riders use the Bee-Line. Not affiliated with or endorsed by Westchester County. Not guaranteed accurate, complete or timely.
- Suffolk County Transit schedules and live predictions from its public GTFS feeds. Not affiliated with or endorsed by Suffolk County. Not guaranteed accurate, complete or timely.
- CTtransit and CTfastrak schedules and live predictions from CTtransit's public GTFS feeds, used under its data terms. Not affiliated with or endorsed by CTtransit or CTDOT. Not guaranteed accurate, complete or timely.
