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 /activity endpoint returns a pre-computed rolling log of bike movement events and inferred trips for the requested system. The poller appends to this log on every poll tick (approximately every 5 minutes), keeping the most recent 200 events and 50 trips. Older entries are dropped to keep the object small. This is the cheapest way to get recent trip data: the worker reads a single R2 JSON object — no parquet parsing required. For windows longer than ~24 hours, use the /trips endpoint instead.

Endpoint

GET /api/systems/:systemId/activity

Path parameters

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

Response

Returns an ActivityLog JSON object with Cache-Control: max-age=20. If no activity file exists in R2 (e.g., a brand-new system before the first poll tick), the endpoint returns an empty log with 200 OK rather than a 404.
events
array
required
Ordered list of the most recent station-level bike movement events (up to 200). Oldest entries are dropped first when the cap is reached.
trips
array
required
Ordered list of the most recent inferred end-to-end trips (up to 50). Oldest are dropped first.
inFlightFromStationId
string | null
required
Station ID of the most recent unpaired departure, when the system currently has exactly one active rider. null when no ride is in progress or the pairing was cancelled by multi-rider activity.
inFlightDepartureTs
number | null
required
Unix seconds of the in-flight departure. null when inFlightFromStationId is null.

Empty log (fallback)

When no activity file is found in R2 the response body is:
{
  "events": [],
  "trips": [],
  "inFlightFromStationId": null,
  "inFlightDepartureTs": null
}

Example request

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

Example response

{
  "events": [
    {
      "ts": 1747144500,
      "station_id": "station_012",
      "type": "departure",
      "delta": 1
    },
    {
      "ts": 1747144800,
      "station_id": "station_007",
      "type": "arrival",
      "delta": 1
    }
  ],
  "trips": [
    {
      "departure_ts": 1747144500,
      "arrival_ts": 1747144800,
      "from_station_id": "station_012",
      "to_station_id": "station_007",
      "duration_sec": 300,
      "confidence": "high"
    }
  ],
  "inFlightFromStationId": null,
  "inFlightDepartureTs": null
}
The rolling log is capped at 200 events and 50 trips. On a busy day this typically covers the last 6–24 hours. For a full 7-day window, or whenever you need more trips than the cap allows, use GET /trips.

Build docs developers (and LLMs) love