Get activity streams
GET
/api/v1/activities/{activityId}/streams
const url = 'http://localhost:8080/api/v1/activities/activity-9756441741/streams';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:8080/api/v1/activities/activity-9756441741/streams \ --header 'Authorization: Bearer <token>'Returns the streams of an activity: its time-series data, one array per metric. The arrays line up by index, so the n-th value of every stream belongs to the same moment
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”activityId
required
string
The prefixed activity identifier, activity- included.
Responses
Section titled “Responses”The streams of the activity.
Media typeapplication/json
object
timeInSeconds
required
Seconds since the start of the activity.
Array<integer> | null
distanceInMeter
required
Distance covered since the start, in meters.
Array<number> | null
latLng
required
[latitude, longitude] pairs. A point without a GPS fix is null.
Array<Array<number> | null> | null
altitudeInMeter
required
Array<number> | null
velocityInMeterPerSecond
required
Array<number> | null
heartRate
required
Beats per minute.
Array<integer> | null
cadence
required
Revolutions or steps per minute.
Array<integer> | null
powerInWatts
required
Array<integer> | null
temperatureInCelsius
required
Array<number> | null
moving
required
Whether the athlete was moving at that moment.
Array<boolean> | null
gradeInPercent
required
Array<number> | null
Example
{ "timeInSeconds": [ 0, 1, 2 ], "distanceInMeter": [ 0, 4.1, 8.3 ], "latLng": [ [ 51.2, 3.18 ], [ 51.2001, 3.1802 ] ], "altitudeInMeter": [ 10.5, 11, 11.5 ], "velocityInMeterPerSecond": [ 8.1, 8.3, 8.2 ], "heartRate": [ 120, 121, 122 ], "cadence": [ 80, 81, 82 ], "powerInWatts": [ 200, 210, 220 ], "temperatureInCelsius": [ 20, 20, 21 ], "moving": [ true, true, false ], "gradeInPercent": [ 0.5, 1.2, 1.1 ]}The Authorization header was missing, malformed, or did not match the configured key.
Media typeapplication/json
Every error uses this shape.
object
error
required
A stable, machine readable code.
string
message
required
string
Examples
ExampleinvalidToken
{ "error": "invalid_token", "message": "A valid API token is required. Send it in the Authorization header as a Bearer token."}Headers
Section titled “Headers”WWW-Authenticate
string
No activity with this identifier exists.
Media typeapplication/json
Every error uses this shape.
object
error
required
A stable, machine readable code.
string
message
required
string
Examples
ExampleunknownActivity
{ "error": "not_found", "message": "Activity \"activity-1\" not found"}