This isn't quite "minor errata" in the documentation so I'm starting a new thread.
https://www.chess.com/news/view/published-data-api#pubapi-endpoint-match-board
documents:
{
"games": [
{
"white": { // details of the white-piece player:
"username": "string", // the username
"rating": 1492, // the player's rating at the start of the game
"result": "string", // if game's finished, see "Game results codes" section
"@id": "string", // URL of this player's profile
"team": "url" // url to club's profile
},
"black": { // details of the black-piece player:
"username": "string", // the username
"rating": 1942, // the player's rating at the start of the game
"result": "string", // if game's finished, see "Game results codes" section
"@id": "string", // URL of this player's profile
"team": "url" // url to club's profile
},
"url": "string", // URL of this game
"fen": "string", // current FEN
"pgn": "string", // final PGN, if game's finished
"start_time": 1254438881, // timestamp of the game start (Daily Chess only)
"end_time": 1254670734, // timestamp of the game end, if game's finished
"time_control": "string", // PGN-compliant time control
"time_class": "string", // time-per-move grouping, used for ratings
"rules": "string", // game variant information (e.g., "chess960")
"eco": "string", //URL pointing to ECO opening (if available),
"match": "string", //URL pointing to team match (if available)
}
],
}
what I appear to get instead contains more data moved into the per-game information, but I don't see the result (or end_time) and I think I need the result ... am I now supposed to get those from the game url? (Which is a website URL not an api.chess.com URL, but can probably be translated.)
I personally also liked the "start of match" rating too, but for predicting match outcomes without running an engine over incomplete games the players' current ratings are arguably better than their starting ratings, so that's a wash, mostly.
What I do get (live example, games in progress):
'games' => [
{
'fen' => '2r1r3/4kppp/p7/1ppR4/4n3/P3PN1P/1P3PP1/2R2K2 b - - 0 1',
'start_time' => 1524953098,
'rules' => 'chess',
'last_activity' => 1524953098,
'turn' => 'black',
'time_class' => 'daily',
'move_by' => 1525212298,
'time_control' => '1/259200',
'black' => 'https://api.chess.com/pub/player/acnologia01',
'white' => 'https://api.chess.com/pub/player/wombadom',
'rated' => bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' ),
'url' => 'https://www.chess.com/daily/game/193456876',
'match' => 'https://api.chess.com/pub/match/890216'
},
{
'time_control' => '1/259200',
'white' => 'https://api.chess.com/pub/player/acnologia01',
'black' => 'https://api.chess.com/pub/player/wombadom',
'rated' => $VAR1->{'games'}[0]{'rated'},
'url' => 'https://www.chess.com/daily/game/193456874',
'match' => 'https://api.chess.com/pub/match/890216',
'rules' => 'chess',
'fen' => '2r1r3/4kppp/p7/1ppR4/4n3/P3PN1P/1P3PP1/2R2K2 b - - 0 1',
'start_time' => 1524953098,
'move_by' => 1525212298,
'time_class' => 'daily',
'last_activity' => 1524953098,
'turn' => 'black'
}
]
};
I'm a little at a loss now how to predict a match result. I can do it for matches which are in "registration" state, it is trivial for a match in "finished" state but "in_progress" looks hard.
I'm pretty sure I could figure more of this out by looking at more advanced matches with some boards finished, but the #1 point of this (lengthy) post is intended to be that the per-match-board documentation doesn't currently match the endpoint.