Current month's completed games? [Found]

Sort:
Avatar of skelos

Hi all,

I've worked out how to fetch current daily games, and that's been very useful. I (and at least two people whose accounts have been closed) say "Thank you very much!"

I'm now working on archived games. For blitz games especially having the game ID/URL to uniquely identify games will be very useful as people often play several blitz games against the same oppoenent on the same day.

Starting with the endpoint https://api.chess.com/pub/player/{username}/games/archives for a player who joined in November 2017 I only get one endpoint back:

 

https://api.chess.com/pub/player/{player}/games/2017/11

 

This leaves me missing games from this month. Are there plans to provide the current month's games "to date"? If not, I would request that the feature be added; the games are accessible from the website's per-player archive page. I've never investigated if there is a delay of up to a day in being able to see those or not; my timezone is UTC+11 and an awful lot of people are still working on "yesterday" happy.png right now.

Bottom line: can the "gap" between last month and unfinished games be filled, please?

Avatar of skelos

Today I fetched a player's games, and found games for 2017-12.

It appears there isn't a gap; perhaps I was looking at a user who hadn't had any games finish on the first couple of days of December. Unfortunately I am not 100% sure whose games I was looking at, but unless someone finds games via the web archive interface that are not visible via api.chess.com, I'd call this a false alarm, aka "user error".

Sorry for any inconvenience!

Avatar of andreamorandini

Actually the archives endpoint show sonly links to months that have at least one game, so at the beginning of the month it can be misleading. 

Avatar of skelos

Thanks for the explanation. I recall being tired when I wrote that up; next time perhaps I should make notes and hold on to them for a few days.

Today, by the way, it was lovely to download with one command a player's archive, store each month in a file, extract the type of games I wanted (another command) and a bit less fun manually feeding several months individually to PGN Spy, but another engine user has been reported without my having to spend time selecting careful sets of games via the web interface.

Granted, I was a little lucky that per-month results showed a progression of behaviour, but whatever works I use!

Avatar of Revaes

I have a similar issue. When requesting the players archives, some months are not included (while the player defintively played games in that month, i.e. 2017/09 and 2017/10). Also the last month (2017/12) is missing.

 

https://api.chess.com/pub/player/Einar88/games/archives

Avatar of skelos

I agree those months don't have endpoints reported for them for @Einar88:

...

Fetching https://api.chess.com/pub/player/einar88/games/2017/07

Fetching https://api.chess.com/pub/player/einar88/games/2017/08

Fetching https://api.chess.com/pub/player/einar88/games/2017/11

...

 

Yet the web interface shows games:

https://www.chess.com/games/archive?gameOwner=other_game&username=einar88&gameType=recent&gameTypeall=live&gameTypeall=daily&gameResult=&opponent=&opening=&color=&gameTourTeam=&gameTitle=&timeSort=desc&rated=&startDate%5Bdate%5D=09%2F01%2F2017&endDate%5Bdate%5D=09%2F30%2F2017&ratingFrom=&ratingTo=&search=

https://www.chess.com/games/archive?gameOwner=other_game&username=einar88&gameType=recent&gameTypeall=live&gameTypeall=daily&gameResult=&opponent=&opening=&color=&gameTourTeam=&gameTitle=&timeSort=desc&rated=&startDate%5Bdate%5D=10%2F01%2F2017&endDate%5Bdate%5D=10%2F31%2F2017&ratingFrom=&ratingTo=&search=

 

For live games particularly there isn't much confusion about which month's archive they belong to, other than games crossing midnight (in ??? timezone) at the start and end of the month. (If the timezone is UTC, that's great. UTC with leap seconds OK too, but few operating systems deal well with leap seconds, so UTC without leap seconds is probably what I'd go for unless my servers and all my software could deal ... and I knew it ... which I probably wouldn't without more testing than such rare situations deserve.)

Avatar of Revaes

 So what do you suggest? Because, if I manually fetch https://api.chess.com/pub/player/einar88/games/2017/10

it all seems to work fine.

Avatar of andreamorandini

@Revaes thank you for your feedback, we will look in this issue soon. In the meanwhile, as you have already found, you can call directly the month's archive, which should work as expected. 

Avatar of skelos

 That might be a simpler way to work; find the join date, and go from there (or later date if that's all that's interesting). Or work backward from the current month, which would be my more usual usage.

Is the list of available archives adding enough value to be worth maintaining?

(I'm not invested in the answer, but less code almost always means less bugs and less maintenance. My favourite technique in my tech support days for fixing defects was to delete code.)

Avatar of andreamorandini

Dear @Revaes and @skelos the problem has been fixed, you can test with https://api.chess.com/pub/player/Einar88/games/archives . Please note that if you test with other player’s archives that you already requested in the past 24h, you will have to wait the cache to invalidate. 

Avatar of skelos

Looks fixed, as noted in the other thread.

Thanks!