Skip to the content.

ChessStats for chess.com

About

ChessStats is a console app used to retrieve monthly play time, ratings and top openings for any Chess.com user. Note that variant game types are not included in the stats (displayed as ‘X’ during game retrieval) and unrated game (‘NR’) information is time only.

The HTML reports generated are standalone with all assets (images/fonts) embedded in the page. This means they can be sent to others, or indeed just opened as a document.

Personally, I sync my ChessStats folder with dropbox so I can read the reports directly on my tablet from the Dropbox app.

Installation

Download the latest version from the Releases page, extract ChessStats.exe/ChessStats and put it where you want it to go. Note that the cache and reporting directories are created relative to the executable’s location.

Usage

chessstats [chessdotcom username]

or

chessstats -refresh

or just double click the exe and you will be prompted for a Chess.com username.

Sample Run

Docker

Every release publishes a container image for linux/amd64 and linux/arm64 to the GitHub Container Registry. It runs ChessStats, refreshes the reports on a schedule and serves them with nginx, so a single container is enough to publish a set of players’ stats.

docker pull ghcr.io/hyper-dragon/chessstats:latest

The package is public, so no registry login is needed. Use a version tag (ghcr.io/hyper-dragon/chessstats:0.8.3) if you want a fixed release; latest follows the most recent one. The image contains a self-contained single-file build of the tool on top of the .NET runtime dependencies, so nothing else has to be installed.

Running it

docker run -d --name chessstats \
  -p 18080:80 \
  -e CHESS_USERS="Hyper-Dragon GothamChess" \
  -v chessstats-results:/app/ChessStatsResults \
  -v chessstats-cache:/app/ChessStatsCache \
  ghcr.io/hyper-dragon/chessstats:latest

Then browse to http://localhost:18080/ for the index page. The first report is generated on start, so allow a few minutes on an empty volume - docker logs -f chessstats shows the progress.

Environment variable Default Purpose
CHESS_USERS (empty) Space separated usernames to report on. Each one is created as a directory under /app/ChessStatsResults.
REFRESH_INTERVAL 86400 Seconds between refreshes.
Volume Contents
/app/ChessStatsResults The generated reports and index.html - this is what nginx serves.
/app/ChessStatsCache The downloaded monthly game archives, so restarts do not re-download history.

Choosing the accounts

A directory under /app/ChessStatsResults is an account to report on - -refresh works from that directory list. CHESS_USERS simply creates those directories at start up, so either approach works, and pre-seeding the volume is the more declarative of the two:

docker run --rm -v chessstats-results:/results alpine \
  sh -c "mkdir -p /results/Hyper-Dragon /results/GothamChess"

Use the spelling Chess.com reports for the account (the name in its profile URL). A directory seeded in a different case is adopted and renamed, so hyper-dragon becomes Hyper-Dragon on the first run. Removing an account is just removing its directory.

Notes

Offline Reports & Network Access

Every report is a single self-contained HTML file: graphs, images, fonts and CSS are all embedded, so it can be copied anywhere and opened without a network connection.

To make that possible the report graphics (the player placeholder image, the heading icon and the Montserrat 700/800 fonts) are compiled into the executable as embedded resources instead of being downloaded at run time. Chess.com retired the CDN those files used to be served from, which previously made every run fail with 521 before any data had been retrieved (issue #27).

The only network access during a run is the Chess.com public API itself, plus the player’s avatar - and if that avatar cannot be downloaded the built-in placeholder is used instead.

Version History

Version 0.8.3

Version 0.8.2

Version 0.8.1

Version 0.8

Version 0.7

Version 0.6

Version 0.5

Version 0.4

Known Issues

License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to unlicense.org.

Saying Thank You

If you find this useful and want to say thanks just send me a fun trophy or two or three over on chess.com. If you find it really useful then consider hitting the donate button at the top of the page.

Example Output (HTML)

Sample Report