Skip to main content

Peloton Rides

@keeb/peloton-ridesv2026.07.18.1· 10d agoMODELS
01README

Read your Peloton workout history, per-ride metrics, and the on-demand class library via Peloton's unofficial api.onepeloton.com API. Auth0 Bearer-token auth from a vault-stored refresh token (self-renewing, access-token cached; short-lived accessToken fallback). Decomposed data model: each workout is its own addressable ride resource and each library class its own class resource, keyed by id — query with swamp data query/CEL, no list blob. Methods: getRecentRides (factory; one ride resource per workout), getRideDetail (enriches a ride in place with total/avg/max output, cadence, resistance, speed, heart rate, distance, calories, downsampled series), getStats (derived aggregate rollup), browseClasses (factory; browse the class library filtered by discipline/instructor/type/duration/difficulty, one class resource per match). No official Peloton API exists; this mirrors the web app's endpoints and may break if Peloton changes them.

02Models1
@keeb/peloton-ridesv2026.07.11.1peloton_rides.ts
fn getRecentRides()
Fetch recent Peloton workouts and store each as its own addressable `ride` resource (keyed by workout id). Preserves any previously-fetched `detail`. Query them with `swamp data list`/`data query` or CEL `data.findBySpec(<model>, "ride")`.
fn getRideDetail()
Enrich one ride in place with its full metrics (total/avg/max output, cadence, resistance, speed, heart rate, distance, calories, downsampled time series). Writes the same `ride` resource, setting its `detail`.
fn getStats()
Compute a derived aggregate rollup across recent rides (total minutes, total/avg output, PR count, discipline breakdown) — cheap, no per-ride calls
fn browseClasses()
Browse Peloton's on-demand class *library* (classes you can take, not ones you've done) and store each match as its own addressable `class` resource keyed by class id. Server-side narrows by discipline + instructor; class type / duration / difficulty filters are applied to the fetched window. Factory/fan-out: one run writes N class resources. Query with `swamp data query`/CEL.

Resources

auth(infinite)— Cached Auth0 session: rotated refresh token + current access token
ride(infinite)— A single Peloton workout — one addressable resource instance per ride (keyed by workout id); `detail` holds metrics once getRideDetail is run
stats(7d)— Derived aggregate rollup across a window of recent rides (single instance)
class(7d)— A bookable class from Peloton's on-demand library — one addressable resource per class id (catalog metadata: title, class type, duration, difficulty, instructor). Distinct from `ride`, which is a workout you completed. Written by browseClasses; query with `swamp data query`/CEL.
03Previous Versions3
2026.07.11.1

Modified 1 models

2026.07.06.2

Auth0 Bearer-token auth (self-renewing refresh token, cached access token; accessToken fallback) after Peloton retired password login. Decomposed data model: one addressable ride resource per workout, progressively enriched by getRideDetail. Verified live.

Modified 1 models

2026.07.06.1

Initial release: read-only Peloton workout access (getRecentRides, getRideDetail, getStats) via the unofficial api.onepeloton.com API.

04Stats
A
100 / 100
Downloads
0
Archive size
18.7 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
05Platforms
06Labels