TL;DR
The Chess.com published API provides access to public Chess.com data including player profiles, ratings, game archives, tournament results, club information, and daily puzzles. Query any player by username to get their stats across all time controls (bullet, blitz, rapid, daily). Game archives let you download PGN-format games by month. No API key required.
Quick start: https://api.chess.com/pub/player/hikaru
No API key needed — free chess data!
How to Use This API
1. Get Player Profile
Returns profile info for a Chess.com player by username:
https://api.chess.com/pub/player/hikaru
2. Get Player Stats and Ratings
https://api.chess.com/pub/player/hikaru/stats
3. Get Monthly Game Archive
https://api.chess.com/pub/player/hikaru/games/2024/01
4. JavaScript — Display Player Stats
fetch('https://api.chess.com/pub/player/hikaru/stats')
.then(r => r.json())
.then(stats => {
const formats = ['chess_blitz', 'chess_bullet', 'chess_rapid', 'chess_daily'];
formats.forEach(f => {
if (stats[f]) {
console.log(`${f}: ${stats[f].last.rating} (best: ${stats[f].best.rating})`);
}
});
});
5. Python — Analyze Recent Games
import requests
# Get last month's games for a player
username = 'magnuscarlsen'
games = requests.get(
f'https://api.chess.com/pub/player/{username}/games/2024/01'
).json()
for game in games['games'][:5]:
white = game['white']['username']
black = game['black']['username']
result = game['white']['result'] if white == username else game['black']['result']
print(f"{white} vs {black}: {result}")
print(f" Time: {game['time_control']}, Rated: {game['rated']}")
Player "hikaru":
https://api.chess.com/pub/player/hikaru
Frequently Asked Questions
- What player data is available?
- Profile: username, name, location, avatar, join date, league, and status. Stats: ratings for bullet, blitz, rapid, daily, and tactics, plus record (wins, losses, draws) and best ratings.
- How do I get a player's games?
- Use
/pub/player/{username}/games/{year}/{month}to get all games for a specific month. Thearchivesfield in the player profile lists all available monthly archives. - What format are games returned in?
- Games are returned as JSON with PGN notation, player information, timestamps, time control, and results. The
pgnfield contains the full game in standard PGN format. - Does it cover tournaments?
- Yes —
/pub/player/{username}/tournamentslists tournaments a player has participated in./pub/tournament/{url-id}gives full tournament details including round-by-round results. - Are there any rate limits?
- No documented rate limits, but please be reasonable. The API is free and open for public data. Caching responses is recommended for frequently accessed data.
- Can I get daily puzzle data?
- Yes —
/pub/puzzlereturns today's daily puzzle with the FEN position, solution moves, and themes./pub/puzzle/{date}gets puzzles from specific dates.
API Details
- API URL
https://api.chess.com/pub/- Documentation
- Chess.com Published Data API
- Category
- Entertainment
- Authentication
- Not Required
- Data Coverage
- All public Chess.com player data
What You Can Build
- Chess player dashboard showing rating history across time controls
- Game analyzer downloading and processing PGN data for study
- Tournament tracker showing live results for ongoing events
- Head-to-head stats comparing two chess players
- Daily puzzle widget displaying the puzzle of the day