EDIT Should have looked at the exception, it's because of usage limits: [Error [WebapiError]: Too Many Requests] { statusCode: 429 } Where can I find out about the usage limits? I'm trying to figure out the number of cheaters per country, so Ive written a small application to do just that which connects to the chess-web-api. Basically, it gets all the member names per country (in this case Pakistan). Then it sends a request for player information for each member and checks the members status. If the member has a status of 'closed:fair_play_violations' then it is counted as a cheater It works for small numbers (e.g. 100 players).. but I get about 500 errors if I go for say 3000 members. The repeated call to getPlayer fails about 500 times if I have 3000 members. see code screenshot below and actual code pasted below that. Ive added a member into the list who is a known cheater just for test purposes (ajtheboss1709) Anyone know why I get errors? Is there a quota limit that Im failing? Ideas how to solve? Written in javascript var ChessWebAPI = require('chess-web-api'); var chessAPI = new ChessWebAPI();countCheaters().then(() => {console.log('Finito')}) async function countCheaters() {const res = await chessAPI.getCountryPlayers('PK')const players = res.body.players const subPlayers = players.slice(0, 3000)const cheaters = await getCheaters(subPlayers) console.log('Number of cheaters = ', cheaters.length);} async function getCheaters(subPlayers) {subPlayers.push('ajtheboss1709')const res = await Promise.all(subPlayers.map(async sp => {try {const player = await chessAPI.getPlayer(sp)return {player: sp, cheater: player.body.status === 'closed:fair_play_violations' ? 'Y' : 'N'}} catch (ex) {return {player: sp, cheater: 'UNKNOWN'}}})) console.log('unknown = ' + res.filter(r => r.cheater == 'UNKNOWN').length) return res.filter(r => r.cheater == 'Y')}
Avatar of Storms-Fast
Storms-Fast Jan 22, 2021
I am busy collecting some specialised data for chess 960 matches from the API and came across the following curiosity: In the player stats endpoint (https://api.chess.com/pub/player/{username}/stats) the entries "chess_daily" / "record" / "timeout_percent" and "chess960_daily" / "record" / "timeout_percent" are always the same (for those players that have a chess 960 record). Is this a bug? Or is it simply not possible to discriminate between timeouts in normal games and chess 960 games?
Hi All, This may be quite a basic question as I am fairly new to REST APIs. How often does the endpoint that gives club members refresh? Is there a way to tell? I see the documentation says: "Please note: The endpoints refresh at most once every 24 hours, if not noted otherwise." but it doesn't give an "at least" guarantee.The endpoint pattern is: https://api.chess.com/pub/club/{url-ID}/members if that is relevant. Is there at least a rule of thumb? I am wanting to use this with some software for assisting with running a tournament.
Avatar of Tricky_Dicky
Tricky_Dicky Jan 18, 2021
I would like a URL which I can type into my browser and the output is my Rapid Rating. I know its super simple but I keep getting {"code":0,"message":"An internal error has occurred.} My URL so far is https://api.chess.com/pub/player/erik/stats/chess_rapid.
Avatar of MiniMitre
MiniMitre Jan 16, 2021
I would find the following changes useful New endpoint that returns all closed accounts per country (the current endpoint only returns active accounts); preferably in a paged fashion (100k at a time, ordered by player_id) Endpoint that returns all 'players' per country in a paged fashion ordered by player_id i.e. you can request say 100,000 players at a time rather than the full shabang (the US times out if you request all players) New endpoint that returns player details in batches; e.g. you pass in 100 member names and get a response that contains 100 player details (e.g. array / one JSON object keyed on player name) For accounts that have a status of 'closed:fair_play_violations' - also add details of the violation; e.g. engine or sandbagging
Avatar of Storms-Fast
Storms-Fast Jan 12, 2021
Hello everyone, Apologies if this has been asked before, but I'm having trouble with accessing the player lists of some countries like the US and UK, and I'm assuming that's due to the size of those lists. Does anyone have any ideas about the cause of the problem and solutions or workarounds? Thanks!
Hello,thank you for the great API.I am wondering if there is possible to query only one game based on the chess.com id. Is it a possibility to do https://api.chess.com/pub/game/292659724?Thank you in advance.
Avatar of elmsakni
elmsakni Jan 7, 2021
Is it possible to add new timestamp "end_time" in this api: https://api.chess.com/pub/club/team-usa-southwest/matches I didn't find it else where...
Avatar of multivac
multivac Jan 5, 2021
I want to make a Python program that makes a graph for members per day using this API: https://api.chess.com/pub/club/the-golden-64-squares/members. How can I do this?
Avatar of RAD_Financials
RAD_Financials Jan 3, 2021
Hi, maybe I can't find the correct endpoint, but I want to get information about the current game a player is playing (not in a tournament). So, for example, if someone is playing 10min rated, that I can get information on which color he is, duration etc. Is there an endpoint for this?
Avatar of APISTOTELHS
APISTOTELHS Dec 29, 2020
End point https://api.chess.com/pub/match/live{ID} Missing spec for maximum and minimum rating setting in match. (Should max_team_players also be included?) "settings":{ "rules":"chess", "time_class":"standard", "time_control":600, "time_increment":2, "min_team_players":1, "min_required_games":0, "autostart":false
Avatar of Tricky_Dicky
Tricky_Dicky Dec 28, 2020
Hi there! I have coded a discord bot just for fun using the chess web API. I have used node JS and Typescript. The most important NPM libraries I have used are discordjs and chess-web-api. You can get a player profile or the stats from a player by inserting a few commands. I have parsed the response so it looks beauty. Player profile: Player stats: The library chess-web-api has no types so I have create the interfaces for the responses. The possibilities are huge, if anyone have any idea please share! Responses are in spanish, sorry for that. Github repo: https://github.com/pablomendezroyo/chess-bot
Avatar of Tanjirou0
Tanjirou0 Dec 25, 2020
Howdy, Does anyone have a example of using R language with the API? TIA, David
Avatar of davidjayjackson
davidjayjackson Dec 18, 2020
Hey everyone, I made https://howmanymasters.com to see how many titled players you've beaten. Check it out!
I've been trying to download the match archive for this club ... https://www.chess.com/club/chess-school ..but I keep getting an HTTP 500 error. Although the club has a history of playing matches, it seems the endpoint isn't available? At least that's what I'm seeing when I enter the URL into the address bar of my browser... https://api.chess.com/pub/club/chess-school/matches I receive back... {"status":"error","message":"Internal Server Error"}
I noticed that some of my pgn downloads from the past week are missing some fields compared to my pgns from a couple months ago. Some of the missing fields are CurrentPosition, Timezone ,ECO, ECOUrl, UTCDate, UTCTime "23:04:15". I'm particularly interested in having the ECO code. I'm getting these pgns from selecting from my daily games and clicking on the download button. Does anyone know if there are plans to restore these fields, and if not is there some other way I can get this data? Thanks.
Avatar of Tricky_Dicky
Tricky_Dicky Dec 16, 2020
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?
Avatar of stephen_33
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!
Avatar of stephen_33
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!
Avatar of stephen_33
stephen_33 Dec 11, 2020
Admins