I’m trying to connect to OGS via WebSocket and pick a live 19×19 game to monitor moves using Python. My goal is to receive a list of currently played games in the lobby, filter by numeric ranks, and select one to follow.
Thanks for the suggestions. The recommendation to look at the browser dev tools on the Watch page ended up being the key. Once I inspected the WebSocket traffic there, I could see the exact messages the OGS client sends.
A few important details I discovered that may help others trying to do the same thing:
The correct way to fetch the list of live games is with the gamelist/query command.
This command must include a request ID, otherwise the server returns the response as [id, data] and it won’t match an event name.
The response format is different from most push events — it comes back as [id, {results: [...]}].