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 BCycle Map Read API is a single Cloudflare Worker (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:
https://bcycle-map-read-api.<account>.workers.dev
The web frontend reads this value from the 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.
# .env.example
VITE_API_BASE=https://bcycle-map-read-api.developer-95b.workers.dev

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:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, OPTIONS
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 use Content-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 carry Cache-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

MethodPathDescriptionCache (max-age)
GET/api/systemsRegistered networks index + nearest system300 s
GET/api/systems/:id/currentLive KV snapshot for a system60 s
GET/api/systems/:id/activityRolling activity log (events + trips)20 s
GET/api/systems/:id/tripsBulk trip archive over a date range60 s
GET/api/systems/:id/snapshotsHistorical station pin counts (rewind)600 s
GET/api/systems/:id/partitionsR2 parquet object keys for a time range60 s
GET/api/systems/:id/stations/:stationId/recentTypical hourly bike/dock profile for a station300 s
GET/api/insightsAggregated analytics events (internal, used by the Insights view)60 s
GET/api/geocodeServer-side address geocoding proxy300 s
POST/api/beaconAnalytics event ingestion— (204)
For short windows (≤ 24 hours) the /activity endpoint is cheaper than /trips — it reads a single pre-computed R2 object rather than parsing parquet partitions. Use /trips for windows up to 7 days.

Build docs developers (and LLMs) love