PGN parsing error with a multi-game PGN downloaded from the Published-Data API

Sort:
barneytron

I often download games from players I follow. I grabbed the PGNs from bortnyk's games from Jan 2024. And when I imported the downloaded multi-game PGN file, I got a bunch of parsing errors. I am not totally familiar with PGN syntax, so I am wondering if the downloaded PGN has incorrect syntax, or if SCID's PGN parser is not right. I got the PGN file from here https://api.chess.com/pub/player/oleksandr_bortnyk/games/2024/01/pgn

I would appreciate any insights into this!

An example of a parsing error:

(game 659, line 16507) Error parsing the tag pair: FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR/ w KQkq - 0 1"
(game 659, line 16523) Failed to parse the move: B@c5
(game 659, line 16523) End of game, ignored the part after the last error.

Tricky_Dicky

That move notation is not standard chess. I think it's crazyhouse variant. Surprising as I didn't think that the variants were in API archive,

[Event "Live Chess - Crazyhouse"]
[Site "Chess.com"]
[Date "2024.01.18"]
[Round "-"]
[White "Oleksandr_Bortnyk"]
[Black "papapizza"]
[Result "0-1"]
[Variant "Crazyhouse"]

[SetUp "1"]
[FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR/ w KQkq - 0 1"]

barneytron

Nice observation, thank you Tricky_Dicky! Now I wonder if there is a way to exclude crazyhouse from the downloaded pgn. I don't see any query string parameters for filtering in what is documented here https://www.chess.com/news/view/published-data-api#pubapi-endpoint-games-pgn

Tricky_Dicky

Personally I don't think that variants are meant to be in DB.

Description: standard multi-game format PGN containing all games for a month.

Looks a mistake to me. Needs flagging to support.

Only other option is to check [Event --] or [Variant -- ] tag during processing

barneytron

Yup, for now, I will create some logic on my end to exclude variants that are non-standard.

LateToMate

To my knowledge, you have to download them, but this is the relevant part of my code where I filter them out:

if "Variant" not in game.headers and "SetUp" not in game.headers:

SetUp appears to be applied when a higher-rated player starts with fewer pieces to level the playing field when playing against a lower-rated player. (There may be other circumstances - I've never found any documentation on this. I only figured it out because these custom games were sometimes triggering strange errors in my script.)

(Edited with corrected syntax.)