Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/samgutentag/bcycle-map/llms.txt

Use this file to discover all available pages before exploring further.

The /systems endpoint returns the complete list of registered BCycle networks and automatically identifies the system geographically closest to the requester. The worker uses Cloudflare’s cf.latitude / cf.longitude request properties to compute proximity server-side — no browser geolocation permission is needed. This endpoint powers the NetworkPicker component in the map header. The dropdown only renders when two or more systems are active in the index.

Endpoint

GET /api/systems

Parameters

None. This endpoint takes no path or query parameters.

Response

Returns { systems, nearestId } with Cache-Control: max-age=300.
systems
array
required
Complete list of system entries read from gbfs/systems-index.json in R2.
nearestId
string | null
required
The systemId of the geographically closest system to the requester, computed using an equirectangular approximation from Cloudflare’s inferred request coordinates. Returns null when:
  • Cloudflare did not provide latitude/longitude for the request (e.g., local development or a VPN exit that yields no location), or
  • The systems array is empty.

Example request

curl https://bcycle-map-read-api.developer-95b.workers.dev/api/systems

Example response

{
  "nearestId": "bcycle_santabarbara",
  "systems": [
    {
      "systemId": "bcycle_santabarbara",
      "name": "Santa Barbara BCycle",
      "gbfsUrl": "https://gbfs.bcycle.com/bcycle_santabarbara/gbfs.json",
      "rentalUrl": "https://santabarbara.bcycle.com",
      "timezone": "America/Los_Angeles",
      "centroid": [-119.698, 34.420],
      "bbox": [-119.750, 34.390, -119.650, 34.450],
      "stationCount": 24
    },
    {
      "systemId": "bcycle_boulder",
      "name": "Boulder B-cycle",
      "gbfsUrl": "https://gbfs.bcycle.com/bcycle_boulder/gbfs.json",
      "rentalUrl": "https://boulder.bcycle.com",
      "timezone": "America/Denver",
      "centroid": [-105.270, 40.015],
      "bbox": [-105.310, 39.990, -105.230, 40.040],
      "stationCount": 38
    }
  ]
}
The proximity calculation uses a cheap equirectangular approximation (good enough for cities hundreds of kilometres apart). It reads cf.latitude / cf.longitude from the incoming Cloudflare request object — no separate geolocation API call is made. If location inference is unavailable (local dev, Wrangler, some VPN configurations), nearestId will be null.
The NetworkPicker component only renders when the systems array contains two or more entries. Single-system deployments hide the picker entirely and use the sole system automatically.

Build docs developers (and LLMs) love