cancel
Showing results for 
Search instead for 
Did you mean: 

Segment time - local area

jrdyson
Mt. Kenya

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.

1 ACCEPTED SOLUTION

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 solution in original post

5 REPLIES 5

Jan_Mantau
Superuser
Superuser

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

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

 

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.

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!)

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