Bug: some downloaded archives contain games without any moves This probably isn't an api.chess.com bug, as I see the same problem on the website. A game (https://www.chess.com/daily/game/179336564 is an example) is not 100% usual: 1. Unrated 2. Tournament game starting in a custom position. In the second round of the tournament I would like to review my play in the first round, especially as i was the only player to win twice as black! Not having access to the old games means repeating analysis. Maybe I'll analyse better this time. (But not really; I don't have time. I'll withdraw from the tournament instead if this breakage isn't fixed before I need to move.)
Hi everyone, I am finished with phase 1 of my web app. It is a website devoted to providing robust statistics about your game play. I am opening this up for open beta testing so feel free to sign up, check it out, see if you like it, and provide feedback. Thanks! https://www.chessalytics.com
ewizz614 wrote in https://www.chess.com/news/view/published-data-api comments: I am also running into some rate limiting issues for users who have a large volume of games.  Right now my application will make a request to get the archives for the user then loop through those archives to download the "/pgn" attachment for that user to get all of their games for that month, then move on to the next.  The code for my application runs in a linear fashion and will always wait to receive the response from a request before going on to the next (I think). This makes me think that the rate limiting issues I am facing is due to suspicious activity.  I was wondering if you guys could provide more information on how the rate limiting works and maybe could send me an email to discuss how I would need to develop my code around it?   Eric, It sounds like you are doing this correctly and there is a bug somewhere on the network. I've reviewed our server logs, and we only see records of delivering 429 coded responses 767 times in the past month, all more than a week ago. So your hunch may be right, and your requests might be getting caught by our anti-DDoS filters. In order to check, I'd appreciate your help: Can you provide the exact response including all of the headers, when you receive this error? Can you provide sample URLs, your IP address, or your custom user-agent string so we can filter out your specific requests and see what's happening? Thanks!
Two teams I help administer have substantial "dead wood". My first place to look to identify it was via the club members endpoint, which splits club members into three groups: Those active in the club in the last week Those active in the club in the last month Those members ever active in the club. Now that's all well and good, but if I have a smaller team and value players who participate in "important" team matches (e.g. TMCL) they may spend a lot of the year in #3 ("all_time") if: They don't post to notes The club has infrequent news postings. I assume here that making a move in a team match game does not count as activity; it would be good to have more explicit documentation of exactly what does (and does not) count as "activity" but it is practically a side issue, as my hypothetical "important" match player will sometimes have an opponent who doesn't actually play (closes account or times out). I still value my "important match" player so to find if they are active or not, I need to: Check their profile for last_online (which is also rather vaguely defined). If they have not been online for X(*) months then they're "dead wood" If they have been online, then to know if they're playing I need to look back through team matches to find when they played, and vote chess games which I don't think have endpoints yet. It is clearly possible to do both #1 and #2 immediately above, with #1 being trivial and #2 requiring some programming (or work with the JSON capable utilities perhaps). If all_time/monthly/weekly were better defined it would have some value, perhaps. I am interested in what was the last time an administrator did something, when people post to forums and even when people post notes, which is one thing which is documented to bump their activity level. Especially as there are no endpoints to such non-public data as clubs' forums when a club has made those forums private, as most do. I started out writing this post thinking I would propose that the division of weekly/monthly/all_time be scrapped. Instead I am thinking I would like it to stay (even if it is only updated each 24 hours or on some specific events) as I can work out without api.ches.com if I can't find matches they have played in what someone has been doing, by asking them if necessary. *I have seen members purged from clubs for not being active on chess.com (the easiest measure until recently) from as little as one month to as much as eighteen months, with the justification for the latter being a one year sabbatical with some time either side.
Hi, At least for three matches in registered state I am not getting any value for start time. In one match, there is no set start time: https://www.chess.com/club/matches/black-stone/845130 https://api.chess.com/pub/match/845130 Two others have start times according to the website, but they still do not appear at the endpoint: https://www.chess.com/club/matches/black-stone/865180 https://api.chess.com/pub/match/865180 https://www.chess.com/club/matches/black-stone/865924 https://api.chess.com/pub/match/865924 An in-progress match does deliver start_time: https://www.chess.com/club/matches/black-stone/724846 https://api.chess.com/pub/match/724846 I'm calling this a bug as it doesn't match the documentation and there seems no reason not to provide it (empty perhaps if "Ask admin" is what the website displays). It's not high priority however providing all in-progress and finished matches do have their start_time filled in correctly. (Use case: I am writing an activity report. What was the last match a member played in, or is registered for?)
https://api.chess.com/pub/player/Xose1949/games/archives [fine] {"archives":["https://api.chess.com/pub/player/xose1949/games/2014/04","https://api.chess.com/pub/player/xose1949/games/2014/05","https://api.chess.com/pub/player/xose1949/games/2014/06","https://api.chess.com/pub/player/xose1949/games/2014/07","https://api.chess.com/pub/player/xose1949/games/2014/08","https://api.chess.com/pub/player/xose1949/games/2014/09","https://api.chess.com/pub/player/xose1949/games/2014/10","https://api.chess.com/pub/player/xose1949/games/2014/11","https://api.chess.com/pub/player/xose1949/games/2014/12","https://api.chess.com/pub/player/xose1949/games/2015/01","https://api.chess.com/pub/player/xose1949/games/2015/02","https://api.chess.com/pub/player/xose1949/games/2015/03","https://api.chess.com/pub/player/xose1949/games/2015/04","https://api.chess.com/pub/player/xose1949/games/2015/05","https://api.chess.com/pub/player/xose1949/games/2015/06","https://api.chess.com/pub/player/xose1949/games/2015/07","https://api.chess.com/pub/player/xose1949/games/2015/08","https://api.chess.com/pub/player/xose1949/games/2015/09","https://api.chess.com/pub/player/xose1949/games/2015/10","https://api.chess.com/pub/player/xose1949/games/2015/11","https://api.chess.com/pub/player/xose1949/games/2015/12","https://api.chess.com/pub/player/xose1949/games/2016/01","https://api.chess.com/pub/player/xose1949/games/2016/02","https://api.chess.com/pub/player/xose1949/games/2016/03","https://api.chess.com/pub/player/xose1949/games/2016/04","https://api.chess.com/pub/player/xose1949/games/2016/05","https://api.chess.com/pub/player/xose1949/games/2016/06","https://api.chess.com/pub/player/xose1949/games/2016/07","https://api.chess.com/pub/player/xose1949/games/2016/08","https://api.chess.com/pub/player/xose1949/games/2016/09","https://api.chess.com/pub/player/xose1949/games/2016/10","https://api.chess.com/pub/player/xose1949/games/2016/11","https://api.chess.com/pub/player/xose1949/games/2016/12","https://api.chess.com/pub/player/xose1949/games/2017/01","https://api.chess.com/pub/player/xose1949/games/2017/02","https://api.chess.com/pub/player/xose1949/games/2017/03","https://api.chess.com/pub/player/xose1949/games/2017/04","https://api.chess.com/pub/player/xose1949/games/2017/05","https://api.chess.com/pub/player/xose1949/games/2017/06","https://api.chess.com/pub/player/xose1949/games/2017/07","https://api.chess.com/pub/player/xose1949/games/2017/08","https://api.chess.com/pub/player/xose1949/games/2017/09","https://api.chess.com/pub/player/xose1949/games/2017/10","https://api.chess.com/pub/player/xose1949/games/2017/11","https://api.chess.com/pub/player/xose1949/games/2017/12","https://api.chess.com/pub/player/xose1949/games/2018/01"]}
Chess.com computer analysis allows players to locally compute a number of interesting statistics about their games. Since chess.com doesn't do cloud analysis, it makes sense that there are no references to this data in the public API, but I'm still interested in exploring ways to programmatically aggregate performance metrics for a given player. Is chess.com's CAPS calculation proprietary? Is there any way to produce equivalent counts of excellent/good/inaccurate/mistake/blunder, best move %, avg. diff, and CAPS on pgn data accessed through the public api? Alternately, is there any way for an authenticated chess.com user to access saved computer analyses they've already performed or something? Just brainstorming a bit.
Player timeout doesn't match timeout showed in stats on the webpage. For example: https://api.chess.com/pub/match/857950 Player "susenka" - in endpoint timeout=100, but on webpage it is 6.25 Player "stanleymo" - in endpoint 6, webpage 0 Player "partiga" - in endpoint 13, webpage 0 Player "maxspachta" - in endpoint 100, webpage 15.76
Dale00007 Jan 8, 2018
Hi, This is not specific to a single endpoint so I am starting a new thread. The match endpoint (today I am interested in matches in "registered" state, to see how balanced they are) is going I believe to give me all I need. For reference to save people who haven't memorised the whole API from hopping about too much, I start here: https://www.chess.com/news/view/published-data-api#pubapi-endpoint-club-matches with "registered": [ /** List of matches */ { "name": "match name", //the team match name "@id": "URL", // URL pointing to the team match endpoint "opponent": "https://api.chess-dev.com/pub/club/testing-teams", // URL pointing to the opponent club endpoint } ] Along the way, however, I noticed this inconsistency. For the team match endpoint https://www.chess.com/news/view/published-data-api#pubapi-endpoint-match-profile the first two documented items of data are very useful information: "name": string, "url": "URL", // the URL of the match on the website I can see using the name and URL in any human viewable output. Then I moved to the opponent: https://www.chess.com/news/view/published-data-api#pubapi-endpoint-club-profile "name": "string", // the human-readable name of this club Nice. But the only URL I get is @id: "@id": "URL", // the location of this profile (always self-referencing) If it is always OK simply to substitute "https://www.chess.com" for "https://api.chess.com/pub" in this instance so that https://api.chess.com/pub/club/asger-s-great-viking-warriors becomes https://www.chess.com/club/asger-s-great-viking-warriors all is well. In that case, however, why provide "url" in the team match endpoint but not in the club profile endpoint? Granted this is a small point, but either the url is extra work on your side that might one day prove restrictive and might as a "Breaking Change" go away, or if it's so stable and desirable enough might it be propagated to more endpoints? I note in passing that working from @id is going to be much more reliable than working from "name" as the conversion from human readable club names to as-used on the webite process is lossy. A couple of examples: "Asger's Great Viking Warriors" → asger-s-great-viking-warriors "France/Deutschland Group" → francedeutschland-group "A.R.C." → a-r-c The forward slash is lost in the second example, and the first and third show three different characters (apostrophe, space and period) all being converted to a hypen. Plus there is the case folding. This isn't a bug report, but I suppose it's an enhancement request. I can see (from my own development days) taking the request "make it consistent" and removing "url" from endpoints where a translation of @id will work, or alternatively providing "url" almost anywhere it is reasonable. The former is probably less work, and the latter better insulates users of api.chess.com from changes in namespace rules on the website that aren't mapped identically to changes in endpoints. Anyway, having fun, and now having been distracted and written this up I'll go back to what I was doing, which was actually using the endpoints. Thanks, Giles
Trying to get a PGN for month 2018/01 - no data populated. https://api.chess.com/pub/playe/playername/2018/01 comes up empty.
How frequently are API data for the list of club matches updated? Does it use the same database as live or is there some delay, which you are aware? My problem is that I still don't see match: https://www.chess.com/club/matches/860030 in list club matches list endpoint https://api.chess.com/pub/club/sk-slavia-praha/matches On the other hand club match endpoint is already available: https://api.chess.com/pub/match/860030 The match has been created about 1hr ago.
andreamorandini Jan 7, 2018
I was not checking my scripts for some time and today I noticed that from 9th Oct, all my script requests fail with 429. For example, there is the list of latest errors. If I try the same URL from the browser that it works properly. I am accessing data sequentially (not parallerly). Any idea, what is wrong? Thanks. Error URL 2017-10-12 22:33:41 429 https://api.chess.com/pub/club/team-prague/members 2017-10-12 22:33:41 429 https://api.chess.com/pub/club/team-of-the-czech-republic/members 2017-10-12 22:33:41 429 https://api.chess.com/pub/club/sk-slavia-praha/members 2017-10-12 22:30:49 429 https://api.chess.com/pub/player/fvladimirf/games 2017-10-12 22:30:48 429 https://api.chess.com/pub/player/fredthered
Dale00007 Dec 20, 2017
Hi, A corner case question I imagine, but in the case of someone changing their username and chess.com continuing to supply player_id in the Profile endpoint, will archived games fetched with the new username (the only way to access them) contain the old or new username? The question is not an idle one: if the old username appears it won't be recognised as a game by the player whose games are being sought, therefore the PGNs should change. A definite argument for retrieving games when wanted and not caching them "too long" for whatever "too long" is. Giles (who changed his username at signup when he made a typo, and before playing a game )
Being aware that SSL negotiation can take some time, I dug around and found out how to request connection caching when using perl and its LWP module. For perl, it turns out the trick is to add: use LWP::ConnCache; and once you have your user agent: $ua->conn_cache(LWP::ConCache->new()); A reference is: http://search.cpan.org/dist/libwww-perl/lwptut.pod In very casual testing those two lines cut my download of a member's game archive from 59s to 24s, each time the average of three requests for a user with twelve months of archives, with gaps. (Ten previous months, the current month, plus current (unfinished) daily games.) The CPU time this end doesn't matter; I don't know if it does or not to chess.com at their end. Quite possibly not. I am pleased with the reduction in wall-clock time, which will only increase if I'm digging at teams with ~1000 players and then need to look up the player profiles, or working through a particular nationality and need some statistics for a player.
Hi, This may be related to the missing archives (reportedly and apparently fixed) or not. In case not and as the observed behaviour is different I'm starting a new thread. $ ls -l total 15288 -rw-r--r-- 1 giles staff 4835 15 Dec 16:45 Anton_Demchenko-2014-04.pgn -rw-r--r-- 1 giles staff 522851 15 Dec 16:45 Anton_Demchenko-2015-09.pgn -rw-r--r-- 1 giles staff 85856 15 Dec 16:45 Anton_Demchenko-2015-10.pgn -rw-r--r-- 1 giles staff 189874 15 Dec 16:45 Anton_Demchenko-2015-11.pgn -rw-r--r-- 1 giles staff 118856 15 Dec 16:45 Anton_Demchenko-2015-12.pgn -rw-r--r-- 1 giles staff 32542 15 Dec 16:45 Anton_Demchenko-2016-01.pgn -rw-r--r-- 1 giles staff 550461 15 Dec 16:45 Anton_Demchenko-2016-02.pgn -rw-r--r-- 1 giles staff 99999 15 Dec 16:45 Anton_Demchenko-2016-03.pgn -rw-r--r-- 1 giles staff 221706 15 Dec 16:45 Anton_Demchenko-2016-04.pgn -rw-r--r-- 1 giles staff 242203 15 Dec 16:45 Anton_Demchenko-2016-05.pgn -rw-r--r-- 1 giles staff 62005 15 Dec 16:45 Anton_Demchenko-2016-06.pgn -rw-r--r-- 1 giles staff 285218 15 Dec 16:45 Anton_Demchenko-2016-07.pgn -rw-r--r-- 1 giles staff 0 15 Dec 16:45 Anton_Demchenko-2016-08.pgn -rw-r--r-- 1 giles staff 489554 15 Dec 16:45 Anton_Demchenko-2016-09.pgn -rw-r--r-- 1 giles staff 28960 15 Dec 16:45 Anton_Demchenko-2016-10.pgn -rw-r--r-- 1 giles staff 37458 15 Dec 16:45 Anton_Demchenko-2016-11.pgn -rw-r--r-- 1 giles staff 70454 15 Dec 16:45 Anton_Demchenko-2016-12.pgn -rw-r--r-- 1 giles staff 572963 15 Dec 16:46 Anton_Demchenko-2017-01.pgn -rw-r--r-- 1 giles staff 766271 15 Dec 16:46 Anton_Demchenko-2017-02.pgn -rw-r--r-- 1 giles staff 938095 15 Dec 16:46 Anton_Demchenko-2017-03.pgn -rw-r--r-- 1 giles staff 99895 15 Dec 16:46 Anton_Demchenko-2017-04.pgn -rw-r--r-- 1 giles staff 149850 15 Dec 16:46 Anton_Demchenko-2017-05.pgn -rw-r--r-- 1 giles staff 97403 15 Dec 16:46 Anton_Demchenko-2017-06.pgn -rw-r--r-- 1 giles staff 321601 15 Dec 16:46 Anton_Demchenko-2017-07.pgn -rw-r--r-- 1 giles staff 710859 15 Dec 16:46 Anton_Demchenko-2017-08.pgn -rw-r--r-- 1 giles staff 93734 15 Dec 16:46 Anton_Demchenko-2017-09.pgn -rw-r--r-- 1 giles staff 334332 15 Dec 16:46 Anton_Demchenko-2017-10.pgn -rw-r--r-- 1 giles staff 638009 15 Dec 16:46 Anton_Demchenko-2017-11.pgn -rw-r--r-- 1 giles staff 0 15 Dec 16:46 Anton_Demchenko-2017-12.pgn
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" right now. Bottom line: can the "gap" between last month and unfinished games be filled, please?
Not all available archives are listed for @tombulous. It would seem the archives stops on December 2010 https://api.chess.com/pub/player/tombulous/games/archives
$ lwp-dump https://api.chess.com/pub/player/skelos 500 Can't verify SSL peers without knowing which Certificate Authorities to trust Content-Type: text/plain Client-Date: Sun, 03 Dec 2017 06:29:34 GMT Client-Warning: Internal response Can't verify SSL peers without knowing which Certificate Authorities to trust\n This problem can be fixed by either setting the PERL_LWP_SSL_CA_FILE envirionment variable or by installing the Mozilla::CA module.\n To disable verification of SSL peers set the PERL_LWP_SSL_VERIFY_HOSTNAME envirionment variable to 0. If you do this you can't be sure that you communicate with the expected peer.\n That error didn't repeat when I tried again. Mentioning it here, but I don't really know what happened behind the scenes for CAs when I installed a SSL module for perl, but it did report at the time recognising a number, so I assume the keys were shipped with the code. Why https://api.chess.com would give an error and then immediately return to working I don't know.
Hi, At a quick look at some downloaded current games, it's entirely clear to me how to pick out: team match games tournament games "Let's Play" games given a title I am also interested in whether games are rated or not. In particular, I would like to exclude unrated endgame tournament games from some analysis as the player will play the same position from each side multiple times. Picking out win/loss/draw is easy. Timeouts are OK as long as chess.com's PGN output remains consistent. Non-standard (and non-960) openings can be detected from the FEN, and while an amount of work "book" (for thematic tournaments) and non-book positions can be worked out if necessary via access to a suitable opening book. (That is if thematic matches/tournaments start with a FEN and not with a number of book moves the players didn't actually make.) I think I'm left with team match vs. tournament (which I'll look into some more) (any "Let's Play" game with a title will be rare; I care, but not a lot) and rated vs. unrated which I think I have a problem with.
Hi. Thanks for releasing this API, this is really cool and I am looking forward getting more API calls available (e.g. PGN, and capability of course to send moves). Today, I have played a little bit with the API to get JSON results with curl and parse it with JQ parser (https://stedolan.github.io/jq/) and I thought it could be good to share my few lines of codes using with you. I may inspire others... NB: please change the environment variable $CHESSCOM_USERNAME to your own username in the code below Example #1: get my games of the current month $ CHESSCOM_USERNAME="pmaugeri" $ curl -k https://api.chess.com/pub/player/$CHESSCOM_USERNAME/games/`date +%Y`/`date +%m` Example #2 (with JQ): get only the "3day" time-class games of the month $ curl -k https://api.chess.com/pub/player/$CHESSCOM_USERNAME/games/`date +%Y`/`date +%m` | jq '.games[] | select(.time_class=="3day")' Example #3: return only the fen field $ curl -k https://api.chess.com/pub/player/$CHESSCOM_USERNAME/games/`date +%Y`/`date +%m` | jq '.games[] | select(.time_class=="3day") | .fen' Example #4: return only the games I won $ curl -k https://api.chess.com/pub/player/$CHESSCOM_USERNAME/games/`date +%Y`/`date +"%m"` | jq --arg USERNAME $CHESSCOM_USERNAME '.games[] | select(.time_class=="3day") | (select(.white["result"] == "win" and .white["@id"] == "https://api.chess.com/pub/player/"+$USERNAME )), (select(.black["result"] == "win" and .black["@id"] == "https://api.chess.com/pub/player/"+$USERNAME )) | .fen'