How to sort records by ingame time when using the API?
8 years ago
Germany

Hey,

I am trying to get the world records in all categories for a given game. When I am calling http://www.speedrun.com/api/v1/games/w6jve26j/records?timing=ingame&top=1 (all records for Dark Souls) I get the correct Any% world record, but for "All Bosses" I get 1:20:42 by NaxHPL because it is the first run that has a real time entry I presume. (http://www.speedrun.com/Dark_Souls#All_Bosses) How do I tell the API that it should sort by ingame time, and then return the fastest run?

Vienna, Austria

Why do you need the API to do it?

If you're using PHP: http://hastebin.com/dofeqemupo.php ¤EDIT¤ Edited the "highly complicated code" to return the entire run rather than just the time.

This is just a thing I build together without knowing how the api works exactly and there might be a typo in it, but I guess that's gonna work out for this little thingy.

The basic thing is, API stands for "Application Programming Interface", so it gives you an interface to program your stuff that you need and isn't made to output all sorts of information by default since it would be way too much efford doing so. Even tho, Ingame-time seems like a good extra that could be added in v2 :P

تم التحرير بواسطة الكاتب 8 years ago
Germany

I'm using Java. Thought there might be a way to do the computing on the server side with the timing=ingame parameter. Guess I will just get all runs and sort them on the client side. Thanks