stravalib
stravalib copied to clipboard
Friends segment events
I can use the get_activities method to return an array of my activities, though each one seems to have a None segment_efforts attribute. However, calling method get_activity for each array member using the activity attribute id will expose my segment_efforts within each activity.
This same process does not seem to work for get_friends_activities; when I call get_activity for each of the activities returned by get_friend_activitives, the segment_efforts attribute always comes back None.
How can I gain access to my friend's segment efforts?
It looks like you cannot retrieve segment efforts for your friends. Specifically, from the documentation: (Note that "Detailed" representation is what you can see about your own data, vs. "summary" which is what you can see about other's data.)
Summary representation attributes
The summary representation of the activity object is the same as the detailed representation, except it does NOT include these attributes:
calories
description
gear
segment_efforts
splits_metric
splits_standard
best_efforts
photos
I will look at the segment_efforts being None on actitivies; it is likely that this is only available when fetching an activity explicitly/directly (rather than in the list); however, we typically try to handle the remote query under the hood for things like this. It seems reasonable that we could do that here too -- i.e. if you are dealing with an activity from a list, we could go ahead and lazily fetch the full activity detail if/when you try to access the segment_efforts property. I will investigate further.
Appreciate the quick and thoughtful reply, I too noted the reference to the Activity segment_efforts attribute removed from summary listings after I'd posted this question. Seems odd (which you seem to concur with) as the web / mobile apps both readily support viewing your follower's activities and segment efforts.
Appreciate any update you can provide.
Brad Hontz
mTAB Evangelist Emeritus Email: [email protected] Web: http://www.mtabsurveyanalysis.com
On Thu, Oct 1, 2015 at 12:39 PM, Hans Lellelid [email protected] wrote:
It looks like you cannot retrieve segment efforts for your friends. Specifically, from the documentation https://strava.github.io/api/v3/activities/: (Note that "Detailed" representation is what you can see about your own data, vs. "summary" which is what you can see about other's data.)
Summary representation attributes The summary representation of the activity object is the same as the detailed representation, except it does NOT include these attributes:
calories description gear segment_efforts splits_metric splits_standard best_efforts photosI will look at the segment_efforts being None on actitivies; it is likely that this is only available when fetching an activity explicitly/directly (rather than in the list); however, we typically try to handle the remote query under the hood for things like this. It seems reasonable that we could do that here too -- i.e. if you are dealing with an activity from a list, we could go ahead and lazily fetch the full activity detail if/when you try to access the segment_efforts property. I will investigate further.
— Reply to this email directly or view it on GitHub https://github.com/hozn/stravalib/issues/59#issuecomment-144825768.