Viser innlegg med etiketten Oslo. Vis alle innlegg
Viser innlegg med etiketten Oslo. Vis alle innlegg

lørdag 12. mai 2012

Strava API for efforts per segment: Limitations and workarounds

The Strava API for downloading efforts per segment never returns more that 50 efforts. By including the option best=true, you get the 50 all time best efforts, i.e. the overall leaderboard from 1 to 50. However, this option does not work in combination with the startDate/endDate options. Thus, if you're interested in compiling leaderboards including athletes who are not among the top fifty, or if you want to show the best efforts from within a given timespan, you have to start doing a bit more work. Marc Durdin sums it up pretty good in this posting.

In essence what Marc is saying is that you have to call the API repeatedly, and whenever you get 50 efforts back, you split the time span in two halves and do two new calls. The lowest resolution available is per day, so what happens if you at the end are down to a day and you still get fifty efforts back? You're stuck. By combining this approach with a single call to the best=true, you're sure that you have the 50 all time best efforts + a substantial number of all efforts ever made. But for days when more than 50 efforts have been made, you are most certainly missing efforts.

Initially, I though this probably might not pose a problem, but I was wrong. A popular segment around here is Grefsenkollen, and on four occasions this spring 50 or more efforts have been made on this segment during a single day. The dates are:
  • 17th of April (Tuesday)
  • 19th of April (Thursday)
  • 24th of April (Tuesday)
  • 3rd of May (Thursday)

I thought these official numbers fra Strava HQ (posted December 2011) were interesting. One particulary interesting piece of information was that the fourth most active country in the world was Norway (Norway is of course not a very big country). So, this was 2011 - the numbers I'm seeing now indicate the usage has really risen for 2012, at least here in the Oslo area. I'll write a blog post about this sometime.

onsdag 9. mai 2012

Who is "King of Mountain" in Oslo?

This deeply important question was posed by Martin on his blog in this posting. He continued by arguing that the best way to find the answer to this question would be to determine what the three most prestiguous segments in the Oslo area are. Of course, we are talking about segments on everybody´s favorite social training site: Strava.

And he landed on these three segments:

I realized that computing the list for "King of Mountain Oslo" is just a single instance of a general concept that could be interesting in many places and situations. Who is KOM in San Fransisco, New York or Ulan Bator? Who is king on the paths that I cycle in the woods where I live? etc. etc.

So the concept of "composite segment" was born, and the site Composeg was created. I hope that you will find this site of interest, and I am working on new features that hopefully will make the site even more interesting.

BTW, here's the page for the 100% up-to-date ranking of King of Moutain Oslo.