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 /partitions endpoint lists the Cloudflare R2 object keys for station_status parquet partitions that overlap a requested time range. It is used by the Explore view’s DuckDB-WASM integration: the browser calls this endpoint first to discover which parquet files exist for a given window, then fetches those files directly from R2’s public URL to run SQL queries client-side.

Endpoint

GET /api/systems/:systemId/partitions

Path parameters

systemId
string
required
The unique system identifier matching a registered network.Example: bcycle_santabarbara

Query parameters

from
integer
default:"0"
Start of the filter window as a Unix timestamp in seconds. The worker includes partitions whose inferred hour timestamp is ≥ from - 3600 (one-hour pad).Defaults to 0 (include all partitions from the beginning of the archive).
to
integer
default:"now"
End of the filter window as a Unix timestamp in seconds. The worker includes partitions whose inferred hour timestamp is ≤ to + 3600 (one-hour pad).Defaults to the current server time.

Response

Returns { keys } sorted lexicographically (which is also chronological, given the key format) with Cache-Control: max-age=60.
keys
array
required
Sorted array of R2 object key strings. Each key follows the pattern:
gbfs/{systemId}/station_status/dt=YYYY-MM-DD/HH.parquet
The dt= date and two-digit hour together encode the UTC hour that the partition covers.Example entry: gbfs/bcycle_santabarbara/station_status/dt=2026-05-13/14.parquet

Example requests

# All partitions ever archived for a system
curl "https://bcycle-map-read-api.developer-95b.workers.dev/api/systems/bcycle_santabarbara/partitions"

# Partitions covering a specific 24-hour window
curl "https://bcycle-map-read-api.developer-95b.workers.dev/api/systems/bcycle_santabarbara/partitions?from=1747058100&to=1747144500"

Example response

{
  "keys": [
    "gbfs/bcycle_santabarbara/station_status/dt=2026-05-12/13.parquet",
    "gbfs/bcycle_santabarbara/station_status/dt=2026-05-12/14.parquet",
    "gbfs/bcycle_santabarbara/station_status/dt=2026-05-12/15.parquet",
    "gbfs/bcycle_santabarbara/station_status/dt=2026-05-13/13.parquet",
    "gbfs/bcycle_santabarbara/station_status/dt=2026-05-13/14.parquet"
  ]
}
The worker applies a ±1-hour pad when filtering by timestamp. This ensures that partitions straddling the boundary of your requested range are included — the same padding used by the /trips and /snapshots endpoints when they read the same files.
R2 list returns at most 1000 keys per call. The worker pages through all results using the continuation cursor, so the full key list is always returned even for systems with large archives.

Build docs developers (and LLMs) love