The Hub is now in read-only mode as we make improvements to the Hub experience. More information is available here.
09-16-2024 09:55 PM
Is there any way to get the last uploaded photos of an athlete?
Like the native strava app is doing when you visit an athlete profile.
Currently, the only way of doing this is to loop over the last activities of an athlete and call the /activity/{activity_id}/photos?size=2048 endpoint.
But of course it is long and will raise a 429 Too many requests.
Something like /athlete/photos or something would be nice but it does not seem to exist
Solved! Go to Solution.
09-17-2024 05:33 AM
I don't think there is any endpoint for the most recent photos. The only two suggestions I can make to possibly improve over what you are currently doing (or maybe this is already how you do it?):
1. Use getLoggedInAthleteActivities to retrieve the last X activities and check each result for photo_count > 0 so you're only calling the /activity/id/photos endpoint when necessary. That could reduce the number of API calls made unless the person has photos in every activity.
2. Cache the photo URLs as you get them from your webhook (assuming you have one set up). That way you can spread out the queries over time rather than try to do them all at once. Remove older entries from the cache as new ones come in. This is a bit of a grey area as the API agreement has some mixed language on whether caching is allowed. See 2.Q.xxvii and 7 in the API Agreement . From my reading, I think you are allowed to cache that information for up to a week? You could always email developers@strava to get some clarification.
09-17-2024 05:33 AM
I don't think there is any endpoint for the most recent photos. The only two suggestions I can make to possibly improve over what you are currently doing (or maybe this is already how you do it?):
1. Use getLoggedInAthleteActivities to retrieve the last X activities and check each result for photo_count > 0 so you're only calling the /activity/id/photos endpoint when necessary. That could reduce the number of API calls made unless the person has photos in every activity.
2. Cache the photo URLs as you get them from your webhook (assuming you have one set up). That way you can spread out the queries over time rather than try to do them all at once. Remove older entries from the cache as new ones come in. This is a bit of a grey area as the API agreement has some mixed language on whether caching is allowed. See 2.Q.xxvii and 7 in the API Agreement . From my reading, I think you are allowed to cache that information for up to a week? You could always email developers@strava to get some clarification.
Welcome to the Community - here is your guide to help you get started!