Skip to main content
Solved

Get a list of activity ID


Forum|alt.badge.img+6

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!

 

 

Best answer by Jan_Mantau

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

View original
Did this topic help you find an answer to your question?

6 replies

Jan_Mantau
Superuser
Forum|alt.badge.img+26
  • Superuser
  • 944 replies
  • Answer
  • July 5, 2023

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


Lovro
Forum|alt.badge.img+3
  • Hub Starter
  • 7 replies
  • July 5, 2023

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?


Forum|alt.badge.img+6
  • Author
  • Hub Rookie
  • 6 replies
  • July 5, 2023

@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.


Forum|alt.badge.img+6
  • Author
  • Hub Rookie
  • 6 replies
  • July 5, 2023

@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.


Lovro
Forum|alt.badge.img+3
  • Hub Starter
  • 7 replies
  • July 5, 2023

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?


Forum|alt.badge.img+6
  • Author
  • Hub Rookie
  • 6 replies
  • July 5, 2023

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.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept, you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings