Beeminder Forum

Does the goals endpoint always return goals sorted by losedate ascending?

Looking at the response I got from the API goals endpoint, it appears that the returned list is sorted by losedate, ascending. Is this something I can rely on? Regardless, any chance the docs could be modified to specify how the results are sorted?

(Wasn’t sure if this should be in Tech or Bugabee)

2 Likes

You might also want to check out the list of issues on their API Docs Github if your looking for a place to put it.

2 Likes

Sort of… It looks like we’re actually sorting by panictime, which is an old deprecated thing that defaults to 15 hours before the derail time… so in most cases you’ll get things sorted by losetime ascending, but in some cases, for very old / longrunning goals, that panictime threshold might have been set to something other than the default, which would put them in a spot in the sort that doesn’t correspond correctly with the losedate.

4 Likes

Ah, right, thanks @bee! That panic-time / sort-threshold parameter was killed years ago though, so I think it’s safe to rely on the API returning goals sorted by time-to-derail.

2 Likes

And your wish is our command: http://beeminder.com/changelog#3335

2 Likes