Export games of a user

Export the games of a user as PGN or JSON, newest first, filtered by date, game type, color and opponent.

GET https://cotlet.dev/api/v1/lichess/user-games/export

read

Returns the games newest first, each with ID, players, result, speed, rated flag, opening name and date, plus the PGN when format is pgn. Lichess throttles the stream, at 60 games per second for your own games, so set max for long histories. It reads finished games only and never touches a live game.

Parameters

Parameters: export_user_games
NameTypeDescription
username string required string Lichess username, e.g. 'club_captain'.
since string string Only games played since this ISO date.
until string string Only games played until this ISO date.
max integer integer Return at most this many games. Default all, which can be very long.
perf_type string string Comma list of speeds or variants, e.g. blitz,rapid,classical.
rated boolean boolean Only rated (true) or only casual (false) games.
color string string Only games as this color: white or black.
vs string string Only games against this opponent.
format string string pgn or json. Default json.
include_clocks boolean boolean Add clock times to each move. Default false.
include_evals boolean boolean Add analysis evaluations when the game was analysed. Default false.

Request

cURL
curl "https://cotlet.dev/api/v1/lichess/user-games/export?username=club_captain" \
  -H "Authorization: Bearer $COTLET_API_KEY"
Python
result = client.call("lichess", "export_user_games", {"username":"club_captain"})
Node.js
const result = await cotlet.call('lichess', 'export_user_games', {"username":"club_captain"});
CLI
cotlet call lichess export_user_games --data '{"username":"club_captain"}'

Example response

JSON

{
  "count": 2,
  "games": [
    {
      "game_id": "q8Zr1TnD",
      "played_at": "2026-10-15T20:12:00Z",
      "speed": "blitz",
      "rated": true,
      "white": "club_captain",
      "black": "rook_and_roll",
      "winner": "black",
      "status": "resign",
      "opening": "Sicilian Defense: Najdorf Variation"
    },
    {
      "game_id": "b4Hs9MwE",
      "played_at": "2026-10-14T19:48:00Z",
      "speed": "rapid",
      "rated": true,
      "white": "maya_plays",
      "black": "club_captain",
      "winner": "black",
      "status": "mate",
      "opening": "Queen's Gambit Declined"
    }
  ]
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.