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
| Name | Type | Description |
|---|---|---|
| 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 "https://cotlet.dev/api/v1/lichess/user-games/export?username=club_captain" \
-H "Authorization: Bearer $COTLET_API_KEY" result = client.call("lichess", "export_user_games", {"username":"club_captain"}) const result = await cotlet.call('lichess', 'export_user_games', {"username":"club_captain"}); cotlet call lichess export_user_games --data '{"username":"club_captain"}' Example response
{
"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"
}
]
}