Is there a way to get the FEN after every move in a game?

Sort:
Oldest
leandro1993

Hello everyone. From my brief experience with the API, I have seen that we are able to collect the FEN of the final position of a game. Is there a way to retrieve the FEN after every move of a particular game? I saw that we are able to retrieve the moves, but not in the FEN format.

stephen_33

To the best of my knowledge no. What you see in the api documentation is what the api provides and nothing more.

Are you able to construct a list of FEN strings from the moves list of a game? I think that's the only option open to you.

rhymeswithgod

I'm not aware of a current API that provides this directly. However, if you retrieve the PGN of a completed game, there are many tools that can help you load that PGN and generate move-by-move FEN strings from the game.

pgn-extract is one such example - a command-line tool for manipulating PGN data. Here is me piping a PGN into pgn-extract and asking for FENs for each move. (Originally saw this method on stackexchange.)

Tricky_Dicky

Interesting thought. My initial reaction is 'Why would you need that?'

leandro1993

That's great, rhymeswithgod. Thank you happy.png

Tricky_Dicky, this is just an idea for now and a personal project but I plan to feed a bunch of games of players with varying chesscom elo's to a neural network  and do a Guess the Elo type of prediction. I'm interested to see as well some data exploration, like if players from different countries usually tend to play more a certain opening, just to fulfill my curiosity lol. But again, nothing concrete yet

Tricky_Dicky

Cool idea

callmefilms

That's a great idea. I think you would be well off with just reading data from complete games. Is there any reason you want to use data from uncompleted games?