Skip to main content
Solved

Segment time - local area


Forum|alt.badge.img+2

Hi,

Trying to get a view of local segments and what the fastest time/speed on each is. I can return local segments in a bounded area, but can't get any data on the results for that segment. Would be great if I could get the number of attempts that deemed it Local Legend also. I can do it on the site, but I'd like to do it programmatically so I can show a heat map for athletes. 

 

any pointers gratefully recieved.

Best answer by Jan_Mantau

I guess the problem is the incomplete API documentation, there are many fields not mentioned for the DetailedSegment model. You are expected to browse through the result json for anything that might be interesting to you. The values you want are the following:

  • "xoms.kom" for the seconds of the best effort for men
  • "xoms.qomfor the seconds of the best effort for women
  • "local_legend.effort_count" are the attempts of the LL
  • "local_legend.title" for the athlete name of the LL

 

View original

Jan_Mantau
Superuser
Forum|alt.badge.img+26

You find these information in the segments/id endpoint: https://developers.strava.com/docs/reference/#api-Segments-getSegmentById


Forum|alt.badge.img+2
  • Hub Rookie
  • July 11, 2024

Hi thanks Jan, I think that only does my own data, not the 'best on segment' leaderboard data. Unless I'm grabbing it wrong.

 


Jan_Mantau
Superuser
Forum|alt.badge.img+26

In your original post there wasn't anything about leaderboards, you wanted the fastest overall time and the local legend including their number of attempts. All these you can get with the mentioned endpoint. Leaderboards aren't available in the API.


Forum|alt.badge.img+2
  • Hub Rookie
  • July 12, 2024

Hi Jan, apologies for confusing here. I'm an awful coder and an even worse explainer.

  • I'm trying to define an area (done)
  • Pull back a list of segments (done)
  • Show the fastest time on that segment (not mine, any athlete) - (not done)
  • Show the current local legend (and attempts they've made). - (not done)

When I run the script I've cobbled together it doesn't pull back the fastest time or local legend pieces. I used kom_rank and pr_rank from the DetailedSegmentEffort, but couldn't get it to run. 

Again, apologies for confusion (and my ignorance at doing this!)


Jan_Mantau
Superuser
Forum|alt.badge.img+26

I guess the problem is the incomplete API documentation, there are many fields not mentioned for the DetailedSegment model. You are expected to browse through the result json for anything that might be interesting to you. The values you want are the following:

  • "xoms.kom" for the seconds of the best effort for men
  • "xoms.qomfor the seconds of the best effort for women
  • "local_legend.effort_count" are the attempts of the LL
  • "local_legend.title" for the athlete name of the LL

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept, you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings