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

# Find Citi Bike stations

> Use the MTA API to find nearby Citi Bike stations and check bike availability.

This guide shows how to find nearby Citi Bike stations, inspect a station, and review system alerts using the public GBFS feeds.

## 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. Find nearby stations**

Provide latitude and longitude to sort stations by distance. Radius defaults to 500 meters and is capped at 5,000 meters; results default to 20 and are capped at 100.

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

const mta = new MTA({ apiKey: process.env.MTA_API_KEY })
const stations = await mta.citiBike.stations({
  lat: 40.6923,
  lon: -73.9874,
  limit: 5,
})

for (const station of stations) {
  console.log(`${station.name} — ${station.bikesAvailable} bikes, ${station.docksAvailable} docks`)
}
```

Filter by available bicycles, docks, or e-bikes:

```typescript theme={null}
const filteredStations = await mta.citiBike.stations({
  lat: 40.6923,
  lon: -73.9874,
  minBikes: 5,
  ebike: true,
})

for (const station of filteredStations) {
  console.log(`${station.name} — ${station.ebikesAvailable} e-bikes`)
}
```

**2. Get one station**

Use a station UUID or its short name:

```typescript theme={null}
const station = await mta.citiBike.station({ id: 'JC003' })
console.log(`${station.name} — ${station.bikesAvailable} bikes available`)
```

**3. Check service alerts**

```typescript theme={null}
const alerts = await mta.citiBike.alerts()
for (const alert of alerts) {
  console.log(`${alert.summary ?? alert.id} — ${alert.description ?? ''}`)
}
```

> [!TIP]
>
> Citi Bike uses public GBFS feeds. Station availability is refreshed through the API's 30-second response cache.


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