Hello, a very helpful and friendly member named @APISTOTELHS recently helped us figure out a script, to be entered in the Firefox Console, which returns all usernames in a club. var request = new XMLHttpRequest();request.open('GET','https://api.chess.com/pub/club/the-chess-elite/members',false);request.send();var response = JSON.parse(request.responseText);var list = '';for(type in response)for(member of response[type])list += member.username + '\r\n';console.log(list); We are now facing a new problem, and require a minor modification to the previous code. What we would like to achieve: Extract all usernames, but from those who were "Most Recently Online" You can display only the members who were most recently online via this box: Here an example in full view, from this club: How could we do that with the script?
stephen_33 Dec 13, 2020
I'm not sure how widely known it is that a club's Live team matches are now included at the end of the list of 'finished' matches in the club matches endpoint? You'd certainly be forgiven for missing this after reading the documentation:- Club Matches Description: List of daily and club matches, grouped by status (registered, in progress, finished).URL pattern: https://api.chess.com/pub/club/{ID}/matches { "finished": [ /** 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 "result": "win", // see "Game results codes" section "start_time": 1305324926, // timestamp of the match start "time_class": "daily" } ], "in_progress": [ /** List of matches */ I completely missed what was meant by 'List of daily and club matches' & wasted some time trying to obtain useful Live match data by other means. And the "time_class" of "daily" gives the clear impression that only Daily matches are included. So could the documentation please be updated to reflect the fact that both Daily & Live matches are included within the 'finished' category?
Howdy! Is there a limit on the number of games I can analyze with the "Game Report" feature for the Gold, Platinum, and Diamond memberships?I know on the free account you get 1 Game report per day. So on premium ones is it like 100, 200, or unlimited per day?Thanks!
stephen_33 Dec 13, 2020
Hello chess.com developer community! I'm currently in a training program for Big Data. For my first project, I'm hoping to write a simple application for reading and analyzing chess games. It looks like I can use chess.com to acquire this data which is obviously the first step, however, I'm not sure how to go about it. Tips for how to begin this process would be much appreciated! Essentially my application will just be reading in chess game data, and organizing that data into a database. It may do other things but that's the starting point at least. Thanks!
stephen_33 Dec 11, 2020
This has two parts: Part A. There are some people who yes cheat but some people get there accounts randomly closed because they played 10-sec and they lost to many consecutive games. This could be improved by changing the computers code for picking it up. Part B. There has been a sudden increase also in hackers, trolls, and People Who Are Using Chess.com As A Platform for Evil. I would like it if chess.com could make a system that moderates all messages and chats. This way we could limit this. Also a system for detecting spamming and advertising too. Thank you. Xhive24
Tricky_Dicky Dec 10, 2020
In 2 clubs, a member made a graph of members. He said he is using a chess.com API to do this. How can I do it too? I am very curious
Request For Comments: New country endpoints As an RFC, we are publishing our plans in the hope that you would provide constructive criticism to help us make it better before it is created. We plan to publish an RFC for each major collection of endpoints.   A common request is to be able to look up players in a country, and players which are active (see this forum thread). This Published-Data API provides only data that has been prepared before you ask for it, so it cannot provide custom searches. These new country endpoints attempt to supply the per-country and active-player lists requested in one data set that should be fast to download for most countries (we estimate that the largest data set, for the USA, would be about 2Mb; most would be a few Kb to download). This is not intended to replace the Player Stats, such as ratings, timeouts, etc., but only to support certain collection processes that you currently use.   /pub/country/{XX} Where "XX" is the 2-letter country code. The data response will be: "@id" of its own URL "code" is the 2-letter country code "name" is the English name Future additions to this country data may include translated names, flag URLs (same as we display on this site), and possibly other data. We do not intended this to be a Wikipedia entry! This is only for the purpose of allowing automated tools to recognize groups of players by self-stated nationality. The Player Profile data format will be updated so that the "country" field is a URL pointing to this endpoint.   /pub/country/{XX}/players Where "XX" is the 2-letter country code. The response is a simple array named "players", consisting of username-based PlayerProfile URLs of enabled users who have logged in over the past 7 days. Because this lists URLs, your client should be able to link to each player profile as needed to collect any required information. In the future, based on that URL you will be able to retrieve more player stats. This list can get large for certain countries with a lot of active players. As such we do not anticipate adding additional player data on this endpoint; you will need to request the relevant data from the Player Profile. You will need to filter the data yourself, to remove players you already have data for.   Both endpoints will update their data no more often than once per day. This is not useful for determining who is online.
aliadoprimo Dec 6, 2020
Making the request `GET /player/:user/tournaments` only returns Swiss tournaments. Is there any request I can make to get hold of arena tournaments?
There are multiple swiss and arena types of tournaments but what could really set Chess.com different from all the rest of the chess websites out there is creating live knockout tournaments!!!
Tricky_Dicky Dec 6, 2020
i know this isnt a suggestion club but it would be nice for non forum posts to have the code editor feature and for descriptions and stuff to have them along with more languages because i suck at html
I am building a map of countries I've played opponents from. I have a rather extensive history (30,000 games) and can get the list of games easily enough, but to get the country of the opponents it seems I have to make an individual request, per player, to get it. Gak.I thought about using the "country players" endpoint (https://api.chess.com/pub/country/{iso}/players) to just fetch as many players as possible, but that seems pretty idiotic. Any other suggestions?
gullupakka Nov 29, 2020
Can we please have some kind of access to open challenges for a player. This would help those of use creating commands for chatbots for streamers to do things like show a queue of people who have challenged a player.
tryingtolearn1234 Nov 29, 2020
Hi everyone, When integrating with the API, I noticed inconsistencies across API calls when returning white and black values. For example, for `Current Daily Chess`, the documentation tells us that white/black is a string. But then for `Daily Team match board`, white/black is suddenly an object containing more information (username, rating, etc.). Ok, this doesn't make much sense to me but I can live with it, I just need to use different classes for different calls. Today, I encountered sometimes way worse. Inconsistencies within the same endpoint. When calling the `Tournament's round group` endpoint, `games` contains white/black values that are documented to be string. But depending on which tournament you are calling it for, a string or a complex object will be returned. For example, for this call, the response contains {"url": "https://www.chess.com/game/daily/138891582",..."white": {"rating": 1428,"result": "insufficient","@id": "https://api.chess.com/pub/player/rockaround","username": "Rockaround"},"black": {"rating": 1533,"result": "insufficient","@id": "https://api.chess.com/pub/player/mrtn","username": "mrtn"},"tournament": "https://api.chess.com/pub/tournament/-33rd-chesscom-quick-knockouts-1401-1600"} Ok, that means the documentation is wrong but whatever. What is seriously wrong is that if you make the exact same call for this tournament, you'll get the following: {"url": "https://www.chess.com/game/daily/289647422",..."white": "https://api.chess.com/pub/player/rainbowsandcastle","black": "https://api.chess.com/pub/player/mainak_roy",...} Am I missing something? Could this be fixed? This makes it very hard to integrate with the API...
I used the code below to pull my games archives but it stopped working recently. I'm not very literate so I can't tell whether it's something with the Python library or the chess.com API. This is part of the error message I get: Traceback (most recent call last):File "C:/Users/Bob/Desktop/chess.py", line 9, in <module>f = urllib.request.urlopen(archivesUrl)File "C:\Users\Bob\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 222, in urlopenreturn opener.open(url, data, timeout) Here is the code I was using: import urllibimport urllib.request username = "BobChess" #changebaseUrl = "https://api.chess.com/pub/player/" + username + "/games/"archivesUrl = baseUrl + "archives" #read the archives url and store in a listf = urllib.request.urlopen(archivesUrl)archives = f.read().decode("utf-8")archives = archives.replace("{\"archives\":[\"", "\",\"")archivesList = archives.split("\",\"" + baseUrl)archivesList[len(archivesList)-1] = archivesList[len(archivesList)-1].rstrip("\"]}") #download all the archives#indent all lines below except first and last onesfor i in range(len(archivesList)-1):url = baseUrl + archivesList[i+1] + "/pgn"filename = archivesList[i+1].replace("/", "-")urllib.request.urlretrieve(url, "C:/Users/Bob/Desktop/Chess/" + filename + ".pgn") #changeprint(filename + ".pgn has been downloaded.")print ("All files have been downloaded.")
stephen_33 Nov 24, 2020
please make it so that club owners are MODs in there own club (e.g can remove mentions and links)
About a week ago I started to receive 403 error for all calls to player resources. Other resources like club matches, club members etc. works without issue. API accessed directly from browser (ie. https://api.chess.com/pub/player/0nvm) works fine, but if accessed from the applications it fails with 403. Last attempt was right now at 5:52pm UTC. Does anybody have the same problem? @erik, @bcurtis: is it possible to check the issue? Thanks in advance.
i am completely new to coding and i have just started. i work with python. can i extract data from chess.com such as daily match live scores of my club? if so, how can i do so? can someone please tell me?
APISTOTELHS Nov 14, 2020
Are there any plans to add a stable user identifier? I’ve noticed that the API frequently uses usernames, and I didn’t see any obvious way of knowing when a user has changed their username. If there aren’t plans to add a stable user identifier, maybe an endpoint that allows tracking username changes would be a nice enhancement. I’ve had this problem on the website as well where I know a person’s old username and go to look them up but can’t find them because it’s changed. If I’m lucky, I can find the new username by locating a game I know I played against them and seeing what the username changed to, but that’s rather tedious.
kraunak60 Nov 12, 2020
It looks like something's changed with the public API, or perhaps I've been blacklisted !?? When making club and country requests, I get a 403 Forbidden response. Is it something about the HTTP header I'm sending? This hasn't changed for a while, and it includes my email and chess.com username.. But is there a specific preferred format for these fields in the header? It looks like I can make similar requests via curl, where the header is not specified.
davidFreelance Nov 10, 2020
So I am interested in processing my bughouse games from chess.com. Is there a way with the chess.com REST API to fetch the partner's game? I see there are timestamps available, which would be helpful to see the available pieces to drop at any given time.