The BCycle Map Read API is a single Cloudflare Worker (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.
bcycle-map-read-api) that handles every /api/* route for the live map and analytics dashboard. All endpoints return JSON, require no authentication, and include Access-Control-Allow-Origin: * so they can be called from any origin.
Base URL
The worker is deployed at:VITE_API_BASE environment variable (set in .env / Cloudflare Pages settings). Local development proxies requests through Vite’s dev server, so VITE_API_BASE can be left empty to use the proxy.
Authentication
None. All endpoints are public. Sensitive credentials (e.g.,GOOGLE_MAPS_API_KEY) are stored as Worker secrets and never exposed in responses.
CORS
Every response includes:OPTIONS preflight requests are answered with 204 No Content and a Access-Control-Max-Age: 86400 header. The /api/beacon endpoint additionally allows content-type in preflight.
Response format
All responses useContent-Type: application/json. Error bodies follow the shape { "error": "<message>" }. HTTP status codes mirror standard semantics (200 success, 400 bad request, 404 not found, 429 rate limited, 502 upstream failure).
Caching
Responses carryCache-Control: max-age=N headers so Cloudflare’s edge and browser caches can serve repeat requests without hitting the Worker. The table below shows the max-age per route.
Edge cache + polling interval combine. For example,
/current has max-age=60 and the poller runs every ~5 minutes, so data you receive may be up to 65 seconds behind the latest poll tick.Endpoint index
| Method | Path | Description | Cache (max-age) |
|---|---|---|---|
GET | /api/systems | Registered networks index + nearest system | 300 s |
GET | /api/systems/:id/current | Live KV snapshot for a system | 60 s |
GET | /api/systems/:id/activity | Rolling activity log (events + trips) | 20 s |
GET | /api/systems/:id/trips | Bulk trip archive over a date range | 60 s |
GET | /api/systems/:id/snapshots | Historical station pin counts (rewind) | 600 s |
GET | /api/systems/:id/partitions | R2 parquet object keys for a time range | 60 s |
GET | /api/systems/:id/stations/:stationId/recent | Typical hourly bike/dock profile for a station | 300 s |
GET | /api/insights | Aggregated analytics events (internal, used by the Insights view) | 60 s |
GET | /api/geocode | Server-side address geocoding proxy | 300 s |
POST | /api/beacon | Analytics event ingestion | — (204) |