lichess_user_games
Export a Lichess user's games as JSON records with filters for time range, opponent, rating, speed, variant, color, and computer analysis so you can retrieve the specific matches you need.
Instructions
Export games of a Lichess user. Exports a user's games as source JSON records, newest first, bounded by max (1 through 100, default 20). Filters narrow by time (since and until epoch milliseconds), opponent (vs), rated or casual, speed or variant (perfType, one or more comma-separated values), color, computer analysis and ongoing or finished state; flags add the full PGN, clocks, evaluations, accuracy, opening, division, annotations and the last FEN. The anonymous source stream is throttled to 20 games per second. Person-level records (usernames, names, ratings) are returned as published under the maintainer's 2026-11-23 approval. Requests use the shared cross-replica serial gate and honor Lichess's 60-second minimum cooldown after HTTP 429.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"username": "<username>"
},
"name": "lichess_user_games"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vs | No | Only games played against this opponent username | |
| max | No | Number of games, 1 through 100; default 20 | |
| sort | No | Sort order; the source default is dateDesc | |
| tags | No | Include the PGN tags in the pgn field; source default true | |
| color | No | Only games the user played as this color | |
| evals | No | Include analysis evaluations in an analysis field when available; source default false | |
| moves | No | Include the moves; source default true | |
| rated | No | true for rated games only, false for casual games only | |
| since | No | Earliest game time as epoch milliseconds, at least 1356998400070 | |
| until | No | Latest game time as epoch milliseconds, at least 1356998400070 | |
| clocks | No | Include clock times in a clocks field; source default false | |
| lastFen | No | Include the X-FEN of the last position; source default false | |
| ongoing | No | Include ongoing games, delayed by 3 to 60 seconds; source default false | |
| opening | No | Include the opening name; source default false | |
| accuracy | No | Include each player's accuracy percent when available; source default false | |
| analysed | No | true for games with a computer analysis only, false for games without | |
| division | No | Include the plies that mark the start of the middlegame and endgame; source default false | |
| finished | No | Include finished games; false returns ongoing games only; source default true | |
| literate | No | Insert textual annotations into the pgn field; source default false | |
| perfType | No | One or more comma-separated speeds or variants: ultraBullet, bullet, blitz, rapid, classical, correspondence, chess960, crazyhouse, antichess, atomic, horde, kingOfTheHill, racingKings, threeCheck | |
| username | Yes | Lichess username whose games are exported | |
| pgnInJson | No | Include the full PGN in a pgn field of each game; source default false |