Using the Terminal API

Using the Terminal API
0

#1

Hi everyone, after using @bcverdict’s awesome tool to see your algo’s elo over time, matches, etc. I thought it would be nice to have a way to get an algo’s id that was no longer listed under https://terminal.c1games.com/api/game/algo/mine. So I created a script that would search through and try to find it. However, I thought that this could be expanded with some other beginning interactions with the API.

So I have created a starter library for interacting with the terminal API in Python.

You can find it here:


Terminal Community Contributions
#3

Thanks for pointing that out, the deviation number I had there was just something I threw in there. I worked it out before and just forgot to change the number (I have updated the offset now - 1 higher than necessary, 507, just to be safe).

I asked about the reason for the offset and the explanation I received was that the api request returns a count of algos, whereas the next algo id is simply a number that is incremented. Thus, if any algos were removed from the server, the count would be lower than the id number. The reason for the difference is that C1 cleared out their system before going public.

So adding doing anything like adding new bosses, removing and algo from your list, etc. None of this should have an effect on this offset. The only thing would be if C1 goes in and deletes an algo from the server. So this number should not change for a while :).


#4

If anyone is using this, you should know the keys for certain things changed in season 2. I just pushed an update to the api that should have fixed any problems with this.


See top elo replays
#5

For anyone curious about automating API downloads, the url is http://terminal.c1games.com/api/game/replayexpanded/[match_id]. This tid-bit is left out of the otherwise fantastically helpful API library, but I figured there wasn’t much sense in hiding information you can dig out of F12 on the website.

I’ll leave using this information up to the individual programmer (although it doesn’t take much more than copying the existing library functions and formatting the content a bit to start generating .replay files).


#6

For anyone who may have used this api in the past, you should be aware some changes by the C1 team have broken some of the functions in the api. I have updated the master branch and if you pull it should all work properly.