v2 Metrics Get Athlete Metrics - TrainingPeaks/PartnersAPI GitHub Wiki
Endpoint:
- /v2/metrics/{athleteid}/{start date}/{end date}
- HTTP Method: GET
- Required Scope: metrics:read
- Input:
- Athlete ID. Required
- Start date in local time. Required.
- End date in local time. Required.
Example:
Testing:
https://api.sandbox.trainingpeaks.com/v2/metrics/123456/2022-06-01/2022-06-10
Production:
https://api.trainingpeaks.com/v2/metrics/123456/2022-06-01/2022-06-10
Example:
[
{
"MetricId":"B3AADF1C-1380-4FFE-93D5-E67C3A3491A4",
"AthleteId":123456,
"DateTime": "2022-06-01T06:12:34",
"UploadClient":"testapplication",
"WeightInKilograms":68.1,
"HRV":84.1,
"Steps":12345,
"Stress":"Low",
"SleepQuality":"Good"
},
{
"MetricId":"B3AADF1C-1380-4FFE-93D5-E67C3A3491B5",
"AthleteId":123456,
"DateTime": "2022-06-02T07:23:45",
"UploadClient":"testapplication",
"SleepHours" : 8,
"Pulse" : 45
}
]
Note:
- MetricId: string, unique id for the metrics
- AthleteId: int, TrainingPeaks athlete identifier
- DateTime: Local DateTime as recorded, without timezone qualification; truncated to the minute
- UploadClient: string
- Metrics: one or more non-null values
Note: Not every field will be returned for every metric, and new fields may be added in the future. It is recommended to check that a key exists before accessing its value.