Is there a way to download the details (such as this request: https://online-go.com/api/v1/games/17325622 ) but for a list of games? For some power-users of my Android app that have 800+ active games, fetching the games one-at-a-time runs into rate limiting issues.
do you know about https://online-go.com/api/v1/players/${playerId}/full ?
Thank you for your answer. I might use that for other use-cases, but for this particular situation, I need to be able to fetch inactive games (not only active). I already have a list of IDs of those games. Here are the details:
- The user logs into the app and has 800 active games. I fetch those with /overview (or the link you sent).
- a month passes without the user logging in the app (but playing on the website still)
- The user logs back in. I fetch his active games with /overview, but now I see that 400 of the previously active games are not active anymore, presumably because they got finished. I have to now find out what happened to those games.
Normally, I do a hit for every single game in this situation, as there are rarely more than 2-3 of those. However, in some cases, there are a few hundreds and then I flood the server.
Do you have any suggestions on how do I do this? Is there a proper list of all the APIs that I could look at (for example, I did not know about “/full” that seems to give more details).
and in the same vein, I’m using api/v1/players/{player_id}/games/?source=play&ended__isnull=false&annulled=false&ordering=-ended
to fetch the historic games, but these don’t have the moves in them, is there a way to get them (or at least the finished position) without fetching every single one of them one at a time?
I don’t think there’s an endpoint to mass-download games. The /games endpoint got limited to one game a while back, and nowhere on the website is the need to request the movetree for more than one game.
The termination API might allow you more requests per time frame:
Maybe you can use the socketio live API to collect the game trees.
Maybe you can send game/connect
messages to those games via the socketio connection to fetch the details, those are much cheaper for the server to process. I was able to fetch 100 games at once without any issue but haven’t tried with more than that.
Sadly that is probably not going to work, because game/connect
is not a request-and-response protocol. Let’s say I fire a game/connect/{id} on the socket. How long do I wait for the response? 1 second? 2 seconds? 1 minute?
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.