cancel
Showing results for 
Search instead for 
Did you mean: 

Get a list of activity ID

Eric_Greenpt
Shkhara

Hi all.

Using a get on https://www.strava.com/api/v3/activities/, I get a list of activities.

I realised that each activity in the json response is a summary of the activities, because "resource_state" : 2,

So I tried to tried to get the detailed representation.

Which you can get using /activities/{id}.

But for that, you need the ID.

OF course, I can get the ID from the first query, and then re-query using the ID, but I'm wondering if there is not a simpler way.

For instance a way to get a list of ID directly, and then using that list to get the detailled representation.

Thanks for any hint!

 

 

2 ACCEPTED SOLUTIONS

Jan_Mantau
Denali

I'm not sure I understand the problem. What is wrong or not direct enough with the ids in the activity list?

View solution in original post

Lovro
Shkhara

But isn't the first query exactly what you need? You get a list of activities with IDs with some additional data. What would be different if you would get a list of only IDs?

View solution in original post

6 REPLIES 6

Lovro
Shkhara

But isn't the first query exactly what you need? You get a list of activities with IDs with some additional data. What would be different if you would get a list of only IDs?

@Lovroyes, I have all I need, but I was wondering if there was a way to avoid having the additional data at first, as all of it will be duplicated when I query per ID.

Just ignore the data in the first (list) query and use only IDs. Then only use data from the activity details and there will be no duplicates.

I understand that some data is received twice but that doesn't really matter does it? Do you have a very limited/slow connection where you must count every byte of the payload?

Yes, that's what I do, I ignore the data and focus on the ID, then I re-run the query using the ID.

I think it does matter to avoid wasting resources, which is why I asked.

I'm not particularly affected by the duplication of the data downloaded, but in the end, when millions of user query the API and get duplicate data that has to be thrown away before being re-downloaded, this is silly.

 

Jan_Mantau
Denali

I'm not sure I understand the problem. What is wrong or not direct enough with the ids in the activity list?

@Jan_Mantauyes, the first query gives me all I need, but a lot more also, that will be duplicated after I query per ID, so I was wondering if there was a way to not have that many duplicated data.