> ## 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.

# Get live NYC Ferry arrivals

> Use the MTA API to list NYC Ferry stops and retrieve live vessel arrivals.

This guide shows how to list NYC Ferry routes and stops, and retrieve arrivals from the public GTFS-Realtime feed.

## Prerequisites

* Install `mta-js` with `npm install mta-js`.
* Set `MTA_API_KEY` in your environment.
* Requires `mta-js` 2.4.0 or later.

**1. Explore NYC Ferry stops and routes**

The static endpoints are built from NYC Ferry's public GTFS feed:

```typescript theme={null}
import { MTA } from 'mta-js'

const mta = new MTA({ apiKey: process.env.MTA_API_KEY })
const stops = await mta.nycFerry.stops()
const routes = await mta.nycFerry.routes()

for (const stop of stops) {
  console.log(`${stop.name} (${stop.id})`)
}

for (const route of routes) {
  console.log(`${route.shortName ?? route.id} — ${route.longName ?? route.id}`)
}
```

You can also request the ordered stops for one route:

```typescript theme={null}
const routeStops = await mta.nycFerry.routeStops({ route: 'ER' })

for (const direction of routeStops.directions) {
  console.log(`${direction.direction}: ${direction.stops.map((stop) => stop.name).join(' → ')}`)
}
```

**2. Request live arrivals**

Filter realtime trip updates by stop, route, or both:

```typescript theme={null}
const arrivals = await mta.nycFerry.arrivals({ stop: '17', limit: 5 })

for (const arrival of arrivals) {
  console.log(
    `${arrival.route.shortName ?? arrival.route.id} — ${arrival.headsign ?? arrival.destination ?? arrival.direction} — ${arrival.minutes} min`,
  )
}
```

The optional `stop` accepts a stop ID or an exact stop name, matched without case sensitivity, such as `87` or `Wall St/Pier 11`.

Arrival records include static stop and route names, trip headsigns, estimated arrival time, and minutes until arrival.

**3. Check vehicles and service alerts**

Vehicle positions can be filtered by route. Alerts are listed from the separate alert feed:

```typescript theme={null}
const vehicles = await mta.nycFerry.vehicles({ route: 'ER' })
for (const vehicle of vehicles) {
  console.log(`${vehicle.route.shortName ?? vehicle.route.id} — ${vehicle.lat}, ${vehicle.lon}`)
}

const alerts = await mta.nycFerry.alerts()
for (const alert of alerts) {
  console.log(`${alert.header ?? alert.id} — ${alert.description ?? ''}`)
}
```

> [!TIP]
>
> NYC Ferry static stops and routes are opt-in in the shared `/stops`, `/stops/near`, and `/routes` endpoints. Add `nyc-ferry` to the `modes` query parameter; omitted `modes` continues to return subway and bus only.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.