speedruncomorg / api

REST API Documentation for speedrun.com
349 stars 35 forks source link

Include obsolete runs in leaderboards #116

Open PolariTOON opened 3 years ago

PolariTOON commented 3 years ago

I'm working on a bot that retrace / tracks the history of the runs - especially the world records - for a given leaderboard, that is to say given a game, a level, a category and a set of variables.

When retrieving a given leaderboard from the API, only non-obsolete runs are included, so each team of players appears at most one time per leaderboard, as said in the documentation:

Leaderboards contain non-obsolete runs, sorted by time descending.

Since some runs are missing, the history can not be retraced only from that.

I noticed the endpoint also takes a date parameter that allows to only get runs done before a given date. Thus a way to retrace the history is to retrieve the leaderboard for every day. But this has two downsides:

Exposing a way in the API to show all runs, including obsolete ones, for a given leaderboard - with an obsolete=true parameter or something like that - would allow to retrace the full history by making only one request. The site already has this option but i would not want to have to parse the response returned by the equivalent PHP endpoint to do that. So this feature would be very appreciated.

lundylizard commented 2 years ago

Really late, but /runs

PolariTOON commented 2 years ago

That's indeed the endpoint I had to use for my use case, and I'm still periodically polling and sorting the latest runs through it, but I think it would have be more straightforward to expose that on the /leaderboards endpoint. Directly fetching a leaderboard with all the runs looks like a typical use case since even the site has an option for it.