Some inconsistency between documentation and API and API PGN and web site PGN

Sort:
djcaf

Hi,

  I have noticed a couple of possible bugs/inconsistencies.

This relates to my archive : https://api.chess.com/pub/player/djcaf/games/2018/07

Item #15 which should be for the game https://www.chess.com/daily/game/192749730

My rating was apparently (according to the web site, i.e. not the API) 1354 when the game ended

If you download the PGN from the web site then the following ratings are returned:

White: 1053

Black: 1354

The PGN data in the returned JSON for this game gives:

White: 1071

Black: 1348

That is the first issue (inconsistency).

Also in the JSON there are two fields for this game:

White and Black. Under each is the rating; In this case;

White > Rating: 1053

Black > Rating: 1354

Those match the rating after the game has been completed. The documentation (https://www.chess.com/news/view/published-data-api#pubapi-endpoint-games-archive) suggests those should be the rating at the start of the game. I am no bothered which way that works, but it seems that this is also an inconsistency.

Thanks

skelos

I think a very similar issue was raised in relation to the team match board endpoint. Quite recently. I'll see if I can dig it up later.

 

Interactively using the website the delta from pre-game to post-game is shown (if it's  your game) but the rating by each player's name is the post-game rating.

I always ask that api.chess.com match the website, and as api.chess.com is newer and I presume used by many less people generally expect api.chess.com to change to conform to the website, although maybe we'll see a change the other way around one day.

Conclusion: Here I would prefer the documentation and returned data to change.

 

In the "wishlist" department I'd like to get pre-game and post-game ratings via api.chess.com, but that's a bit fancy so only if it's easy please guys. happy.png 

skelos

BTW I do filter archives on rating, so while this is rarely going to matter much (inclusion or exclusion of a few games should not make much difference) and currently I filter on the PGN values, as sometimes I download via the website, although rarely now.

I suppose in a way I have my "wish" for both values, but one in the JSON and one in the PGN is not really intuitive!

djcaf

Sounds good happy.png I have only just got started with the API stuff so have not played with it that much yet - it is certainly potentially very useful even with the odd issue happy.png

andreamorandini

@djacaf We have addressed this discrepancy. You should be able to get consistent ratings in both PGNs now (web and PubAPI).

skelos

Mm ... I can and will look, but in the interest of completeness for this thread (and because I am not going to look right now), was the resolution to return end-of-game ratings (in which case the documentation must change, or might have been already) or to return start-of-game ratings as per the documentation?

The former is what I prefer; the latter is what I expect. The latter would also mean any data I have stored from prior to the change/fix should be considered out of date. (Which isn't a huge pain; there was some change in late July that has me re-downloading if I find myself looking at data older than the start of August).

andreamorandini

@skelos We are trying to match Web PGNs the most we can in order to eventually merge the two systems. So we have reverted to end of game rating and documentation will be changed accordingly.

skelos

Thanks Andrea. As I wrote, it's what I expected and in an earlier post I wrote that I like api.chess.com to match the website, so doing that is good, even if it's not necessarily the choice you might make with a clean page starting point.

I have one script which would prefer the pre-game rating, but it's a match result predictor, and is most useful during the registration stage to see how balanced a team match is. I'll have to accept that it will be operating on different data if running for in_progress or finished matches.

(And no, I don't know how accurate it is, but there may be some finished matches I can find predictions for now to start checking. Another topic!)