Streams
Streams is the Strava term for the raw data associated with an activity. All streams for a given activity or segment effort will be the same length and the values at a given index correspond to the same time.
Object attributes
type: | string |
data: |
array array of stream values |
series_type: |
string series type used for down sampling, will be present even if not used |
original_size: |
integer complete stream length |
resolution: |
string ‘low’, ‘medium’ or ‘high’ |
Stream types
Streams are available in 11 different types. If the stream is not available for a particular activity it will be left out of the request results.
time: | integer seconds |
latlng: | floats [latitude, longitude] |
distance: | float meters |
altitude: | float meters |
velocity_smooth: | float meters per second |
heartrate: | integer BPM |
cadence: | integer RPM |
watts: | integer watts |
temp: | integer degrees Celsius |
moving: | boolean |
grade_smooth: | float percent |
Example stream
{
"type": "latlng",
"data": [
[ 38.603734, -122.864112 ],
[ 38.608798, -122.867714 ],
[ 38.604691, -122.88178 ],
[ 38.611249, -122.890977 ],
... omitted for brevity ...
[ 38.634357, -122.874144 ],
[ 38.62268, -122.872756 ],
[ 38.611205, -122.870848 ],
[ 38.603579, -122.863891 ]
],
"series_type": "distance",
"original_size": 512,
"resolution": "low"
}
Streams represent the raw data of the uploaded file. External applications may only access this information for activities owned by the authenticated athlete.
While there are a large number of stream types, they may not exist for all activities. If a stream type does not exist for the activity, it will be ignored.
All streams for a given activity will be the same length and the values at a given index correspond to the same time. For example, the time from the time stream can be correlated to the lat/lng or watts streams.
Privacy Zones Stream requests made using a public
access_token will be cropped with the
user’s privacy zones, regardless if the requesting athlete owns the requested activity.
To fetch the complete stream data use an access_token with view_private
permissions.
Parameters
id: | integer required |
types: |
list of strings single stream type or comma-separated list of types, if the activity does not have that stream it will not be included in the response |
resolution: |
string optional low (100), medium (1000) or high (10000), default is all, indicates desired number of data points, streams will only be down sampled |
series_type: |
string relevant only if using resolution either ‘time’ or ‘distance’, default is ‘distance’, used to index the streams if the stream is being reduced |
Returns an array of unordered stream objects.
Definition
GET https://www.strava.com/api/v3/activities/:id/streams/:types
Example request
$ curl -G \
https://www.strava.com/api/v3/activities/123/streams/latlng \
-H "Authorization: Bearer 83ebeabdec09f6670863766f792ead24d61fe3f9" \
-d resolution=low
Example response
[
{
"type": "latlng",
"data": [
[ 38.603734, -122.864112 ],
[ 38.608798, -122.867714 ],
... omitted for brevity ...
[ 38.611205, -122.870848 ],
[ 38.603579, -122.863891 ]
],
"series_type": "distance",
"original_size": 512,
"resolution": "low"
},
{
"type": "distance",
"data": [
0.0,
1305.8,
... omitted for brevity ...
128136.6,
129444.1
],
"series_type": "distance",
"original_size": 512,
"resolution": "low"
}
]
A segment effort represents an attempt on a segment. This resource returns a subset of the activity streams that correspond to that effort.
All streams for a given segment effort will be the same length and the values at a given index correspond to the same time.
This resource is available for segment efforts by the authenticated athlete.
Parameters
id: | integer required |
types: |
list of strings single stream type or comma-separated list of types, if the activity does not have that stream it will not be included in the response |
resolution: |
string optional low (100), medium (1000) or high (10000), default is all, indicates desired number of data points, streams will only be down sampled |
series_type: |
string relevant only if using resolution either ‘time’ or ‘distance’, default is ‘distance’, used to index the streams if the stream is being reduced |
Returns an array of unordered stream objects.
Definition
GET https://www.strava.com/api/v3/segment_efforts/:id/streams/:types
Example request
$ curl -G \
https://www.strava.com/api/v3/segment_efforts/123/streams/latlng \
-H "Authorization: Bearer 83ebeabdec09f6670863766f792ead24d61fe3f9" \
-d resolution=low
Only distance
, altitude
and latlng
stream types are available.
Parameters
id: | integer required |
types: |
list of strings single stream type or comma-separated list of types, if the activity does not have that stream it will not be included in the response |
resolution: |
string optional low (100), medium (1000) or high (10000), default is all, indicates desired number of data points, streams will only be down sampled |
series_type: |
string relevant only if using resolution either ‘time’ or ‘distance’, default is ‘distance’, used to index the streams if the stream is being reduced |
Returns an array of unordered stream objects.
Definition
GET https://www.strava.com/api/v3/segments/:id/streams/:types
Example request
$ curl https://www.strava.com/api/v3/segments/123/streams/latlng \
-H "Authorization: Bearer 83ebeabdec09f6670863766f792ead24d61fe3f9"
distance
, altitude
and latlng
stream types are always returned.
Parameters
id: | integer required |
Returns an array of unordered stream objects.
Definition
GET https://www.strava.com/api/v3/routes/:id/streams
Example request
$ curl https://www.strava.com/api/v3/routes/14296826/streams \
-H "Authorization: Bearer 83ebeabdec09f6670863766f792ead24d61fe3f9"
Example response
[
{
"type": "latlng",
"data": [
[43.96240499998943, 11.114369999870984],
[43.96241602169922, 11.114389594048717],
... omitted for brevity ...
[43.96246041052659, 11.114477067306458],
[43.96250000005456, 11.11457999984086]
]
},
{
"type": "distance",
"data": [
0.0,
9.222209323078733
... omitted for brevity ...
32353.339870102107,
32370.98213305391
]
},
{
"type": "altitude",
"data": [
97.73514151793162,
97.42,
... omitted for brevity ...
115.21365665991632,
115.0
]
}
]