v3

OpenAPI 3.1.0AGPL-3.0-or-later2026-07-311871891.1 MB
Games

Export ongoing game of a user

Download the ongoing game, or the last game played, of a user. Available in either PGN or JSON format. Ongoing games are delayed by 3 moves, as to prevent cheat bots from using this API.

get/api/user/{username}/current-game

Path parameters

usernamestring required

Query parameters

movesboolean

Include the PGN moves.

pgnInJsonboolean

Include the full PGN within the JSON response, in a pgn field.

tagsboolean

Include the PGN tags.

clocksboolean

Include clock status when available. Either as PGN comments: 2. exd5 { [%clk 1:01:27] } e5 { [%clk 1:01:28] } Or in a clocks JSON field, as centisecond integers, depending on the response type.

evalsboolean

Include analysis evaluations and comments, when available. Either as PGN comments: 12. Bxf6 { [%eval 0.23] } a3 { [%eval -1.09] } Or in an analysis JSON field, depending on the response type.

accuracyboolean

Include accuracy percent of each player, when available. Only available in JSON.

openingboolean

Include the opening name. Example: [Opening "King's Gambit Accepted, King's Knight Gambit"]

divisionboolean

Plies which mark the beginning of the middlegame and endgame. Only available in JSON

literateboolean

Insert textual annotations in the PGN about the opening, analysis variations, mistakes, and game termination. Example: 5... g4? { (-0.98 → 0.60) Mistake. Best move was h6. } (5... h6 6. d4 Ne7 7. g3 d5 8. exd5 fxg3 9. hxg3 c6 10. dxc6)

Headers

Accept'application/x-chess-pgn' | 'application/json'

Specify the desired response format. Use application/x-chess-pgn to get the games in PGN format. Use application/json to get the games in JSON format.

Response

The ongoing (or last) game of a user. This may be in either PGN or JSON format, depending on the Accept header of your request.

string required
OR

Example response

"[Event \"Rated Blitz game\"]\n[Site \"https://lichess.org/fY44h4OY\"]\n[Date \"2018.03.29\"]\n[Round \"-\"]\n[White \"pveldman\"]\n[Black \"thibault\"]\n[Result \"1-0\"]\n[UTCDate \"2018.03.29\"]\n[UTCTime \"01:38:15\"]\n[WhiteElo \"1610\"]\n[BlackElo \"1601\"]\n[WhiteRatingDiff \"+10\"]\n[BlackRatingDiff \"-10\"]\n[Variant \"Standard\"]\n[TimeControl \"180+0\"]\n[ECO \"C62\"]\n[Opening \"Ruy Lopez: Steinitz Defense\"]\n[Termination \"Normal\"]\n\n1. e4 { [%clk 0:03:00] } e5 { [%clk 0:03:00] } 2. Nf3 { [%clk 0:02:59] } Nc6 { [%clk 0:02:58] } 3. Bb5 { [%clk 0:02:57] } d6 { [%clk 0:02:55] } 4. h3 { [%clk 0:02:54] } Nf6 { [%clk 0:02:52] } 5. Bxc6+ { [%clk 0:02:52] } bxc6 { [%clk 0:02:49] } 6. d3 { [%clk 0:02:51] } Be7 { [%clk 0:02:46] } 7. O-O { [%clk 0:02:47] } O-O { [%clk 0:02:45] } 8. b3 { [%clk 0:02:45] } d5 { [%clk 0:02:45] } 9. exd5 { [%clk 0:02:33] } cxd5 { [%clk 0:02:40] } 10. Nxe5 { [%clk 0:02:31] } Qd6 { [%clk 0:02:38] } 1-0\n"