data populating?

Sort:
jb32828

Trying to get a PGN for month 2018/01 - no data populated. https://api.chess.com/pub/playe/playername/2018/01 comes up empty.

walidmujahid
[COMMENT DELETED]
skelos

If there are no games, that month's endpoint should not be listed for their archive.

Have you checked via the web interface if there are any games for that month?

2018/01 unless the player plays live chess it is quite likely no game has yet finished this month. Indeed, even if playing live the player might have skipped the first couple of days of the month.

walidmujahid

First off, you are missing the 'r' in 'player. Then you would need to access the 'games' endpoint. Try: https://api.chess.com/pub/player/{username}/games/2018/01

 

To get all PGN's as a download: https://api.chess.com/pub/player/{username}/games/2018/01/pgn

 

Edit:

If you still do not see any data even if you know you played a game today, then it might be because the endpoint has not updated yet-even if you see the archive as available.

 

skelos

Unless the name of the player is sensitive for some reason, it would help to give the full URLs for their archives and the endpoint that doesn't work.

I looked right past it the first time, but the URL you have is missing an "r" in "player". Probably not your problem, but knowing what response you received (404?) from the server might help too, especially if the chess.com developers get involved.

skelos

Kudos to @whalidmujahid for noticing the missing "r". He deleted his first post and produced the substantially more specific second one.

Myself, I find all a player's archives via 

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

and then access those.

walidmujahid
skelos wrote:

Unless the name of the player is sensitive for some reason, it would help to give the full URLs for their archives and the endpoint that doesn't work.

I can give myself as an example: https://api.chess.com/pub/player/walidmujahid/games/2018/01

Even though it is listed: https://api.chess.com/pub/player/walidmujahid/games/archives

 

Again, I think it is due to the endpoint not updating yet -I forget when it does. Try giving it some time. Or it might be a bug.

skelos

I call "bug" if there are no games, but it's minor. A fix that merely changes the documentation to state that months with no games may appear in the list of archive endpoints but contain no games would not be my first choice, but I could live with it.

skelos

https://api.chess.com/pub/player/skelos/games/2018/01 shows empty for me too, but is listed by https://api.chess.com/pub/player/skelos/games/archives

{"archives":[... "https://api.chess.com/pub/player/skelos/games/2018/01"]}

I have had a daily game end this year, but within the last few hours.

walidmujahid

A bug it seems then. I would imagine it would also be a simple fix to have game archives not appear as available until they are populated with a minimum of 1 game. Though, I guess we will have to see what the devs say.

andreamorandini

@jb32828 If you hit a wrong endpoint usually you get a message warning you like this {"message":"Data provider not found for key \"/pub/playe/playername/2018/01\".","code":0} that means you hit an un-existing endpoint.

 

@skelos & @walidmujahid thank you for noticing this behavior, I have hit your endpoints and they seem correctly populated so I've to check internally if we had any issue with cache invalidation.

andreamorandini

Dear @skelos & @walidmujahid after some more testing we found out a bug that was rendering empty archives when an users had played games only on the first day of that month. 

 

Now it should have been fixed.

skelos

Tricky ... fencepost errors are always waiting to bite. Thanks for the background and the fix.