How to get athlete activities list with his/her id

6,780 views
Skip to first unread message

Yara Yaseen

unread,
Oct 24, 2015, 11:01:16 AM10/24/15
to Strava API
Hi I need to get all the athletes activities in the past 2 weeks, I have the ids, I don't want them to login again

Varun Pemmaraju

unread,
Oct 24, 2015, 3:26:45 PM10/24/15
to Yara Yaseen, Strava API
Hi Yara,


For example:

curl -G https://www.strava.com/api/v3/athletes/:id/activities -H "Authorization: Bearer ACCESS-KEY-GOES-HERE"

should give you what you want.

Best
Varun

Varun Pemmaraju
Core Software Engineer
STRAVA

On Sat, Oct 24, 2015 at 8:01 AM, Yara Yaseen <yara.y...@gmail.com> wrote:
Hi I need to get all the athletes activities in the past 2 weeks, I have the ids, I don't want them to login again

--
You received this message because you are subscribed to the Google Groups "Strava API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to strava-api+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yara Yaseen

unread,
Oct 24, 2015, 4:24:47 PM10/24/15
to Strava API
I get this message
[{"field":"path","resource":"resource","code":"invalid"}]} 

Yara Yaseen

unread,
Oct 24, 2015, 4:25:29 PM10/24/15
to Strava API
This is the full message
{"message":"Record Not Found","errors":[{"field":"path","resource":"resource","code":"invalid"}]} 


On Saturday, October 24, 2015 at 5:01:16 PM UTC+2, Yara Yaseen wrote:

Yara Yaseen

unread,
Oct 24, 2015, 4:29:11 PM10/24/15
to Strava API
Sorry my mistake, it worked thank you very much


On Saturday, October 24, 2015 at 5:01:16 PM UTC+2, Yara Yaseen wrote:

Yara Yaseen

unread,
Oct 24, 2015, 4:47:45 PM10/24/15
to Strava API
But I have another question the access token is it fixed for each user? so I can keep it and get the users data 


On Saturday, October 24, 2015 at 5:01:16 PM UTC+2, Yara Yaseen wrote:

nüfrankz x

unread,
Feb 27, 2016, 3:31:10 PM2/27/16
to Strava API
And for a normal json request via jquery to format it?

I just want to know the URL format, like path and where to put the access_token.

All I got is "{"message":"Record Not Found","errors":[{"resource":"resource","field":"path","code":"invalid"}]}".

An example please? I use https://www.strava.com/api/v3/activities/MY_USER_ID/streams?access_token=ACCESS_TOKEN

What I'm missing? Thank you.

Mathew Gordon

unread,
Feb 29, 2016, 12:04:57 PM2/29/16
to nüfrankz x, Strava API
Hello-

That structure is generally correct (except for the the fact that the path as you've written it does not exist).  Please see the docs:


Thanks!

--

Alejandro Hernández Ramos

unread,
May 26, 2016, 1:05:50 PM5/26/16
to Strava API

Hi

Which was the mistake ??


thanks

Cristian Beckert

unread,
Jan 29, 2019, 3:25:51 PM1/29/19
to Strava API
If anyone still has a problem with that, note that in the documentation, the API endpoint is:
/athlete/activities
(for getting signed in athlete's activity).

But for getting activities of an athlete using the athlete ID, the endpoint is:
/athletes/athleteId/activities
(note: athletes)

Daniel D.

unread,
Jan 29, 2019, 4:15:56 PM1/29/19
to Strava API
Were you actually able to make this work?

This appears to be an undocumented API and I get back {"message":"Authorization Error","errors":[{"resource":"Athlete","field":"access_token","code":"invalid"}]} whenever I try to do this for another user than myself.

Cristian Beckert

unread,
Jan 29, 2019, 4:38:32 PM1/29/19
to Strava API
You need to go through the OAuth steps first to get the access_token. Read more about this here: https://developers.strava.com/docs/authentication/
After that, you make the request to the API and sending the token in the headers 
'Authorization': `Bearer ${access_token}`

Daniel D.

unread,
Jan 29, 2019, 6:52:20 PM1/29/19
to Strava API
Christian,

It doesn't work for me. What scopes are you authorizing? Do you have another user ID that works? Try with mine for example, 26462176 or 26409146.

Using strava-ruby-cli modified to support /athletes/id/activities:

$ ./bin/strava  --client_id=24523 --client_secret=... --scope=activity:read_all console


...


Strava> athlete.id

=> 26462176

Strava> athlete.name

=> "Daniel Doubrovkine"

Strava> athlete_activities.count

=> 30

Strava> athlete_activities(id: 26462176).count # my id

=> 30

Strava> athlete_activities(id: 26409146).count # another user ID

Strava::Errors::Fault: Authorization Error


Thx
-dB.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages