Chess.com

Entertainment API · Chess data · Player stats · Game archives · Tournaments

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. The archives field 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 pgn field contains the full game in standard PGN format.
Does it cover tournaments?
Yes — /pub/player/{username}/tournaments lists 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/puzzle returns 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