> ## 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 PATH train arrivals

> Use the MTA API to find live PATH arrivals and New Jersey station routes.

This guide shows how to list New Jersey PATH stations and retrieve live arrivals from the PANYNJ RidePATH 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. Choose a New Jersey station**

The PATH API includes these New Jersey stations: Newark (`NWK`), Harrison (`HAR`), Journal Square (`JSQ`), Grove Street (`GRV`), Newport (`NEW`), Exchange Place (`EXP`), and Hoboken (`HOB`). New York stations are not included.

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

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

for (const station of stations) {
  console.log(`${station.name} (${station.id})`)
}
```

**2. Request live arrivals**

Use a station code, route, and direction to filter the realtime arrival feed. Directions accept `to-ny`/`east` and `to-nj`/`west`.

```typescript theme={null}
const arrivals = await mta.path.arrivals({ station: 'JSQ', direction: 'to-ny' })

for (const arrival of arrivals) {
  console.log(
    `${arrival.route.shortName ?? arrival.route.id} — ${arrival.stop.displayName ?? arrival.stop.name ?? arrival.stop.id} — ${arrival.minutes} min`,
  )
}
```

Each arrival includes its route and stop, direction, estimated arrival time, minutes until arrival, and data source. The response is refreshed from the live RidePATH feed.

**3. Explore route patterns**

List PATH routes and retrieve the ordered New Jersey stations served by a route:

```typescript theme={null}
const routes = await mta.path.routes()

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

const routeStations = await mta.path.routeStations({ route: 'JSQ-33' })

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

The route-stations response includes eastbound and westbound station sequences. Add `?direction=east` or `?direction=west` to return one direction.

> [!TIP]
>
> PATH requests use the same API key authentication, metering, quotas, and plan limits as other MTA API requests. See the [API reference](https://mtaapi.dev/docs/api-reference/overview.md) for authentication details.


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