List of segments ridden by user

468 views
Skip to first unread message

Hobson

unread,
Oct 4, 2016, 3:24:50 AM10/4/16
to Strava API
Hello Strava,

Since this question has been asked a few times, but I did not see any clear answer from support team member, I'd like to ask a question very similar to this one: https://groups.google.com/forum/#!topic/strava-api/jkyUt5V39sM

So, is iterating over all activities, one by one, the only possible way to find segments a user has ridden?

  • 'List athlete activities' is not helpful, because returned activity summary has no segment information. If it only had segment efforts in their meta representation, it would be at least something.
  • 'Retrieve an activity' would be helpful if it allowed to retrieve several activities at once, but I think it accepts only single activity id as argument.
  • There is no endpoint (AFAIK) to retrieve (time boxed or paged) list of segment efforts, ridden segments, nor leader board entries for a given athlete, or pretty much nothing that would allow us to derive a list of segments easily.

With a list of my 1300 activities I am simply not able to build such a list with current API limits, and even when users have fewer activities, I could serve just a little few of them each day :(


Is there something I am missing? If not, are there any plans to help us in this matter? 

I really wanted to enter Strava Developer Challenge with my application, but unfortunately the lack of ability to efficiently retrieve a list of segments for a user was the main reason I did not make it :( Maybe next time!


Thanks and best regards,
    Maciek



Olivier J

unread,
Oct 4, 2016, 10:39:50 AM10/4/16
to Strava API

Hello
I have developed an application such as this to know all the segments that i crossed during my activities.

To get all egments efforts, no choice you must iterate over all the activities one by one, there is no other way now.

The longest part is to initialize your database. After you just have to read the new activities.
But the most annoying thing is find the newest segment created after the activity was done. To find knthis segments you must read all activities again.

What I do is that every day I'm reading all the activities of the same day in the month. Whit this solution I divide the load of 1 month (the problem is the months of 28 or 30 days;))

Hobson

unread,
Oct 4, 2016, 2:58:34 PM10/4/16
to Strava API
Olivier,

Thank you for your helpful response and hints, they might be useful. Actually your answer simply confirms what I expected, and I just wanted to spread some awareness among API team that such feature is needed and would be very welcome. I've seen already several questions on this topic, so I hope API folks hear us! :) 

The task is a bit more difficult for me, since I'd like to create some kind of progress monitoring on segments (simply speaking; my actual goal is a bit more entertaining. Or so I hope) - so each athlete that would like to get his 'progress report' would have to retrieve all his segments. And this will drain my request quota really quick, even if it's just for initial 'build up'. I could read data in chunks when my quota refreshes, but then every user that joins my site would have to wait some time (be it an hour, a few hours, or a day) and I think that message like 'Welcome to my website, now please wait until tomorrow while we collect data about your profile!' is not really good UX. So anything, that would make this task easier, would be really helpful. It does not have to be anything directly returning a list of segments - even something like bulk retrieval of activity details (for example, 10 activities in one call) would be very helpful. Or effort meta in activity summary. Or leader boards where given user is listed.

Thanks for help, thanks for listening :)

Best regards,
    Maciek

Rocky

unread,
Oct 4, 2016, 9:40:45 PM10/4/16
to Strava API
The real challenge is that your database ("cache") may not store data from Strava for more than seven days per the Strava API Agreement.

Perhaps you can enable browser caching to cut down on the number of repeat API calls that would be made to Strava's servers.

Would be interesting to know how other sites (VeloViewer being an obvious example) manage the constraints around retention of Strava data and number of API calls. You probably need to agree something with Strava if you need to go above the base developer limits on # calls etc.

ExplodingPony

unread,
Nov 3, 2016, 11:47:33 AM11/3/16
to Strava API
I've been looking for something similar. 

I've wanted to get my segments from my activities so I can compare them in different ways, not just my activities. 

I don't mind having to rinse over each activity for each segment, but my Segment and SegmentEffort feeds are empty. 

My Strava account is a non-premium account.. does that make a difference?

Thanks,
EP
Reply all
Reply to author
Forward
0 new messages