Skip to main content

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

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.


Reply