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 | 20 | Results per page (max 100) |
offset | integer | 0 | Pagination offset |
Response
Section titled “Response”HTTP 200
[ { "id": "a1b2c3d4-...", "name": "Morning Ride", "sport_type": "cycling", "started_at": "2025-03-15T07:30:00Z", "duration_s": 3720, "moving_time_s": 3600, "distance_m": 48200, "elevation_gain_m": 420, "avg_power_w": 205, "normalized_power_w": 218, "max_power_w": 820, "intensity_factor": 0.87, "tss": 82, "avg_hr_bpm": 148, "max_hr_bpm": 172 }]Fields not present in an activity are omitted from the response (not returned as null).
Get activity
Section titled “Get activity”GET /api/mcp/activities/:idAuthorization: Bearer <api-key>Returns the full activity record including all 25+ 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"