Gear details for activity list

224 views
Skip to first unread message

Dave Pier

unread,
Oct 21, 2015, 3:58:42 PM10/21/15
to Strava API
I was hoping to be able to retrieve a list of activities from a user and then segment them by their gear to say things like "you have ridden 200 miles on bike x" but in the activities response there is no mention of gear. Has anyone else dealt with this? I don't really want to have to loop through the activities response and then send loads of additional network requests for the gear.

Thanks
Dave

David Spence

unread,
Oct 21, 2015, 4:15:28 PM10/21/15
to Strava API
If you just want distance by gear you could use the gear resource?

Dave Pier

unread,
Oct 21, 2015, 4:27:47 PM10/21/15
to Strava API
Unfortunately I don't just want this. I want to be able to find the number of hours on the bike too. 

Dave Pier

unread,
Nov 10, 2015, 3:16:52 PM11/10/15
to Strava API
I can't believe that no-one else is having this issue and hasn't found a better way to do this than 200 api calls. This seems like such an obvious use case i.e. finding all the road riding activities vs off-road (where bike type in the gear section would give you this information).

If anyone from Strava reads this, are there any plans to add gear in the activities list?

jscott.d...@gmail.com

unread,
Nov 29, 2015, 7:02:53 AM11/29/15
to Strava API
Couldn't you just retrieve the activities and then loop through them to find which ones have the different gear id's for the different bikes you are looking for?  Under the activities they have the gear_id to show which shoes or bike you used for that activity.  

Dave Pier

unread,
Nov 29, 2015, 7:30:25 AM11/29/15
to Strava API
The list of activities does not have the gear id as far as the docs show. That means to find the id I would need to loop through the activities and in each loop do a new network call for the activity detail. That's going to take far too long for a useful user experience

Maybe I am missing something in the docs? If so could you give me an example response?

jscott.d...@gmail.com

unread,
Nov 29, 2015, 12:57:02 PM11/29/15
to Strava API

On the activities portion of the API documentation about the 36th item down, there is gear_id that corresponds to whatever you used during that activity.

Brian Rogers

unread,
Nov 30, 2015, 2:50:01 PM11/30/15
to jscott.d...@gmail.com, Strava API
As mentioned below, you can get gear_ids from the activity summary.  Then some options to get more gear data are:

Load activity detail, which includes a gear summary object.  This is fine if you need other activity details that aren't included the summary.

If you just need the gear data, you can get it from gear detail .  You should avoid loading gear details more than once per gear_id, and attempt loading them in bulk by passing in multiple gear_ids into a single API call.

~Brian

--
You received this message because you are subscribed to the Google Groups "Strava API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to strava-api+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



Brian Rogers
Software Engineer
STRAVA

Reply all
Reply to author
Forward
0 new messages