Leaderboard API

Hello,
I want to access my Algorithms Elo and Ranking Place on the go, and the site on my phone isnt wide enough to show me my Elo, and getting to Place 400-500 is quite a work to skip through the leaderboard. So i am wondering if there is an API or something to get informations from the leaderboard.
Thanks in advance,
memeToasty

I had similar curiosities based on all the awesome stuff @876584635678890 has been compiling.

The answer turned out to be pretty obvious - the end points used by the website are all public and you can hit them yourself just as easily (Thanks, 8 for helping me out!).

If you want details about your most recent matches:

GET https://terminal.c1games.com/api/game/algo/{algo_id}/matches

Leader board endpoint:

GET https://terminal.c1games.com/api/game/leaderboard?page=1

Since it’s 10 results per page, you could set ?page=40 to start at Rank 400

The JSON results they return should be easy to follow once you start browsing them.

Edit: And there’s certainly more beyond these two, just browse the site with dev tools open and watch the endpoints it consumes to find more.

5 Likes

We are planning to implement a button to skip to your algos leaderboard page eventually

Or some kind of Search / Filter system, as i think you are using SQL queries to create that kind of leaderboards. So if you could put a form on the site, that filters through the entries in given specs like name, elo range, or user.

or you just have an algo in the top 10, then you dont have to skip xD

2 Likes

what do you mean with “dev tools open”

If you’re using Chrome or Firefox, pressing F12 will open the “Developer Tools”. That panel will give you a bunch of “under the hood” information. The “Network” tab shows the backend calls the current webpage made. If you refresh the page with Dev Tools open, you’ll see a bunch of Network entries. Drilling in to a given entry will show the request and response when applicable. That’s how you can find calls like the GET request to the Leader board and whatnot.

I hope that helps!

Okay ive found what youve meant, and i found “https://terminal.c1games.com/api/game/algo/mine”, but it seems, that it needs POST data to work obviously. My problem is that i cannot easily get this data from the site to my python script, or to my website to easily access it. Iterating over the whole leaderboard to search my algos seems a waste of computing power to me :confused: so im pretty much stuck right now :cold_sweat: again.
Do you know any other way to get to that kind of information?

From a request/response standpoint, iterating across their leaderboard endpoint is a “cheap” operation.

Doing numerous GETs to https://terminal.c1games.com/api/game/leaderboard?page=X won’t put any noticeable load on their end. So just chew through the JSON responses until you find your user and don’t sweat it!