API bugs

Sort:
Avatar of Andrzej_XD

There seems to be a bug in the pgn API, when the response size for a given player is above 10MB, then you get an empty result.

A similar problem is with the game list and the missing corresponding field.

Avatar of Tricky_Dicky

Usually best if you can give an example to illustrate. 

Avatar of YankeeBastid

when I run 'https://www.chess.com/callback/live/stats/YankeeBastid/chart?daysAgo=30&type=rapid'  I get many duplicates in the results. Why would I see duplicates in the results? 

Avatar of YankeeBastid

result:

[{"timestamp":1641888000000,"rating":822},{"timestamp":1641974400000,"rating":822},{"timestamp":1642060800000,"rating":822},{"timestamp":1642147200000,"rating":822},{"timestamp":1642233600000,"rating":829},{"timestamp":1642320000000,"rating":829},{"timestamp":1642406400000,"rating":829},{"timestamp":1642492800000,"rating":823},{"timestamp":1642579200000,"rating":823},{"timestamp":1642665600000,"rating":814},{"timestamp":1642752000000,"rating":814},{"timestamp":1642838400000,"rating":814},{"timestamp":1642924800000,"rating":814},{"timestamp":1643011200000,"rating":814},{"timestamp":1643097600000,"rating":814},{"timestamp":1643184000000,"rating":814},{"timestamp":1643270400000,"rating":814},{"timestamp":1643356800000,"rating":814},{"timestamp":1643443200000,"rating":807},{"timestamp":1643529600000,"rating":807},{"timestamp":1643616000000,"rating":815},{"timestamp":1643702400000,"rating":823},{"timestamp":1643788800000,"rating":806},{"timestamp":1643875200000,"rating":821},{"timestamp":1643961600000,"rating":830},{"timestamp":1644048000000,"rating":838},{"timestamp":1644134400000,"rating":838},{"timestamp":1644220800000,"rating":838},{"timestamp":1644307200000,"rating":838},{"timestamp":1644393600000,"rating":838}]
Avatar of io_kloud

It looks like a daily rating record, converted the ts to date.

 

{'timestamp': 1641888000000, 'rating': 822}
2022-01-11T16:00:00, 822
{'timestamp': 1641974400000, 'rating': 822}
2022-01-12T16:00:00, 822
{'timestamp': 1642060800000, 'rating': 822}
2022-01-13T16:00:00, 822
{'timestamp': 1642147200000, 'rating': 822}
2022-01-14T16:00:00, 822
{'timestamp': 1642233600000, 'rating': 829}
2022-01-15T16:00:00, 829
{'timestamp': 1642320000000, 'rating': 829}
2022-01-16T16:00:00, 829
{'timestamp': 1642406400000, 'rating': 829}
2022-01-17T16:00:00, 829
{'timestamp': 1642492800000, 'rating': 823}
2022-01-18T16:00:00, 823
{'timestamp': 1642579200000, 'rating': 823}
2022-01-19T16:00:00, 823
{'timestamp': 1642665600000, 'rating': 814}
2022-01-20T16:00:00, 814

Avatar of io_kloud

fide rating is missing in player profile endpoint

https://api.chess.com/pub/player/{username}

 

In the api at https://www.chess.com/news/view/published-data-api#pubapi-endpoint-player

it mentions about the fide rating.

 

Example:

https://api.chess.com/pub/player/hikaru

{"avatar":"https://images.chesscomfiles.com/uploads/v1/user/15448422.90503d66.200x200o.f323efa57fd0.jpeg","player_id":15448422,"@id":"https://api.chess.com/pub/player/hikaru","url":"https://www.chess.com/member/Hikaru","name":"Hikaru Nakamura","username":"hikaru","title":"GM","followers":914261,"country":"https://api.chess.com/pub/country/US","location":"Sunrise, Florida","last_online":1644695316,"joined":1389043258,"status":"premium","is_streamer":true,"twitch_url":"https://twitch.tv/gmhikaru"}

Avatar of YankeeBastid

I have determined it is a non-issue. If I ask for thirty days, and the player has not played in 'x' days those days will still show up with the last known rating for that data point.  So that explains the duplicate ratings on subsequent days.

Avatar of Tricky_Dicky

See previous forum

https://www.chess.com/clubs/forum/view/how-can-i-get-element-fide

Avatar of io_kloud

Thanks, this doc is misleading.

 

Even with stats there are players without fide rating. Example.

https://api.chess.com/pub/player/sibelephant/stats

https://api.chess.com/pub/player/gmwso/stats

 

Avatar of Tricky_Dicky

The rating field is optional. It will only be available if the member has entered a value in the account settings and is static. It doesn't get an automatic update.

Try https://ratings.fide.com/

(And some members lie)

Avatar of io_kloud

Looks like I need to build a lookup table, chess.com username or id or name to fide id number or name.

Avatar of dimpoul

The FIDE rating is only there if the players specify it, for example Hikaru:

https://api.chess.com/pub/player/hikaru/stats

Avatar of io_kloud

There is a url in chess.com with this pattern.

 

https://www.chess.com/players/{firstname}-{lastname}

 

FIDE rating seems to be updated.

 

Examples:

https://www.chess.com/players/magnus-carlsen

https://www.chess.com/players/hikaru-nakamura

https://www.chess.com/players/wesley-so