Get a players live game using the API?

Sort:
scumlord0

It seems to be something wierd with getting live games from the api.

I want to get the game:

https://www.chess.com/live/game/5208486405 and I assume the last number is the id of the game

but accessing https://api.chess.com/pub/match/live/5642445654 doesnt work :/

Does anyone know how to get live games from the API?

Tricky_Dicky

Unfortunately, it isn't that straight forward.

1. You need to establish which month the game was played in i.e. in this case July 2020

2. Then get the monthly archive for one of the players

i.e. https://api.chess.com/pub/player/hashtagchesstwitch/games/2020/07

3. Search the resultant data string for the game id. (5208486405) and extract the pgn details

4. Alternately you can download the monthly archive to your default download folder (add /pgn to url) as a text file and edit it.

i.e. https://api.chess.com/pub/player/hashtagchesstwitch/games/2020/07/pgn

Yeah, it's not as intuitive or as user friendly as it could be.

 

alexriabtsev

https://www.chess.com/news/view/published-data-api#pubapi-endpoint-games-archive-list you may check here

MaxShadowsong

This is rather unfortunate. Is there a way to get the pgn information from javascript while being on the game site? 

So basically a way to get it as a text without having to download it or click share (where it then is available for manual interaction)?

Background being to import the game into another program to save it for later analysis.