Export all workouts
Download every completed workout of your organization with sets and repetitions, within the rate limit.
This walkthrough downloads every completed workout, athlete by athlete, including each set and repetition. It uses three ideas from the concepts section: pagination, ids and rate limits.
The plan
- Load the catalogs you will need to turn ids into names (
/exercises,/metrics,/units). - List athletes with
GET /athletes. - For each athlete, list completed workouts with
GET /workouts?userId=…&limit=100. The list has no content. - Fetch each workout with
GET /workouts/{id}to get its tree.
The list is cheap and the detail is the expensive call, so fetch details only for workouts you do not already have.
Count your requests
Each workout detail is one request. With 30 requests per minute, 3,000 workouts take at least 100 minutes. Budget for it:
| Workouts | Detail requests | Minimum time |
|---|---|---|
| 1,000 | 1,000 | about 34 minutes |
| 10,000 | 10,000 | about 5 hours 40 minutes |
If you only need a metric's evolution and not the set structure, Analytics aggregates it per athlete in one request.
Narrow the export
- Filter by time:
fromandtofilter completed workouts bycompletedAt. - Filter by kind:
trainingType=vbt|jump|sprint|reaction. - Filter by exercise:
exerciseId. - Include pending workouts (assigned, not yet performed) with
status=pending.
Handle failures
A long export will meet a 429 or a transient 5xx. Wrap every call with the retry logic from Error codes, and make the job resumable: store the ids you already saved.