Hi there, i´m just trying out a bit the Strava API to explore whats possible. I recently stumbled across the endpoint to list all users activities. I have tried this myself, but found that there is a limit of retrieving only the last recent 200 activities. Is there any chance to litterally retrieve all activities from that user uploaded to strava? I have myself more than 2000 uploaded activities and would really like to get all of them.
Do you know if there is any chance to increase that limit or get all activities?
Solved! Go to Solution.
@jsamoochado you happen to have some url examples?
I'm currently trying to get all activities, and regardless of what I set in the page, per_page, after and before query parameters I get the same 30 activities over and over again (i have 500+ in total)
Both the queries below returns the same list of 30 activities:
Page 2 : https://www.strava.com/api/v3/athlete/activities?access_token=<token>&after=0&before=1659793661 (aug. 6 2022 - oldest returned in the first query)
I don't see any `page` or `per_page` parameters in your examples. The following should work (I just checked again on my end):
You can also add before/after parameters.
UPDATE: I made it work by omitting the per_page parameter. It now works with just the page parameter and auth header.
Thanks for you reply.
I realize that my examples above wasn't as described, sorry for that, but I did try the page and per_page parameter.
A little bit more experimenting has revealed that I can only get activities if I provide the access token as the first (!) query parameter - named access_token. And in that case, any combination of page, per_page,after and before results in the same 30 activities - regardless of the numbers i write in page and per_page.
Auth. error on:
curl https://www.strava.com/api/v3/athlete/activities?per_page=10&page=1 -H 'accept: application/json' -H 'Authorization: Bearer <token>'
curl https://www.strava.com/api/v3/athlete/activities?per_page=10&page=1&access_token=<token> -H 'accept: application/json' -H 'Authorization: Bearer <token>'
Auth ok, but always same 30 activities (the latest):
After fetching the 30 activities, I read streams for each activity using auth header, which works just fine.
@chwunder Obviously you have discovered that the per_page parameter has a maximum of 200 and the page parameter just doesn't work (at least it didn't in the last few years). We're all using the "before" and "after" parameter to get the next batches of activities. In example you get the newest 200 activities first, then the 200 activities with an "before"-Timestamp older than the oldest of the first 200 actitivities and so on.