The Hub is now in read-only mode as we make improvements to the Hub experience. More information is available here.
07-04-2023 02:20 AM - edited 07-04-2023 02:37 AM
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!
Solved! Go to Solution.
07-04-2023 11:55 PM
I'm not sure I understand the problem. What is wrong or not direct enough with the ids in the activity list?
07-04-2023 11:56 PM
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?
07-04-2023 11:56 PM
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?
07-05-2023 01:38 AM - edited 07-05-2023 01:39 AM
@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.
07-05-2023 01:53 AM
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?
07-05-2023 02:00 AM
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.
07-04-2023 11:55 PM
I'm not sure I understand the problem. What is wrong or not direct enough with the ids in the activity list?
07-05-2023 01:38 AM
@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.
Welcome to the Community - here is your guide to help you get started!