The games played today (and the last of the day before) are missing from the monthly archives. Api : https://api.chess.com/pub/player/Revaes/games/2018/02 Website: https://www.chess.com/games/archive The last game shown in de api was played on feb 7th 15h03, while the last game played was feb 8th around 11h15
The current endpoint for fetching tournaments does not seem to accept live tournament ids. I would really appreciate the ability to fetch information about these live tournaments, as well as the final standings upon completion. Is this something I could expect to see implemented in the future?
Avatar of andreamorandini
andreamorandini Feb 5, 2018
This Request For Comments covers four new endpoints to describe a Club and its membership. Clubs will be referenced by their "url" value, which is the unique string used for their URL on the website.   /pub/club/{url} This is the data representation of the club itself. The data response will include: "@id" : based on the url "name" "club_id" : the internally-used, never-changing numeric ID "country" : URL to the country endpoint the Club identifies itself as part of"location" (may be null) "created" : timestamp of the time created "last_activity" : timestamp of the time of the last news, forum, or other activity (used to see if there is "new" content) "admin" : array of player profile URLs for admins and super-admins of this club "visibility" : either "private" or "public", based on if the Club is private "join_request" : URL to request joining the club "icon" : the group image (may be null) "description" : full text description (may be empty string, and may be quite long)   /pub/country/{XX}/clubs An array of club endpoint URLs per country. Updated once per day, like other country endpoints.   /pub/club/{url}/members An array of player profile endpoint URLs per club. Updated once per day, like the country endpoints.   /pub/player/{username}/clubs An array of club endpoint URLs per player. Updated once per day, like the country endpoints.     Club stats and games will be described in future RFCs.
Hi everyone, I think I found all of the issues from my rough start. The site is now reopen for beta testing. Issues found and fixed: Unable to log in after subscribing - member insert function fixed. Records missing - found decoder and parser error. Actually completely rewrote the JSON decoder and parser function and now it is working better than before. Records update - rewrote the update function based on the new iteration of the decoder and parser function. Opponent average rating stats were incorrect - found errors in query and fixed. Added a new breakdown - by tournament stats. The web address is https://www.chessalytics.com Please dont be afraid to provide with honest feedback. Thanks for all of your help.
Hi, This time I promise I've a real live discrepancy between the documentation and what the match endpoint delivers. Documented: "teams": [ "team1": { "@id": "URL", // API URL for the club profile "name": "string", // club name The @id is provided but "name" is not. I think I'd like to have it rather than the documentation be updated to delete "name" as in user-visible reports the name will mean a lot more than @id (and there is no @url either, as has been discussed elsewhere). Cheers, Giles
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
Avatar of Dale00007
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.
Avatar of andreamorandini
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
Avatar of Dale00007
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
Admins