TheDocumentation 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.
/snapshots endpoint returns per-station num_bikes_available and num_docks_available counts over a historical [since, until] window, downsampled to a configurable step cadence. It is the data source for the Flow Map’s pin-rewind feature: the frontend loads the full array once per page visit, then uses a binary search on every scrubber tick to update map pin colours without additional network requests.
Data is sourced from the same R2 parquet archive used by /trips and is immutable once written, so the worker caches aggressively at max-age=600.
Endpoint
Path parameters
The unique system identifier matching a registered network.Example:
bcycle_santabarbaraQuery parameters
Start of the query window as a Unix timestamp in seconds (inclusive).Example:
1747058100End of the query window as a Unix timestamp in seconds (inclusive). Must be greater than
since. The window must not exceed 604 800 seconds (7 days).Example: 1747144500Downsampling cadence in seconds. The worker retains at most one snapshot per
step-second bucket. Must be between 60 and 3600 seconds inclusive.- Default:
120(one snapshot every 2 minutes) - Minimum:
60 - Maximum:
3600(one per hour)
Response
Returns{ snapshots, since, until, step } with Cache-Control: max-age=600.
Downsampled array of timestamped station counts, ordered by
ts ascending.Echo of the
since query parameter as parsed by the worker.Echo of the
until query parameter as parsed by the worker.Echo of the effective
step value used for downsampling (the default 120 if not supplied).Error responses
| Status | Body | Meaning |
|---|---|---|
400 | { "error": "since and until must be unix-second integers" } | One or both params are missing or non-numeric. |
400 | { "error": "until must be greater than since" } | until ≤ since. |
400 | { "error": "window must be <= 604800 seconds (7 days)" } | Window exceeds the 7-day maximum. |
400 | { "error": "step must be between 60 and 3600 seconds" } | step is outside the valid range. |
502 | { "error": "failed to read snapshot archive" } | R2 parquet read or parse failure. |
Example request
Example response
The underlying parquet reader pads the R2 query by 1 hour on each side of
[since, until] to capture snapshots straddling partition boundaries. The worker clips the resulting array back to the exact requested window before downsampling, so all entries in snapshots satisfy since ≤ ts ≤ until.