API calls for demo boards

Is there a good documentation on API calls?
Im currently building a tool for streaming events and it requires interaction with demo boards and/or live games.

I however wish to avoid pinging ogs a bajillion times

IE every 1 second of game play or 6 times a minute which is still incredibly a lot.

Im also curious if there is a way to call moves on demo board? I learned demos are referred to as reviews in the api call.

Why would you ping once per second?

Yes, there is a way to play moves on a demo board.

Out of curiosity, what language are you using to write this tool?

Im not playing moves, I am requesting board state information. The reason for pinging.

Im writing it in js… well more specifically nodejs

1 Like

Not sure if you’ve found the socket traffic yet, but there’s no need to poll the server - web sockets support push-based communication.

An efficient way to understand the messages is to open up the network tool in your browser and inspect web socket traffic

Nice! The frontend code for this site is open source and written in TS, so it might help to look at the source code to get an idea of how to communicate with the socket. For example, here is the “connect” message for reviews:

3 Likes

I didn’t know this was a thing, much better. I will look into it.

1 Like

By chance do you know if a guest user still needs to authenticated before using websocket?

I noticed that the websocket messages does still have authentication {params} but doesn’t seem to require a login.

However the REST api does require user authentication. So is being a guest user not available for webscoket?

I think it must be possible to be a guest user over socket because you can observe ongoing games without logging in. But I don’t know exactly how auth works with the socket.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.