Skip to main content
GET
/
bikes
/
nearby
/
{
  "400": {},
  "stations": [
    {
      "station_id": "<string>",
      "name": "<string>",
      "lat": 123,
      "lon": 123,
      "num_bikes_available": 123,
      "num_docks_available": 123,
      "capacity": 123,
      "is_installed": true,
      "is_renting": true,
      "is_returning": true,
      "last_reported": 123,
      "distance": 123,
      "brand": "<string>",
      "api_type": "<string>"
    }
  ],
  "dockless_bikes": [
    {
      "bike_id": "<string>",
      "lat": 123,
      "lon": 123,
      "is_reserved": true,
      "is_disabled": true,
      "vehicle_type": "<string>",
      "distance": 123,
      "brand": "<string>",
      "provider": "<string>"
    }
  ],
  "metadata": {
    "total_stations": 123,
    "total_dockless": 123,
    "providers": [
      {}
    ]
  }
}

Overview

Get real-time bike availability data near a location. Returns both station-based bikes (docked) and dockless bikes from various bike-share providers including Citi Bike, Lime, Spin, and others. This is a production-ready wrapper around GBFS (General Bikeshare Feed Specification) feeds with near-real time updates, optimized for low-latency queries and high availability.

Authentication

This endpoint requires Auth0 authentication. Include your access token in the Authorization header:
Authorization: Bearer YOUR_AUTH0_ACCESS_TOKEN

Query Parameters

latitude
number
required
User’s latitude (-90 to 90). Can also use lat as parameter name.
longitude
number
required
User’s longitude (-180 to 180). Can also use lon or lng as parameter name.
radius
number
default:"1000"
Search radius in meters (default: 1000m)
limit
number
default:"200"
Maximum number of results per category (stations and dockless bikes)

Response

stations
array
Array of bike station objects (docked bikes)
dockless_bikes
array
Array of dockless bike objects
metadata
object
Metadata about the response

Request Example

cURL
curl "https://api.cyclemate.com/bikes/nearby/?latitude=40.7589&longitude=-73.9851&radius=500" \
  -H "Authorization: Bearer YOUR_AUTH0_ACCESS_TOKEN" \
  -H "Content-Type: application/json"
JavaScript
const response = await fetch(
  'https://api.cyclemate.com/bikes/nearby/?latitude=40.7589&longitude=-73.9851&radius=500',
  {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_AUTH0_ACCESS_TOKEN',
      'Content-Type': 'application/json',
    },
  }
);

const bikes = await response.json();
console.log(`Found ${bikes.stations.length} stations and ${bikes.dockless_bikes.length} dockless bikes`);
Python
import requests

url = "https://api.cyclemate.com/bikes/nearby/"
headers = {
    "Authorization": "Bearer YOUR_AUTH0_ACCESS_TOKEN"
}
params = {
    "latitude": 40.7589,
    "longitude": -73.9851,
    "radius": 500
}

response = requests.get(url, headers=headers, params=params)
data = response.json()
stations = data["stations"]
dockless = data["dockless_bikes"]

Response Example

{
  "stations": [
    {
      "station_id": "3639",
      "name": "W 52 St & 11 Ave",
      "lat": 40.76727216,
      "lon": -73.99392888,
      "num_bikes_available": 12,
      "num_docks_available": 27,
      "capacity": 39,
      "is_installed": true,
      "is_renting": true,
      "is_returning": true,
      "last_reported": 1699564800,
      "distance": 245.8,
      "brand": "Citi Bike",
      "api_type": "gbfs"
    }
  ],
  "dockless_bikes": [
    {
      "bike_id": "lime_123abc",
      "lat": 40.7589,
      "lon": -73.9851,
      "is_reserved": false,
      "is_disabled": false,
      "vehicle_type": "bike",
      "distance": 50.2,
      "brand": "Lime",
      "provider": "lime"
    },
    {
      "bike_id": "spin_456def",
      "lat": 40.7592,
      "lon": -73.9848,
      "is_reserved": false,
      "is_disabled": false,
      "vehicle_type": "bike",
      "distance": 75.3,
      "brand": "Spin",
      "provider": "spin"
    }
  ],
  "metadata": {
    "total_stations": 1,
    "total_dockless": 2,
    "providers": ["Citi Bike", "Lime", "Spin"]
  }
}

Supported Providers

Cyclemate aggregates data from multiple bike-share providers:
  • Docked Systems: Citi Bike (NYC), Bay Wheels (SF), Divvy (Chicago), TfL Cycle Hire (London), and many more GBFS-compliant systems
  • Dockless Systems: Lime, Spin, Jump, and other free-floating bike providers

Notes

  • Bike availability data is cached and updated every 30-60 seconds
  • Results are ordered by distance from the query location
  • The limit parameter applies separately to stations and dockless bikes
  • Distance is calculated using the Haversine formula (great-circle distance)
  • Only operational bikes/stations are returned (excludes disabled or out-of-service items)

Data Freshness

  • Stations: Updated every 30-60 seconds from GBFS feeds
  • Dockless Bikes: Updated every 60 seconds from provider APIs
  • Check the last_reported timestamp for station data freshness

Error Responses

400
object
Invalid coordinates
{
  "error": "latitude and longitude query parameters are required"
}
400
object
Invalid coordinate values
{
  "error": "Invalid latitude/longitude values"
}