GET /api/mcp/activities
List activities
Section titled “List activities”GET /api/mcp/activitiesAuthorization: Bearer <api-key>Returns activities ordered by started_at descending (newest first).
Query parameters
Section titled “Query parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
sport | string | — | Filter by sport type (e.g. cycling, running) |
from | string | — | Start date YYYY-MM-DD (inclusive) |
to | string | — | End date YYYY-MM-DD (inclusive) |
limit | integer | 50 | Results per page (max 200) |
offset | integer | 0 | Pagination offset |
Response
Section titled “Response”HTTP 200
{ "activities": [ { "id": "a1b2c3d4-...", "source": "wahoo_webhook", "sport": "cycling", "sub_sport": "road", "started_at": "2025-03-15T07:30:00Z", "duration_secs": 3720, "timer_secs": 3600, "distance_meters": 48200, "elevation_gain": 420, "elevation_loss": 415, "avg_power": 205, "max_power": 820, "normalized_power": 218, "tss": 82, "intensity_factor": 0.87, "avg_hr": 148, "max_hr": 172, "avg_cadence": 88, "avg_speed": 12.98, "total_calories": 1240 } ], "total": null, "offset": 0, "limit": 50}Fields not recorded for a given activity are returned as null. total is always null (count queries are not performed on this endpoint).
Get activity
Section titled “Get activity”GET /api/mcp/activities/:idAuthorization: Bearer <api-key>Returns the full activity record including all stored fields and best_efforts.
Response
Section titled “Response”HTTP 200 — full activity object (see Activity Fields)
HTTP 404 — activity not found or belongs to another user
Examples
Section titled “Examples”# Last 10 cycling activitiescurl "https://mydatafor.life/api/mcp/activities?sport=cycling&limit=10" \ -H "Authorization: Bearer $FITREPO_API_KEY"
# Activities in Q1 2025curl "https://mydatafor.life/api/mcp/activities?from=2025-01-01&to=2025-03-31" \ -H "Authorization: Bearer $FITREPO_API_KEY"
# Single activitycurl "https://mydatafor.life/api/mcp/activities/a1b2c3d4-..." \ -H "Authorization: Bearer $FITREPO_API_KEY"