Welcome to the reference for the Lichess API! Lichess is free/libre, open-source chess server powered by volunteers and donations.
All requests are rate limited using various strategies, to ensure the API remains responsive for everyone. Only make one request at a time. If you receive an HTTP response with a 429 status, please wait a full minute before resuming API usage.
Some API endpoints stream their responses as Newline Delimited JSON a.k.a. nd-json, with one JSON object per line.
Here's a JavaScript utility function to help reading NDJSON streamed responses.
Read about the Lichess API authentication methods and code examples
Personal API access tokens allow you to quickly interact with Lichess API without going through an OAuth flow.
curl https://lichess.org/api/account -H "Authorization: Bearer {token}"
To see your active tokens or revoke them, see your Personal API access tokens.
The authorization code flow with PKCE allows your users to login with Lichess.
Lichess supports unregistered and public clients (no client authentication, choose any unique client id).
The only accepted code challenge method is S256
.
Access tokens are long-lived (expect one year), unless they are revoked.
Refresh tokens are not supported.
See the documentation for the OAuth endpoints or the PKCE RFC for a precise protocol description.
Access tokens and authorization codes match ^[A-Za-z0-9_]+$
.
The length of tokens can be increased without notice. Make sure your application can handle at least 512 characters.
By convention tokens have a recognizable prefix, but do not rely on this.
Read and write account information and preferences. https://lichess.org/account/preferences/game-display
{- "id": "georges",
- "username": "Georges",
- "perfs": {
- "chess960": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "atomic": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "racingKings": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "ultraBullet": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "blitz": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "kingOfTheHill": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "bullet": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "correspondence": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "horde": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "puzzle": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "classical": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "rapid": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "storm": {
- "runs": 44,
- "score": 61
}, - "racer": {
- "runs": 44,
- "score": 61
}, - "streak": {
- "runs": 44,
- "score": 61
}
}, - "flair": "string",
- "createdAt": 1290415680000,
- "disabled": false,
- "tosViolation": false,
- "profile": {
- "flag": "EC",
- "location": "string",
- "bio": "Free bugs!",
- "realName": "Thibault Duplessis",
- "fideRating": 1500,
- "uscfRating": 1500,
- "ecfRating": 1500,
- "cfcRating": 1500,
- "dsbRating": 1500,
- "links": "github.com/ornicar\r\ntwitter.com/ornicar"
}, - "seenAt": 1522636452014,
- "patron": true,
- "verified": true,
- "playTime": {
- "total": 3296897,
- "tv": 12134
}, - "title": "NM",
- "count": {
- "all": 9265,
- "rated": 7157,
- "ai": 531,
- "draw": 340,
- "drawH": 331,
- "loss": 4480,
- "lossH": 4207,
- "win": 4440,
- "winH": 4378,
- "bookmark": 71,
- "playing": 6,
- "import": 66,
- "me": 0
}, - "streaming": false,
- "streamer": {
}, - "followable": true,
- "following": false,
- "blocking": false,
- "followsYou": false
}
{- "prefs": {
- "dark": true,
- "transp": false,
- "is3d": false,
- "theme": "brown",
- "pieceSet": "cburnett",
- "theme3d": "Woodi",
- "pieceSet3d": "Basic",
- "soundSet": "standard",
- "autoQueen": 2,
- "autoThreefold": 3,
- "takeback": 3,
- "moretime": 3,
- "clockTenths": 1,
- "clockBar": true,
- "clockSound": true,
- "premove": true,
- "animation": 2,
- "captured": true,
- "follow": true,
- "highlight": true,
- "destination": true,
- "coords": 1,
- "replay": 2,
- "challenge": 4,
- "message": 3,
- "submitMove": 0,
- "confirmResign": 1,
- "insightShare": 1,
- "keyboardMove": 0,
- "zen": 0,
- "ratings": 1,
- "moveEvent": 2,
- "rookCastle": 1
}, - "language": "en-US"
}
Get the timeline events of the logged in user.
since | integer >= 1356998400070 Show events since this timestamp. |
nb | integer [ 1 .. 30 ] Default: 15 Max number of events to fetch. |
{- "entries": [
- {
- "type": "follow",
- "data": {
- "u1": "neio",
- "u2": "chess-network"
}, - "date": 1644232201429
}, - {
- "type": "team-join",
- "data": {
- "userId": "neio",
- "teamId": "coders"
}, - "date": 1644232201429
}, - {
- "type": "team-create",
- "data": {
- "userId": "neio",
- "teamId": "coders"
}, - "date": 1644232201429
}, - {
- "type": "forum-post",
- "data": {
- "userId": "neio",
- "topicId": "AAAAAAAN",
- "topicName": "World's Tallest LEGO Tower Completed in City Square",
- "postId": "AAAAAAAL"
}, - "date": 1644232201429
}, - {
- "type": "ublog-post",
- "data": {
- "userId": "neio",
- "id": "og5pkt1c",
- "slug": "gotta-go-fast",
- "title": "Gotta Go Fast"
}, - "date": 1644232201429
}, - {
- "type": "tour-join",
- "data": {
- "userId": "chess-network",
- "tourId": "Z24oxqgU",
- "tourName": "Daily Blitz Arena"
}, - "date": 1644232201429
}, - {
- "type": "game-end",
- "data": {
- "fullId": "iGkAXUdEfLZC",
- "perf": "correspondence",
- "opponent": "chess-network",
- "win": false
}, - "date": 1644232201429
}, - {
- "type": "simul-create",
- "data": {
- "userId": "neio",
- "simulId": "m3c0Wvu3",
- "simulName": "RCA 1st Jan simul"
}, - "date": 1644232201429
}, - {
- "type": "simul-join",
- "data": {
- "userId": "chess-network",
- "simulId": "m3c0Wvu3",
- "simulName": "RCA 1st Jan simul"
}, - "date": 1644232201429
}, - {
- "type": "study-like",
- "data": {
- "userId": "neio",
- "studyId": "ma5AvZ7o",
- "studyName": "Free wins | Danish Gambit"
}, - "date": 1644232201429
}, - {
- "type": "plan-start",
- "data": {
- "userId": "chess-network"
}, - "date": 1644232201429
}, - {
- "type": "plan-renew",
- "data": {
- "userId": "chess-network",
- "months": 64
}, - "date": 1644232201429
}, - {
- "type": "blog-post",
- "data": {
- "id": "ZUviXRIAACYAVtMm",
- "slug": "lichess-development-made-easy-with-gitpod",
- "title": "Lichess Development Made Easy With Gitpod"
}, - "date": 1644232201429
}, - {
- "type": "ublog-post-like",
- "data": {
- "userId": "neio",
- "id": "ZUviXRIAACYAVtMm",
- "title": "Lichess Development Made Easy With Gitpod"
}, - "date": 1644232201429
}, - {
- "type": "stream-start",
- "data": {
- "userId": "chess-network",
- "title": "Streamers Battle December !team | lichess.org"
}, - "date": 1644232201429
}
], - "users": {
- "neio": {
- "id": "neio",
- "name": "Neio",
- "title": "NM"
}, - "chess-network": {
- "id": "chess-network",
- "name": "Chess-Network",
- "title": "NM",
- "patron": true
}
}
}
Access registered users on Lichess. https://lichess.org/player
Read the online
, playing
and streaming
flags of several users.
This API is very fast and cheap on lichess side.
So you can call it quite often (like once every 5 seconds).
Use it to track players and know when they're connected on lichess and playing games.
ids required | string Example: ids=thibault,maia1,maia5 User IDs separated by commas. Up to 100 IDs. |
withSignal | boolean Example: withSignal=true Also return the network signal of the player, when available.
It ranges from 1 (poor connection, lag > 500ms) to 4 (great connection, lag < 150ms)
Defaults to |
withGameIds | boolean Example: withGameIds=true Also return the ID of the game being played, if any, for each player, in a |
withGameMetas | boolean Example: withGameMetas=true Also return the id, time control and variant of the game being played, if any, for each player, in a |
[- {
- "id": "aliquantus",
- "name": "Aliquantus"
}, - {
- "id": "chess-network",
- "name": "Chess-Network",
- "title": "NM",
- "online": true,
- "playing": true,
- "streaming": true,
- "patron": true
}
]
Get the top 10 players for each speed and variant. See https://lichess.org/player.
{- "bullet": [
- {
- "id": "bahadirozen",
- "username": "BahadirOzen",
- "perfs": {
- "bullet": {
- "rating": 3018,
- "progress": 18
}
}, - "online": true,
- "title": "FM"
}, - {
- "id": "penguingim1",
- "username": "penguingim1",
- "perfs": {
- "bullet": {
- "rating": 2983,
- "progress": -36
}
}, - "title": "GM",
- "online": true,
- "patron": true
}, - {
- "id": "night-king96",
- "username": "Night-King96",
- "perfs": {
- "bullet": {
- "rating": 2958,
- "progress": 35
}
}, - "title": "GM"
}
], - "blitz": [ ],
- "rapid": [ ],
- "classical": [ ],
- "ultraBullet": [ ],
- "chess960": [ ],
- "crazyhouse": [ ],
- "antichess": [ ],
- "atomic": [ ],
- "horde": [ ],
- "kingOfTheHill": [ ],
- "racingKings": [ ],
- "threeCheck": [ ]
}
Get the leaderboard for a single speed or variant (a.k.a. perfType
).
There is no leaderboard for correspondence or puzzles.
See https://lichess.org/player/top/200/bullet.
nb required | integer [ 1 .. 200 ] Example: 100 How many users to fetch |
perfType required | string Enum: "ultraBullet" "bullet" "blitz" "rapid" "classical" "chess960" "crazyhouse" "antichess" "atomic" "horde" "kingOfTheHill" "racingKings" "threeCheck" Example: bullet The speed or variant |
{- "users": [
- {
- "id": "bahadirozen",
- "username": "BahadirOzen",
- "perfs": {
- "bullet": {
- "rating": 3018,
- "progress": 18
}
}, - "online": true,
- "title": "FM"
}, - {
- "id": "penguingim1",
- "username": "penguingim1",
- "perfs": {
- "bullet": {
- "rating": 2983,
- "progress": -36
}
}, - "title": "GM",
- "online": true,
- "patron": true
}, - {
- "id": "night-king96",
- "username": "Night-King96",
- "perfs": {
- "bullet": {
- "rating": 2958,
- "progress": 35
}
}, - "title": "GM"
}
]
}
Read public data of a user.
username required | string |
trophies | boolean Default: false Include user trophies |
{- "id": "georges",
- "username": "Georges",
- "perfs": {
- "chess960": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "atomic": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "racingKings": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "ultraBullet": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "blitz": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "kingOfTheHill": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "bullet": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "correspondence": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "horde": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "puzzle": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "classical": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "rapid": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "storm": {
- "runs": 44,
- "score": 61
}, - "racer": {
- "runs": 44,
- "score": 61
}, - "streak": {
- "runs": 44,
- "score": 61
}
}, - "flair": "string",
- "createdAt": 1290415680000,
- "disabled": false,
- "tosViolation": false,
- "profile": {
- "flag": "EC",
- "location": "string",
- "bio": "Free bugs!",
- "realName": "Thibault Duplessis",
- "fideRating": 1500,
- "uscfRating": 1500,
- "ecfRating": 1500,
- "cfcRating": 1500,
- "dsbRating": 1500,
- "links": "github.com/ornicar\r\ntwitter.com/ornicar"
}, - "seenAt": 1522636452014,
- "patron": true,
- "verified": true,
- "playTime": {
- "total": 3296897,
- "tv": 12134
}, - "title": "NM",
- "count": {
- "all": 9265,
- "rated": 7157,
- "ai": 531,
- "draw": 340,
- "drawH": 331,
- "loss": 4480,
- "lossH": 4207,
- "win": 4440,
- "winH": 4378,
- "bookmark": 71,
- "playing": 6,
- "import": 66,
- "me": 0
}, - "streaming": false,
- "streamer": {
}, - "followable": true,
- "following": false,
- "blocking": false,
- "followsYou": false
}
Read rating history of a user, for all perf types.
There is at most one entry per day.
Format of an entry is [year, month, day, rating]
.
month
starts at zero (January).
username required | string |
[- {
- "name": "Bullet",
- "points": [
- [
- 2011,
- 0,
- 8,
- 1472
], - [
- 2011,
- 0,
- 9,
- 1332
], - [
- 2011,
- 8,
- 12,
- 1314
]
]
}, - {
- "name": "Blitz",
- "points": [
- [
- 2011,
- 7,
- 29,
- 1332
]
]
}
]
Read performance statistics of a user, for a single performance. Similar to the performance pages on the website.
username required | string |
perf required | string (PerfType) Enum: "ultraBullet" "bullet" "blitz" "rapid" "classical" "correspondence" "chess960" "crazyhouse" "antichess" "atomic" "horde" "kingOfTheHill" "racingKings" "threeCheck" |
{- "user": {
- "name": "thibault"
}, - "perf": {
- "glicko": {
- "rating": 1672.42,
- "deviation": 45.13,
- "provisional": false
}, - "nb": 5692,
- "progress": -27
}, - "rank": 98121,
- "percentile": 69.7,
- "stat": {
- "perfType": {
- "key": "bullet",
- "name": "Bullet"
}, - "highest": {
- "int": 1902,
- "at": "2021-05-31T08:58:53.701Z",
- "gameId": "YEDqtwig"
}, - "lowest": {
- "int": 1417,
- "at": "2016-06-28T13:54:39.656Z",
- "gameId": "rNM4J1GJ"
}, - "id": "thibault/1",
- "bestWins": {
- "results": [
- {
- "opRating": 2238,
- "opId": {
- "id": "hyperdragon84",
- "name": "HyperDragon84"
}, - "at": "2019-06-19T17:09:05.187Z",
- "gameId": "DGB53z9w"
}, - {
- "opRating": 2089,
- "opId": {
- "id": "osipov",
- "name": "osipov"
}, - "at": "2017-06-18T09:46:05.016Z",
- "gameId": "gurRhuMi"
}, - {
- "opRating": 2071,
- "opId": {
- "id": "spark50",
- "name": "Spark50"
}, - "at": "2020-07-04T08:36:12.948Z",
- "gameId": "a93Dk1mv"
}, - {
- "opRating": 2045,
- "opId": {
- "id": "yasha43",
- "name": "Yasha43"
}, - "at": "2021-05-17T14:01:41.098Z",
- "gameId": "j3jZnGTr"
}, - {
- "opRating": 2034,
- "opId": {
- "id": "midedu",
- "name": "midedu"
}, - "at": "2020-06-27T17:32:47.001Z",
- "gameId": "OiaMVLQ8"
}
]
}, - "worstLosses": {
- "results": [
- {
- "opRating": 1186,
- "opId": {
- "id": "happy0",
- "name": "Happy0"
}, - "at": "2016-07-07T19:48:29.077Z",
- "gameId": "Q01bbiN4"
}, - {
- "opRating": 1197,
- "opId": {
- "id": "kazmankiller86",
- "name": "KazmanKiller86"
}, - "at": "2016-10-16T14:21:37.748Z",
- "gameId": "Aivqh9Sp"
}, - {
- "opRating": 1201,
- "opId": {
- "id": "artem555",
- "name": "artem555"
}, - "at": "2016-08-28T16:21:30.923Z",
- "gameId": "tiRAbhnX"
}, - {
- "opRating": 1265,
- "opId": {
- "id": "arcenuu",
- "name": "Arcenuu"
}, - "at": "2016-12-24T14:28:03.866Z",
- "gameId": "A68wUOoh"
}, - {
- "opRating": 1283,
- "opId": {
- "id": "amritalib76",
- "name": "Amritalib76"
}, - "at": "2018-06-26T09:55:39.354Z",
- "gameId": "sbNVikmo"
}
]
}, - "count": {
- "all": 5858,
- "rated": 5688,
- "win": 2789,
- "loss": 2806,
- "draw": 263,
- "tour": 654,
- "berserk": 1,
- "opAvg": 1671.44,
- "seconds": 784886,
- "disconnects": 0
}, - "resultStreak": {
- "win": {
- "cur": {
- "v": 0
}, - "max": {
- "v": 11,
- "from": {
- "at": "2021-06-14T15:38:50.681Z",
- "gameId": "wTX2IExo"
}, - "to": {
- "at": "2021-06-15T18:41:46.970Z",
- "gameId": "1z4rrjgw"
}
}
}, - "loss": {
- "cur": {
- "v": 3,
- "from": {
- "at": "2021-06-29T17:53:23.642Z",
- "gameId": "pfcnjgik"
}, - "to": {
- "at": "2021-06-29T18:04:48.358Z",
- "gameId": "6sPaGL8T"
}
}, - "max": {
- "v": 14,
- "from": {
- "at": "2018-06-11T14:43:39.296Z",
- "gameId": "1fc9dqun"
}, - "to": {
- "at": "2018-06-11T15:10:30.908Z",
- "gameId": "Nzy6UgwY"
}
}
}
}, - "userId": {
- "id": "thibault",
- "name": "thibault",
- "title": null
}, - "playStreak": {
- "nb": {
- "cur": {
- "v": 0
}, - "max": {
- "v": 118,
- "from": {
- "at": "2018-06-11T10:32:21.248Z",
- "gameId": "UAsNnJbN"
}, - "to": {
- "at": "2018-06-11T15:13:01.193Z",
- "gameId": "T7fHRaFG"
}
}
}, - "time": {
- "cur": {
- "v": 0
}, - "max": {
- "v": 12683,
- "from": {
- "at": "2018-06-12T14:11:14.021Z",
- "gameId": "IrZCAW58"
}, - "to": {
- "at": "2018-06-12T18:02:57.010Z",
- "gameId": "RNF1mQ68"
}
}
}, - "lastDate": "2021-06-29T18:04:48.358Z"
}
}
}
Get up to 300 users by their IDs. Users are returned in the same order as the IDs.
The method is POST
to allow a longer list of IDs to be sent in the request body.
Please do not try to download all the Lichess users with this endpoint, or any other endpoint.
An API is not a way to fully export a website. We do not provide a full download of the Lichess users.
This endpoint is limited to 8,000 users every 10 minutes, and 120,000 every day.
User IDs separated by commas.
thibault,maia1,maia5
[- {
- "id": "georges",
- "username": "Georges",
- "perfs": {
- "chess960": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "atomic": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "racingKings": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "ultraBullet": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "blitz": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "kingOfTheHill": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "bullet": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "correspondence": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "horde": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "puzzle": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "classical": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "rapid": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "storm": {
- "runs": 44,
- "score": 61
}, - "racer": {
- "runs": 44,
- "score": 61
}, - "streak": {
- "runs": 44,
- "score": 61
}
}, - "flair": "string",
- "createdAt": 1290415680000,
- "disabled": false,
- "tosViolation": false,
- "profile": {
- "flag": "EC",
- "location": "string",
- "bio": "Free bugs!",
- "realName": "Thibault Duplessis",
- "fideRating": 1500,
- "uscfRating": 1500,
- "ecfRating": 1500,
- "cfcRating": 1500,
- "dsbRating": 1500,
- "links": "github.com/ornicar\r\ntwitter.com/ornicar"
}, - "seenAt": 1522636452014,
- "patron": true,
- "verified": true,
- "playTime": {
- "total": 3296897,
- "tv": 12134
}, - "title": "NM"
}
]
Get basic info about currently streaming users. This API is very fast and cheap on lichess side. So you can call it quite often (like once every 5 seconds).
[- {
- "id": "chess-network",
- "name": "Chess-Network",
- "title": "NM",
- "patron": true,
- "stream": {
- "service": "twitch",
- "status": "Tuesday night 🐴 chess | lichess.org",
- "lang": "en"
}, - "streamer": {
- "name": "ChessNetwork",
- "headline": "Chess with commentary, tournament competition, viewer interaction, and more.",
- "description": "I'm a self-taught National Master in chess from Pennsylvania, USA who was introduced to the game by my father in 1988 at age 8. I've been playing since, enjoy teaching, and have been a broadcaster of all things chess since 2011. It's my hope your experience with this stream is both fun and educational. 😎 -Jerry",
}
}
]
Get total number of games, and current score, of any two users.
If the matchup
flag is provided, and the users are currently playing, also gets the current match game number and scores.
user1 required | string |
user2 required | string |
matchup | boolean Whether to get the current match data, if any |
{- "users": {
- "neio": 201.5,
- "thibault": 144.5
}, - "nbGames": 346,
- "matchup": {
- "users": {
- "neio": 44,
- "thibault": 43
}, - "nbGames": 87
}
}
Provides autocompletion options for an incomplete username.
term required | string >= 3 characters The beginning of a username |
object | boolean Default: false
|
friend | boolean Returns followed players matching |
{- "result": [
- {
- "id": "chess-network",
- "name": "Chess-Network",
- "title": "NM",
- "patron": true,
- "online": true
}
]
}
Add a private note available only to you about this account.
username required | string Example: thibault |
text required | string The contents of the note |
{- "ok": true
}
Get the private notes that you have added for a user.
username required | string Example: thibault |
[- {
- "from": {
- "name": "thibault",
- "patron": true,
- "id": "thibault"
}, - "to": {
- "name": "DrNykterstein",
- "title": "GM",
- "patron": true,
- "id": "drnykterstein"
}, - "text": "This guy is good at chess",
- "date": 1690585691898
}
]
Users are streamed as ndjson.
{- "id": "georges",
- "username": "Georges",
- "perfs": {
- "chess960": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "atomic": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "racingKings": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "ultraBullet": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "blitz": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "kingOfTheHill": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "bullet": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "correspondence": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "horde": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "puzzle": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "classical": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "rapid": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "storm": {
- "runs": 44,
- "score": 61
}, - "racer": {
- "runs": 44,
- "score": 61
}, - "streak": {
- "runs": 44,
- "score": 61
}
}, - "flair": "string",
- "createdAt": 1290415680000,
- "disabled": false,
- "tosViolation": false,
- "profile": {
- "flag": "EC",
- "location": "string",
- "bio": "Free bugs!",
- "realName": "Thibault Duplessis",
- "fideRating": 1500,
- "uscfRating": 1500,
- "ecfRating": 1500,
- "cfcRating": 1500,
- "dsbRating": 1500,
- "links": "github.com/ornicar\r\ntwitter.com/ornicar"
}, - "seenAt": 1522636452014,
- "patron": true,
- "verified": true,
- "playTime": {
- "total": 3296897,
- "tv": 12134
}, - "title": "NM",
- "count": {
- "all": 9265,
- "rated": 7157,
- "ai": 531,
- "draw": 340,
- "drawH": 331,
- "loss": 4480,
- "lossH": 4207,
- "win": 4440,
- "winH": 4378,
- "bookmark": 71,
- "playing": 6,
- "import": 66,
- "me": 0
}, - "streaming": false,
- "streamer": {
}, - "followable": true,
- "following": false,
- "blocking": false,
- "followsYou": false
}
Access games played on Lichess. https://lichess.org/games
Download one game in either PGN or JSON format. Ongoing games are delayed by a few seconds ranging from 3 to 60 depending on the time control, as to prevent cheat bots from using this API.
gameId required | string The game ID (8 characters). |
moves | boolean Default: true Include the PGN moves. |
pgnInJson | boolean Default: false Include the full PGN within the JSON response, in a |
tags | boolean Default: true Include the PGN tags. |
clocks | boolean Default: true Include clock status when available.
Either as PGN comments: |
evals | boolean Default: true Include analysis evaluations and comments, when available.
Either as PGN comments: |
accuracy | |
opening | boolean Default: true Include the opening name.
Example: |
division | boolean Default: true Plies which mark the beginning of the middlegame and endgame. Only available in JSON |
literate | boolean Default: false Insert textual annotations in the PGN about the opening, analysis variations, mistakes, and game termination.
Example: |
withBookmarked | boolean Default: false Add a |
players | string URL of a text file containing real names and ratings, to replace Lichess usernames and ratings in the PGN. Example: https://gist.githubusercontent.com/ornicar/6bfa91eb61a2dcae7bcd14cce1b2a4eb/raw/768b9f6cc8a8471d2555e47ba40fb0095e5fba37/gistfile1.txt |
Download the ongoing game, or the last game played, of a user. Available in either PGN or JSON format. Ongoing games are delayed by a few seconds ranging from 3 to 60 depending on the time control, as to prevent cheat bots from using this API.
username required | string |
moves | boolean Default: true Include the PGN moves. |
pgnInJson | boolean Default: false Include the full PGN within the JSON response, in a |
tags | boolean Default: true Include the PGN tags. |
clocks | boolean Default: true Include clock status when available.
Either as PGN comments: |
evals | boolean Default: true Include analysis evaluations and comments, when available.
Either as PGN comments: |
accuracy | |
opening | boolean Default: true Include the opening name.
Example: |
division | boolean Default: false Plies which mark the beginning of the middlegame and endgame. Only available in JSON |
literate | boolean Default: false Insert textual annotations in the PGN about the opening, analysis variations, mistakes, and game termination.
Example: |
players | string URL of a text file containing real names and ratings, to replace Lichess usernames and ratings in the PGN. Example: https://gist.githubusercontent.com/ornicar/6bfa91eb61a2dcae7bcd14cce1b2a4eb/raw/768b9f6cc8a8471d2555e47ba40fb0095e5fba37/gistfile1.txt |
Download all games of any user in PGN or ndjson format. Games are sorted by reverse chronological order (most recent first). We recommend streaming the response, for it can be very long. https://lichess.org/@/german11 for instance has more than 500,000 games. The game stream is throttled, depending on who is making the request:
username required | string The user name. |
since | integer >= 1356998400070 Download games played since this timestamp. Defaults to account creation date. |
until | integer >= 1356998400070 Download games played until this timestamp. Defaults to now. |
max | integer >= 1 How many games to download. Leave empty to download all games. |
vs | string [Filter] Only games played against this opponent |
rated | boolean [Filter] Only rated ( |
perfType | string Default: null Enum: "ultraBullet" "bullet" "blitz" "rapid" "classical" "correspondence" "chess960" "crazyhouse" "antichess" "atomic" "horde" "kingOfTheHill" "racingKings" "threeCheck" [Filter] Only games in these speeds or variants. Multiple perf types can be specified, separated by a comma. Example: blitz,rapid,classical |
color | string Enum: "white" "black" [Filter] Only games played as this color. |
analysed | boolean [Filter] Only games with or without a computer analysis available |
moves | boolean Default: true Include the PGN moves. |
pgnInJson | boolean Default: false Include the full PGN within the JSON response, in a |
tags | boolean Default: true Include the PGN tags. |
clocks | boolean Default: false Include clock status when available.
Either as PGN comments: |
evals | boolean Default: false Include analysis evaluations and comments, when available.
Either as PGN comments: |
accuracy | |
opening | boolean Default: false Include the opening name.
Example: |
division | boolean Default: false Plies which mark the beginning of the middlegame and endgame. Only available in JSON |
ongoing | boolean Default: false Ongoing games are delayed by a few seconds ranging from 3 to 60 depending on the time control, as to prevent cheat bots from using this API. |
finished | boolean Default: true Include finished games. Set to |
literate | boolean Default: false Insert textual annotations in the PGN about the opening, analysis variations, mistakes, and game termination.
Example: |
lastFen | boolean Default: false Include the FEN notation of the last position of the game.
The response type must be set to |
withBookmarked | boolean Default: false Add a |
players | string URL of a text file containing real names and ratings, to replace Lichess usernames and ratings in the PGN. Example: https://gist.githubusercontent.com/ornicar/6bfa91eb61a2dcae7bcd14cce1b2a4eb/raw/768b9f6cc8a8471d2555e47ba40fb0095e5fba37/gistfile1.txt |
sort | string Default: "dateDesc" Enum: "dateAsc" "dateDesc" Sort order of the games. |
Download games by IDs in PGN or ndjson format, depending on the request Accept
header.
Games are sorted by reverse chronological order (most recent first)
The method is POST
so a longer list of IDs can be sent in the request body.
300 IDs can be submitted.
Ongoing games are delayed by a few seconds ranging from 3 to 60 depending on the time control, as to prevent cheat bots from using this API.
moves | boolean Default: true Include the PGN moves. |
pgnInJson | boolean Default: false Include the full PGN within the JSON response, in a |
tags | boolean Default: true Include the PGN tags. |
clocks | boolean Default: false Include clock status when available.
Either as PGN comments: |
evals | boolean Default: false Include analysis evaluations and comments, when available.
Either as PGN comments: |
accuracy | |
opening | boolean Default: false Include the opening name.
Example: |
division | boolean Default: false Plies which mark the beginning of the middlegame and endgame. Only available in JSON |
literate | boolean Default: false Insert textual annotations in the PGN about the opening, analysis variations, mistakes, and game termination.
Example: |
players | string URL of a text file containing real names and ratings, to replace Lichess usernames and ratings in the PGN. Example: https://gist.githubusercontent.com/ornicar/6bfa91eb61a2dcae7bcd14cce1b2a4eb/raw/768b9f6cc8a8471d2555e47ba40fb0095e5fba37/gistfile1.txt |
Game IDs separated by commas. Up to 300.
TJxUmbWK,4OtIh2oh,ILwozzRZ
Stream the games played between a list of users, in real time.
Only games where both players are part of the list are included.
The stream emits an event each time a game is started or finished.
To also get all current ongoing games at the beginning of the stream, use the withCurrentGames
flag.
Games are streamed as ndjson.
Maximum number of users: 300.
The method is POST
so a longer list of IDs can be sent in the request body.
withCurrentGames | boolean Default: false Include the already started games at the beginning of the stream. |
Up to 300 user IDs separated by commas.
Example: thibault,maia1,maia5
[- {
- "id": "A5fcMO3k",
- "rated": true,
- "variant": "standard",
- "speed": "bullet",
- "perf": "bullet",
- "createdAt": 1525789431889,
- "status": 20,
- "statusName": "started",
- "clock": {
- "initial": 60,
- "increment": 0,
- "totalTime": 60
}, - "players": {
- "white": {
- "userId": "kastorcito",
- "rating": 2617
}, - "black": {
- "userId": "er_or",
- "rating": 2288
}
}
}
]
Creates a stream of games from an arbitrary streamId, and a list of game IDs. The stream first outputs the games that already exists, then emits an event each time a game is started or finished. Games are streamed as ndjson. Maximum number of games: 500 for anonymous requests, or 1000 for OAuth2 authenticated requests. While the stream is open, it is possible to add new game IDs to watch.
streamId required | string Example: myAppName-someRandomId Arbitrary stream ID that you can later use to add game IDs to the stream. |
Up to 500 or 1000 game IDs separated by commas.
Example: gameId01,gameId02,gameId03
[- {
- "id": "A5fcMO3k",
- "rated": true,
- "variant": "standard",
- "speed": "bullet",
- "perf": "bullet",
- "createdAt": 1525789431889,
- "status": 20,
- "statusName": "started",
- "clock": {
- "initial": 60,
- "increment": 0,
- "totalTime": 60
}, - "players": {
- "white": {
- "userId": "kastorcito",
- "rating": 2617
}, - "black": {
- "userId": "er_or",
- "rating": 2288
}
}
}
]
Add new game IDs for an existing stream to watch. The stream will immediately outputs the games that already exists, then emit an event each time a game is started or finished.
streamId required |
Up to 500 or 1000 game IDs separated by commas.
Example: gameId04,gameId05,gameId06
{- "ok": true
}
Get the ongoing games of the current user. Real-time and correspondence games are included. The most urgent games are listed first.
nb | integer [ 1 .. 50 ] Default: 9 Max number of games to fetch |
{- "nowPlaying": [
- {
- "gameId": "rCRw1AuO",
- "fullId": "rCRw1AuOvonq",
- "color": "black",
- "fen": "r1bqkbnr/pppp2pp/2n1pp2/8/8/3PP3/PPPB1PPP/RN1QKBNR w KQkq - 2 4",
- "hasMoved": true,
- "isMyTurn": false,
- "lastMove": "b8c6",
- "opponent": {
- "id": "philippe",
- "rating": 1790,
- "username": "Philippe"
}, - "perf": "correspondence",
- "rated": false,
- "secondsLeft": 1209600,
- "source": "friend",
- "speed": "correspondence",
- "variant": {
- "key": "standard",
- "name": "Standard"
}
}
]
}
Stream positions and moves of any ongoing game, in ndjson. A description of the game is sent as a first message. Then a message is sent each time a move is played. Finally a description of the game is sent when it finishes, and the stream is closed. Ongoing games are delayed by a few seconds ranging from 3 to 60 depending on the time control, as to prevent cheat bots from using this API. No more than 8 game streams can be opened at the same time from the same IP address.
id required | string Example: LuGQwhBb |
[- {
- "id": "LuGQwhBb",
- "variant": {
- "key": "standard",
- "name": "Standard",
- "short": "Std"
}, - "speed": "blitz",
- "perf": "blitz",
- "rated": true,
- "initialFen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
- "fen": "rnbqkb1r/1p1ppppp/p6n/2p4Q/8/1P2P3/P1PP1PPP/RNB1KBNR w KQkq - 0 4",
- "player": "white",
- "turns": 6,
- "startedAtTurn": 0,
- "source": "pool",
- "status": {
- "id": 20,
- "name": "started"
}, - "createdAt": 1620029815106,
- "lastMove": "c7c5",
- "players": {
- "white": {
- "user": {
- "name": "ARM-777777",
- "title": "GM",
- "id": "arm-777777"
}, - "rating": 3120
}, - "black": {
- "user": {
- "name": "Flash_Marafon",
- "id": "flash_marafon"
}, - "rating": 3015
}
}
}, - {
- "fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w",
- "wc": 180,
- "bc": 180
}, - {
- "fen": "rnbqkbnr/pppppppp/8/8/8/4P3/PPPP1PPP/RNBQKBNR b",
- "lm": "e2e3",
- "wc": 180,
- "bc": 180
}, - {
- "fen": "rnbqkb1r/pppppppp/7n/8/8/4P3/PPPP1PPP/RNBQKBNR w",
- "lm": "g8h6",
- "wc": 180,
- "bc": 180
}, - {
- "fen": "rnbqkb1r/pppppppp/7n/8/8/1P2P3/P1PP1PPP/RNBQKBNR b",
- "lm": "b2b3",
- "wc": 177,
- "bc": 180
}, - {
- "fen": "rnbqkb1r/1ppppppp/p6n/8/8/1P2P3/P1PP1PPP/RNBQKBNR w",
- "lm": "a7a6",
- "wc": 177,
- "bc": 177
}
]
Import a game from PGN. See https://lichess.org/paste. Rate limiting: 200 games per hour for OAuth requests, 100 games per hour for anonymous requests. To broadcast ongoing games, consider pushing to a broadcast instead. To analyse a position or a line, just construct an analysis board URL: https://lichess.org/analysis/pgn/e4_e5_Nf3_Nc6_Bc4_Bc5_Bxf7+
A single game to import
pgn | string The PGN. It can contain only one game. Most standard tags are supported. |
{- "id": "R6iLjwz5",
}
Access Lichess TV channels and games. https://lichess.org/tv & https://lichess.org/games
Get basic info about the best games being played for each speed and variant, but also computer games and bot games. See lichess.org/tv.
{- "bot": {
- "user": {
- "id": "leelachess",
- "name": "LeelaChess",
- "title": "BOT"
}, - "rating": 2660,
- "gameId": "Zznv9MIl",
- "color": "black"
}, - "blitz": {
- "user": {
- "id": "lekkerkortook",
- "name": "LekkerKortOok"
}, - "rating": 2603,
- "gameId": "hTJ4v7Mp",
- "color": "black"
}, - "racingKings": {
- "user": {
- "id": "chesslo21",
- "name": "chesslo21"
}, - "rating": 2123,
- "gameId": "lgCDl5Of",
- "color": "white"
}, - "ultraBullet": {
- "user": {
- "id": "farmville",
- "name": "Farmville"
}, - "rating": 2338,
- "gameId": "NEY6OQ32",
- "color": "white"
}, - "bullet": {
- "user": {
- "id": "nurmibrah",
- "name": "nurmiBrah"
}, - "rating": 2499,
- "gameId": "5LgyE516",
- "color": "black"
}, - "classical": {
- "user": {
- "id": "holden_m_j_thomas",
- "name": "Holden_M_J_Thomas"
}, - "rating": 1806,
- "gameId": "k3oLby6N",
- "color": "white"
}, - "threeCheck": {
- "user": {
- "id": "pepellou",
- "name": "pepellou",
- "patron": true
}, - "rating": 1978,
- "gameId": "Og5RCvmu",
- "color": "black"
}, - "antichess": {
- "user": {
- "id": "maria-bakkar",
- "name": "maria-bakkar"
}, - "rating": 2103,
- "gameId": "toCr41yx",
- "color": "black"
}, - "computer": {
- "user": {
- "id": "oh_my_goat_im_so_bat",
- "name": "oh_my_goat_Im_so_bat"
}, - "rating": 2314,
- "gameId": "TkI4qZxu",
- "color": "black"
}, - "horde": {
- "user": {
- "id": "habitualchess",
- "name": "HabitualChess"
}, - "rating": 1803,
- "gameId": "oMofN63H",
- "color": "white"
}, - "rapid": {
- "user": {
- "id": "denpayd",
- "name": "DenpaYD"
}, - "rating": 2289,
- "gameId": "IcWOl8ee"
}, - "atomic": {
- "user": {
- "id": "meetyourdemise",
- "name": "MeetYourDemise"
}, - "rating": 2210,
- "gameId": "tvMxtCMN",
- "color": "white"
}, - "crazyhouse": {
- "user": {
- "id": "mathace",
- "name": "mathace"
}, - "rating": 2397,
- "gameId": "i3gTZlUb",
- "color": "black"
}, - "chess960": {
- "user": {
- "id": "voja_7",
- "name": "voja_7"
}, - "rating": 1782,
- "gameId": "lrXLcedu",
- "color": "white"
}, - "kingOfTheHill": {
- "user": {
- "id": "nadime",
- "name": "Nadime"
}, - "rating": 1500,
- "gameId": "DsQn8aEV",
- "color": "white"
}, - "best": {
- "user": {
- "id": "lekkerkortook",
- "name": "LekkerKortOok"
}, - "rating": 2603,
- "gameId": "hTJ4v7Mp",
- "color": "black"
}
}
{- "t": "featured",
- "d": {
- "id": "qVSOPtMc",
- "orientation": "black",
- "players": [
- {
- "color": "white",
- "user": {
- "name": "lizen9",
- "id": "lizen9",
- "title": "GM"
}, - "rating": 2531,
- "seconds": 60
}, - {
- "color": "black",
- "user": {
- "name": "lizen29",
- "title": "WGM",
- "id": "lizen29"
}, - "rating": 2594,
- "seconds": 60
}
], - "fen": "rnbqk1r1/ppp1ppbp/8/N2p2p1/8/1PQPP3/P1P2PPn/R1B1K1NR"
}
}
Stream positions and moves of a current TV channel's game in ndjson.
Try it with curl https://lichess.org/api/tv/rapid/feed
.
channel required | string The name of the channel in camel case. |
{- "t": "featured",
- "d": {
- "id": "qVSOPtMc",
- "orientation": "black",
- "players": [
- {
- "color": "white",
- "user": {
- "name": "lizen9",
- "id": "lizen9",
- "title": "GM"
}, - "rating": 2531,
- "seconds": 60
}, - {
- "color": "black",
- "user": {
- "name": "lizen29",
- "title": "WGM",
- "id": "lizen29"
}, - "rating": 2594,
- "seconds": 60
}
], - "fen": "rnbqk1r1/ppp1ppbp/8/N2p2p1/8/1PQPP3/P1P2PPn/R1B1K1NR"
}
}
Get a list of ongoing games for a given TV channel. Similar to lichess.org/games.
Available in PGN or ndjson format, depending on the request Accept
header.
channel required | string The name of the channel in camel case. |
nb | number [ 1 .. 30 ] Default: 10 Number of games to fetch. |
moves | boolean Default: true Include the PGN moves. |
pgnInJson | boolean Default: false Include the full PGN within the JSON response, in a |
tags | boolean Default: true Include the PGN tags. |
clocks | boolean Default: false Include clock status when available.
Either as PGN comments: |
opening | boolean Default: false Include the opening name.
Example: |
Access Lichess puzzle history and dashboard.
Our collection of puzzles is in the public domain, you can download it here. For a list of our puzzle themes with their description, check out the theme translation file. The daily puzzle can be posted in your slack workspace.
Get the daily Lichess puzzle in JSON format. Alternatively, you can post it in your slack workspace.
{- "game": {
- "clock": "3+0",
- "id": "AHGPPS44",
- "perf": {
- "key": "blitz",
- "name": "Blitz"
}, - "pgn": "d4 d5 Bf4 Bf5 Nf3 e6 c4 Nf6 Nc3 Bd6 Bg3 Nbd7 e3 O-O c5 Bxg3 hxg3 h6 Bd3 Ne4 Qc2 Ndf6 Nd2 Nxc3 Bxf5 exf5 bxc3 Ne4 Nxe4 fxe4 Rb1 b6 Rh5 bxc5 Rb5 cxd4 cxd4 c6 Qxc6 Rc8 Qxd5 Qf6 Qxe4 Rc1+ Ke2 Qa6 Qd5 Rc2+ Kf3 g6 Rxh6 Qf6+ Ke4",
- "players": [
- {
- "color": "white",
- "flair": "travel-places.ambulance",
- "id": "ericrosen",
- "name": "EricRosen",
- "patron": true,
- "rating": 2642,
- "title": "IM"
}, - {
- "color": "black",
- "id": "anton_volovikov",
- "name": "Anton_Volovikov",
- "rating": 2619,
- "title": "FM"
}
], - "rated": true
}, - "puzzle": {
- "id": "PSjmf",
- "initialPly": 52,
- "plays": 566,
- "rating": 2705,
- "solution": [
- "g8g7",
- "d5e5",
- "f6e5"
], - "themes": [
- "endgame",
- "master",
- "short",
- "masterVsMaster",
- "crushing"
]
}
}
Get a single Lichess puzzle in JSON format.
id required | string The puzzle ID |
{- "game": {
- "clock": "3+0",
- "id": "AHGPPS44",
- "perf": {
- "key": "blitz",
- "name": "Blitz"
}, - "pgn": "d4 d5 Bf4 Bf5 Nf3 e6 c4 Nf6 Nc3 Bd6 Bg3 Nbd7 e3 O-O c5 Bxg3 hxg3 h6 Bd3 Ne4 Qc2 Ndf6 Nd2 Nxc3 Bxf5 exf5 bxc3 Ne4 Nxe4 fxe4 Rb1 b6 Rh5 bxc5 Rb5 cxd4 cxd4 c6 Qxc6 Rc8 Qxd5 Qf6 Qxe4 Rc1+ Ke2 Qa6 Qd5 Rc2+ Kf3 g6 Rxh6 Qf6+ Ke4",
- "players": [
- {
- "color": "white",
- "flair": "travel-places.ambulance",
- "id": "ericrosen",
- "name": "EricRosen",
- "patron": true,
- "rating": 2642,
- "title": "IM"
}, - {
- "color": "black",
- "id": "anton_volovikov",
- "name": "Anton_Volovikov",
- "rating": 2619,
- "title": "FM"
}
], - "rated": true
}, - "puzzle": {
- "id": "PSjmf",
- "initialPly": 52,
- "plays": 566,
- "rating": 2705,
- "solution": [
- "g8g7",
- "d5e5",
- "f6e5"
], - "themes": [
- "endgame",
- "master",
- "short",
- "masterVsMaster",
- "crushing"
]
}
}
Download your puzzle activity in ndjson format. Puzzle activity is sorted by reverse chronological order (most recent first) We recommend streaming the response, for it can be very long.
max | integer >= 1 How many entries to download. Leave empty to download all activity. |
before | integer >= 1356998400070 Download entries before this timestamp. Defaults to now. Use |
{- "date": 1717460624888,
- "puzzle": {
- "fen": "6k1/3rqpp1/5b1p/p1p1pP1Q/1pB4P/1P1R1PP1/P7/6K1 w - - 1 1",
- "id": "BlOLL",
- "lastMove": "c7d7",
- "plays": 14703,
- "rating": 2018,
- "solution": [
- "h5f7",
- "e7f7",
- "d3d7",
- "f7c4",
- "b3c4"
], - "themes": [
- "endgame",
- "crushing",
- "long",
- "sacrifice",
- "pin"
]
}, - "win": true
}
Download your puzzle dashboard as JSON. Also includes all puzzle themes played, with aggregated results. Allows re-creating the improvement/strengths interfaces.
days required | integer >= 1 How many days to look back when aggregating puzzle results. 30 is sensible. |
{- "days": 30,
- "global": {
- "firstWins": 1,
- "nb": 2,
- "performance": 2032,
- "puzzleRatingAvg": 2032,
- "replayWins": 0
}, - "themes": {
- "defensiveMove": {
- "results": {
- "firstWins": 0,
- "nb": 1,
- "performance": 1547,
- "puzzleRatingAvg": 2047,
- "replayWins": 0
}, - "theme": "Defensive move"
}, - "endgame": {
- "results": {
- "firstWins": 1,
- "nb": 2,
- "performance": 2032,
- "puzzleRatingAvg": 2032,
- "replayWins": 0
}, - "theme": "Endgame"
}, - "pin": {
- "results": {
- "firstWins": 1,
- "nb": 1,
- "performance": 2518,
- "puzzleRatingAvg": 2018,
- "replayWins": 0
}, - "theme": "Pin"
}, - "sacrifice": {
- "results": {
- "firstWins": 1,
- "nb": 1,
- "performance": 2518,
- "puzzleRatingAvg": 2018,
- "replayWins": 0
}, - "theme": "Sacrifice"
}
}
}
Download the storm dashboard of any player as JSON.
Contains the aggregated highscores, and the history of storm runs aggregated by days.
Use ?days=0
if you only care about the highscores.
username required | string Username of the player |
days | integer [ 0 .. 365 ] Default: 30 How many days of history to return |
{- "days": [
- {
- "_id": "2024/6/4",
- "combo": 32,
- "errors": 5,
- "highest": 1590,
- "moves": 60,
- "runs": 1,
- "score": 24,
- "time": 174
}
], - "high": {
- "allTime": 24,
- "day": 24,
- "month": 24,
- "week": 24
}
}
Create a new private puzzle race. The Lichess user who creates the race must join the race page, and manually start the race when enough players have joined.
{- "id": "MT4hr",
}
Access and manage Lichess teams and their members. https://lichess.org/team
Get all swiss tournaments of a team. Tournaments are sorted by reverse chronological order of start date (last starting first). Tournaments are streamed as ndjson.
teamId required | string Example: coders |
max | integer >= 1 Default: 100 How many tournaments to download. |
{- "clock": {
- "increment": 0,
- "limit": 600
}, - "createdBy": "lichess",
- "id": "SuwsOIhE",
- "name": "Rapid",
- "nbOngoing": 0,
- "nbPlayers": 37,
- "nbRounds": 7,
- "rated": true,
- "round": 7,
- "startsAt": "2024-06-11T02:00:00Z",
- "stats": {
- "absences": 133,
- "averageRating": 1896,
- "blackWins": 44,
- "byes": 5,
- "draws": 6,
- "games": 53,
- "whiteWins": 56
}, - "status": "finished",
- "variant": "standard",
- "verdicts": {
- "accepted": true,
- "list": [
- {
- "condition": "≥ 8 Rapid rated games",
- "verdict": "ok"
}, - {
- "condition": "Play your games",
- "verdict": "ok"
}
]
}
}
Public info about a team. Includes the list of publicly visible leaders.
teamId required | string |
{- "id": "lichess-swiss",
- "name": "Lichess Swiss",
- "description": "The official Lichess Swiss team. We organize regular swiss tournaments for all to join.",
- "flair": "food-drink.cheese-wedge",
- "leader": {
- "flair": "activity.lichess",
- "id": "lichess",
- "name": "Lichess",
- "patron": true
}, - "leaders": [
- {
- "flair": "activity.lichess",
- "id": "lichess",
- "name": "Lichess",
- "patron": true
}
], - "nbMembers": 487629,
- "open": true,
- "joined": false,
- "requested": false
}
Paginator of the most popular teams.
page | number Default: 1 Example: page=1 |
{- "currentPage": 4,
- "maxPerPage": 15,
- "currentPageResults": [
- {
- "id": "lichess-swiss",
- "name": "Lichess Swiss",
- "description": "The official Lichess Swiss team. We organize regular swiss tournaments for all to join.",
- "flair": "food-drink.cheese-wedge",
- "leader": {
- "flair": "activity.lichess",
- "id": "lichess",
- "name": "Lichess",
- "patron": true
}, - "leaders": [
- {
- "flair": "activity.lichess",
- "id": "lichess",
- "name": "Lichess",
- "patron": true
}
], - "nbMembers": 487629,
- "open": true,
- "joined": false,
- "requested": false
}
], - "nbResults": 205194,
- "previousPage": 3,
- "nextPage": 5,
- "nbPages": 13680
}
All the teams a player is a member of.
username required | string Example: thibault |
[- {
- "id": "lichess-swiss",
- "name": "Lichess Swiss",
- "description": "The official Lichess Swiss team. We organize regular swiss tournaments for all to join.",
- "flair": "food-drink.cheese-wedge",
- "leader": {
- "flair": "activity.lichess",
- "id": "lichess",
- "name": "Lichess",
- "patron": true
}, - "leaders": [
- {
- "flair": "activity.lichess",
- "id": "lichess",
- "name": "Lichess",
- "patron": true
}
], - "nbMembers": 487629,
- "open": true,
- "joined": false,
- "requested": false
}
]
Paginator of team search results for a keyword.
text | string Example: text=coders |
page | number Default: 1 Example: page=1 |
{- "currentPage": 4,
- "maxPerPage": 15,
- "currentPageResults": [
- {
- "id": "lichess-swiss",
- "name": "Lichess Swiss",
- "description": "The official Lichess Swiss team. We organize regular swiss tournaments for all to join.",
- "flair": "food-drink.cheese-wedge",
- "leader": {
- "flair": "activity.lichess",
- "id": "lichess",
- "name": "Lichess",
- "patron": true
}, - "leaders": [
- {
- "flair": "activity.lichess",
- "id": "lichess",
- "name": "Lichess",
- "patron": true
}
], - "nbMembers": 487629,
- "open": true,
- "joined": false,
- "requested": false
}
], - "nbResults": 205194,
- "previousPage": 3,
- "nextPage": 5,
- "nbPages": 13680
}
Members are sorted by reverse chronological order of joining the team (most recent first). OAuth is only required if the list of members is private. Up to 5,000 users are streamed as ndjson.
teamId required | string Example: coders |
full | boolean Default: false Full user documents with performance ratings. This limits the response to 1,000 users. |
{- "joinedTeamAt": 1716930043067,
- "id": "chess-network",
- "name": "Chess-Network",
- "title": "NM",
- "patron": true
}
Get all Arena tournaments relevant to a team. Tournaments are sorted by reverse chronological order of start date (last starting first). Tournaments are streamed as ndjson.
teamId required | string ID of the team |
max | integer >= 1 Default: 100 How many tournaments to download. |
{- "id": "XhfVxYPG",
- "createdBy": "lichess",
- "system": "arena",
- "minutes": 27,
- "clock": {
- "limit": 60,
- "increment": 0
}, - "rated": true,
- "fullName": "Hourly Bullet Arena",
- "nbPlayers": 4,
- "variant": {
- "key": "standard",
- "short": "Std",
- "name": "Standard"
}, - "startsAt": 1716930043067,
- "finishesAt": 1716931663067,
- "status": 10,
- "perf": {
- "key": "bullet",
- "name": "Bullet",
- "position": 0,
- "icon": "T"
}, - "secondsToStart": 871,
- "minRatedGames": {
- "nb": 20
}, - "schedule": {
- "freq": "hourly",
- "speed": "bullet"
}
}
Join a team.
If the team requires a password but the password
field is incorrect,
then the call fails with 403 Forbidden
.
Similarly, if the team join policy requires a confirmation but the
message
parameter is not given, then the call fails with
403 Forbidden
.
teamId required | string Example: coders |
message | string [ 30 .. 2000 ] characters Required if team manually reviews admission requests. |
password | string Optional password, if the team requires one. |
{- "ok": true
}
Get pending join requests of your team
teamId required | string |
declined | boolean Default: false Get the declined join requests |
[- {
- "request": {
- "date": 1644232474472,
- "message": "Hello, I would like to join the team!",
- "teamId": "coders",
- "userId": "neio"
}, - "user": {
- "createdAt": 1338509698620,
- "id": "neio",
- "perfs": {
- "blitz": {
- "games": 70,
- "prog": 81,
- "prov": true,
- "rating": 1729,
- "rd": 124
}, - "chess960": {
- "games": 2,
- "prog": 0,
- "prov": true,
- "rating": 1528,
- "rd": 266
}
}, - "playTime": {
- "total": 152902,
- "tv": 20800
}, - "profile": {
- "bio": "yuwnt uyn",
- "country": "AL",
- "realName": "ywut wyufth"
}, - "seenAt": 1644232201429,
- "title": "NM",
- "username": "Neio"
}
}
]
Send a private message to all members of a team. You must be a team leader with the "Messages" permission.
teamId required | string Example: coders |
message | string The message to send to all your team members. |
{- "ok": true
}
Play on Lichess with physical boards and third-party clients. Works with normal Lichess accounts. Engine play or assistance is forbidden.
Stream the events reaching a lichess user in real time as ndjson.
An empty line is sent every 6 seconds for keep alive purposes.
Each non-empty line is a JSON object containing a type
field. Possible values are:
gameStart
Start of a gamegameFinish
Completion of a gamechallenge
A player sends you a challenge or you challenge someonechallengeCanceled
A player cancels their challenge to youchallengeDeclined
The opponent declines your challengeWhen the stream opens, all current challenges and games are sent.
{- "type": "gameStart",
- "game": {
- "gameId": "rCRw1AuO",
- "fullId": "rCRw1AuOvonq",
- "color": "black",
- "fen": "r1bqkbnr/pppp2pp/2n1pp2/8/8/3PP3/PPPB1PPP/RN1QKBNR w KQkq - 2 4",
- "hasMoved": true,
- "isMyTurn": false,
- "lastMove": "b8c6",
- "opponent": {
- "id": "philippe",
- "rating": 1790,
- "username": "Philippe"
}, - "perf": "correspondence",
- "rated": true,
- "secondsLeft": 1209600,
- "source": "friend",
- "status": {
- "id": 20,
- "name": "started"
}, - "speed": "correspondence",
- "variant": {
- "key": "standard",
- "name": "Standard"
}, - "compat": {
- "bot": false,
- "board": true
}, - "id": "rCRw1AuO"
}
}
Create a public seek, to start a game with a random player.
Specify the time
and increment
clock values. The response is streamed but doesn't contain any information.
Keep the connection open to keep the seek active.
If the client closes the connection, the seek is canceled. This way, if the client terminates, the user won't be paired in a game they wouldn't play. When the seek is accepted, or expires, the server closes the connection.
Make sure to also have an Event stream open, to be notified when a game starts. We recommend opening the Event stream first, then the seek stream. This way, you won't miss the game event if the seek is accepted immediately.
Specify the days
per turn value. The response is not streamed, it immediately completes with the seek ID. The seek remains active on the server until it is joined by someone.
Parameters of the seek
rated | boolean Default: false Whether the game is rated and impacts players ratings. |
time | number [ 0 .. 180 ] Clock initial time in minutes. Required for real-time seeks. |
increment | integer [ 0 .. 180 ] Clock increment in seconds. Required for real-time seeks. |
days | integer Enum: 1 2 3 5 7 10 14 Days per turn. Required for correspondence seeks. |
variant | string (VariantKey) Enum: "standard" "chess960" "crazyhouse" "antichess" "atomic" "horde" "kingOfTheHill" "racingKings" "threeCheck" "fromPosition" |
color | string Default: "random" Enum: "random" "white" "black" The color to play. Better left empty to automatically get 50% white. |
ratingRange | string The rating range of potential opponents. Better left empty. Example: 1500-1800 |
Stream the state of a game being played with the Board API, as ndjson.
Use this endpoint to get updates about the game in real-time, with a single request.
Each line is a JSON object containing a type
field. Possible values are:
gameFull
Full game data. All values are immutable, except for the state
field.
gameState
Current state of the game. Immutable values not included. Sent when a move is played, a draw is offered, or when the game ends.
chatLine
Chat message sent by a user in the room
"player" or "spectator".
opponentGone
Whether the opponent has left the game, and how long before you can claim a win or draw.
The first line is always of type gameFull
.
The server closes the stream when the game ends, or if the game has already ended.
gameId required | string Example: 5IrD6Gzz |
{- "id": "QdzzBlzY",
- "variant": {
- "key": "standard",
- "name": "Standard",
- "short": "Std"
}, - "speed": "blitz",
- "perf": {
- "name": "Blitz"
}, - "rated": true,
- "createdAt": 1714920830966,
- "white": {
- "id": "bobby",
- "name": "Bobby",
- "title": "GM",
- "rating": 1956
}, - "black": {
- "id": "bot1",
- "name": "Bot1",
- "title": "BOT",
- "rating": 1500,
- "provisional": true
}, - "initialFen": "startpos",
- "clock": {
- "initial": 300000,
- "increment": 0
}, - "type": "gameFull",
- "state": {
- "type": "gameState",
- "moves": "e2e4 e7e5 g1f3 b8c6 f1c4",
- "wtime": 294810,
- "btime": 286000,
- "winc": 0,
- "binc": 0,
- "status": "started"
}
}
Make a move in a game being played with the Board API. The move can also contain a draw offer/agreement.
gameId required | string Example: 5IrD6Gzz |
move required | string Example: e2e4 The move to play, in UCI format |
offeringDraw | boolean Whether to offer (or agree to) a draw |
{- "ok": true
}
Post a message to the player or spectator chat, in a game being played with the Board API.
gameId required | string Example: 5IrD6Gzz |
room required | string Enum: "player" "spectator" |
text required | string |
{- "ok": true
}
Get the messages posted in the game chat
gameId required | string Example: 5IrD6Gzz |
[- {
- "text": "Takeback sent",
- "user": "lichess"
}, - {
- "text": "Takeback accepted",
- "user": "lichess"
}, - {
- "text": "Good game, well played",
- "user": "thibault"
}
]
Create/accept/decline draw offers.
yes
: Offer a draw, or accept the opponent's draw offer.no
: Decline a draw offer from the opponent.gameId required | string Example: 5IrD6Gzz |
required | boolean or "yes" (string) Example: yes |
{- "ok": true
}
Create/accept/decline takebacks.
yes
: Propose a takeback, or accept the opponent's takeback offer.no
: Decline a takeback offer from the opponent.gameId required | string Example: 5IrD6Gzz |
required | boolean or "yes" (string) Example: yes |
{- "ok": true
}
Go berserk on an arena tournament game. Halves the clock time, grants an extra point upon winning. Only available in arena tournaments that allow berserk, and before each player has made a move.
gameId required | string Example: 5IrD6Gzz |
{- "ok": true
}
Play on Lichess as a bot. Allows engine play. Read the blog post announcement of lichess bots.
Only works with Bot accounts.
Stream the events reaching a lichess user in real time as ndjson.
An empty line is sent every 6 seconds for keep alive purposes.
Each non-empty line is a JSON object containing a type
field. Possible values are:
gameStart
Start of a gamegameFinish
Completion of a gamechallenge
A player sends you a challenge or you challenge someonechallengeCanceled
A player cancels their challenge to youchallengeDeclined
The opponent declines your challengeWhen the stream opens, all current challenges and games are sent.
{- "type": "gameStart",
- "game": {
- "gameId": "rCRw1AuO",
- "fullId": "rCRw1AuOvonq",
- "color": "black",
- "fen": "r1bqkbnr/pppp2pp/2n1pp2/8/8/3PP3/PPPB1PPP/RN1QKBNR w KQkq - 2 4",
- "hasMoved": true,
- "isMyTurn": false,
- "lastMove": "b8c6",
- "opponent": {
- "id": "philippe",
- "rating": 1790,
- "username": "Philippe"
}, - "perf": "correspondence",
- "rated": true,
- "secondsLeft": 1209600,
- "source": "friend",
- "status": {
- "id": 20,
- "name": "started"
}, - "speed": "correspondence",
- "variant": {
- "key": "standard",
- "name": "Standard"
}, - "compat": {
- "bot": false,
- "board": true
}, - "id": "rCRw1AuO"
}
}
Stream the online bot users, as ndjson. Throttled to 50 bot users per second.
nb | integer >= 1 Example: nb=20 How many bot users to fetch |
{- "id": "georges-bot",
- "username": "Georges-bot",
- "perfs": {
- "chess960": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "atomic": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "racingKings": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "ultraBullet": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "blitz": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "kingOfTheHill": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "bullet": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "correspondence": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "horde": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "puzzle": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "classical": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "rapid": {
- "games": 2945,
- "rating": 1609,
- "rd": 60,
- "prog": -22,
- "prov": true
}, - "storm": {
- "runs": 44,
- "score": 61
}, - "racer": {
- "runs": 44,
- "score": 61
}, - "streak": {
- "runs": 44,
- "score": 61
}
}, - "createdAt": 1290415680000,
- "disabled": false,
- "tosViolation": false,
- "profile": {
- "flag": "EC",
- "location": "string",
- "bio": "Free bugs!",
- "realName": "Georges Bot",
- "fideRating": 1500,
- "uscfRating": 1500,
- "ecfRating": 1500,
- "cfcRating": 1500,
- "dsbRating": 1500,
- "links": "github.com/lichess-bot-devs/lichess-bot"
}, - "seenAt": 1522636452014,
- "patron": true,
- "verified": true,
- "playTime": {
- "total": 3296897,
- "tv": 12134
}, - "title": "BOT"
}
Upgrade a lichess player account into a Bot account. Only Bot accounts can use the Bot API. The account cannot have played any game before becoming a Bot account. The upgrade is irreversible. The account will only be able to play as a Bot. To upgrade an account to Bot, use the official lichess-bot client, or follow these steps:
curl -d '' https://lichess.org/api/bot/account/upgrade -H "Authorization: Bearer <yourTokenHere>"
To know if an account has already been upgraded, use the Get my profile API:
the title
field should be set to BOT
.{- "ok": true
}
Stream the state of a game being played with the Bot API, as ndjson.
Use this endpoint to get updates about the game in real-time, with a single request.
Each line is a JSON object containing a type
field. Possible values are:
gameFull
Full game data. All values are immutable, except for the state
field.
gameState
Current state of the game. Immutable values not included.
chatLine
Chat message sent by a user (or the bot itself) in the room
"player" or "spectator".
opponentGone
Whether the opponent has left the game, and how long before you can claim a win or draw.
The first line is always of type gameFull
.
gameId required | string Example: 5IrD6Gzz |
{- "id": "QdzzBlzY",
- "variant": {
- "key": "standard",
- "name": "Standard",
- "short": "Std"
}, - "speed": "blitz",
- "perf": {
- "name": "Blitz"
}, - "rated": true,
- "createdAt": 1714920830966,
- "white": {
- "id": "bobby",
- "name": "Bobby",
- "title": "GM",
- "rating": 1956
}, - "black": {
- "id": "bot1",
- "name": "Bot1",
- "title": "BOT",
- "rating": 1500,
- "provisional": true
}, - "initialFen": "startpos",
- "clock": {
- "initial": 300000,
- "increment": 0
}, - "type": "gameFull",
- "state": {
- "type": "gameState",
- "moves": "e2e4 e7e5 g1f3 b8c6 f1c4",
- "wtime": 294810,
- "btime": 286000,
- "winc": 0,
- "binc": 0,
- "status": "started"
}
}
Make a move in a game being played with the Bot API. The move can also contain a draw offer/agreement.
gameId required | string Example: 5IrD6Gzz |
move required | string Example: e2e4 The move to play, in UCI format |
offeringDraw | boolean Whether to offer (or agree to) a draw |
{- "ok": true
}
Post a message to the player or spectator chat, in a game being played with the Bot API.
gameId required | string Example: 5IrD6Gzz |
room required | string Enum: "player" "spectator" |
text required | string |
{- "ok": true
}
Get the messages posted in the game chat
gameId required | string Example: 5IrD6Gzz |
[- {
- "text": "Takeback sent",
- "user": "lichess"
}, - {
- "text": "Takeback accepted",
- "user": "lichess"
}, - {
- "text": "Good game, well played",
- "user": "thibault"
}
]
Create/accept/decline draw offers with the Bot API.
yes
: Offer a draw, or accept the opponent's draw offer.no
: Decline a draw offer from the opponent.gameId required | string Example: 5IrD6Gzz |
required | boolean or "yes" (string) Example: yes |
{- "ok": true
}
Create/accept/decline takebacks with the Bot API.
yes
: Propose a takeback, or accept the opponent's takeback offer.no
: Decline a takeback offer from the opponent.gameId required | string Example: 5IrD6Gzz |
required | boolean or "yes" (string) Example: yes |
{- "ok": true
}
Send and receive challenges to play.
To create a lot of challenges, consider bulk pairing instead.
Get a list of challenges created by or targeted at you.
{- "in": [
- {
- "id": "H9fIRZUk",
- "status": "created",
- "challenger": {
- "id": "bot1",
- "name": "Bot1",
- "rating": 1500,
- "title": "BOT",
- "provisional": true,
- "online": true,
- "lag": 4
}, - "destUser": {
- "id": "bobby",
- "name": "Bobby",
- "rating": 1635,
- "title": "GM",
- "provisional": true,
- "online": true,
- "lag": 4
}, - "variant": {
- "key": "standard",
- "name": "Standard",
- "short": "Std"
}, - "rated": true,
- "speed": "rapid",
- "timeControl": {
- "type": "clock",
- "limit": 600,
- "increment": 0,
- "show": "10+0"
}, - "color": "random",
- "finalColor": "black",
- "perf": {
- "icon": "",
- "name": "Rapid"
}, - "direction": "out"
}
], - "out": [
- {
- "id": "H9fIRZUk",
- "status": "created",
- "challenger": {
- "id": "bot1",
- "name": "Bot1",
- "rating": 1500,
- "title": "BOT",
- "provisional": true,
- "online": true,
- "lag": 4
}, - "destUser": {
- "id": "bobby",
- "name": "Bobby",
- "rating": 1635,
- "title": "GM",
- "provisional": true,
- "online": true,
- "lag": 4
}, - "variant": {
- "key": "standard",
- "name": "Standard",
- "short": "Std"
}, - "rated": true,
- "speed": "rapid",
- "timeControl": {
- "type": "clock",
- "limit": 600,
- "increment": 0,
- "show": "10+0"
}, - "color": "random",
- "finalColor": "black",
- "perf": {
- "icon": "",
- "name": "Rapid"
}, - "direction": "out"
}
]
}
Challenge someone to play. The targeted player can choose to accept or decline.
If the challenge is accepted, you will be notified on the event stream
that a new game has started. The game ID will be the same as the challenge ID.
Challenges for realtime games (not correspondence) expire after 20s if not accepted.
To prevent that, use the keepAliveStream
flag described below.
username required | string Example: LeelaChess |
Parameters of the challenge
rated | boolean Default: false Game is rated and impacts players ratings |
clock.limit | number [ 0 .. 10800 ] Clock initial time in seconds. If empty, a correspondence game is created. Valid values are 0, 15, 30, 45, 60, 90, and any multiple of 60 up to 10800 (3 hours). |
clock.increment | integer [ 0 .. 60 ] Clock increment in seconds. If empty, a correspondence game is created. |
days | integer Enum: 1 2 3 5 7 10 14 Days per move, for correspondence games. Clock settings must be omitted. |
color | string Default: "random" Enum: "random" "white" "black" Which color you get to play |
variant | string (VariantKey) Enum: "standard" "chess960" "crazyhouse" "antichess" "atomic" "horde" "kingOfTheHill" "racingKings" "threeCheck" "fromPosition" |
fen | string (FromPositionFEN) Custom initial position (in FEN). Variant must be standard, fromPosition, or chess960 (if a valid 960 starting position), and the game cannot be rated. |
keepAliveStream | boolean If set, the response is streamed as ndjson.
The challenge is kept alive until the connection is closed by the client.
When the challenge is accepted, declined or canceled, a message of the form |
rules | string Enum: "noAbort" "noRematch" "noGiveTime" "noClaimWin" "noEarlyDraw" Extra game rules separated by commas.
Example: |
{- "id": "H9fIRZUk",
- "status": "created",
- "challenger": {
- "id": "bot1",
- "name": "Bot1",
- "rating": 1500,
- "title": "BOT",
- "provisional": true,
- "online": true,
- "lag": 4
}, - "destUser": {
- "id": "bobby",
- "name": "Bobby",
- "rating": 1635,
- "title": "GM",
- "provisional": true,
- "online": true,
- "lag": 4
}, - "variant": {
- "key": "standard",
- "name": "Standard",
- "short": "Std"
}, - "rated": true,
- "speed": "rapid",
- "timeControl": {
- "type": "clock",
- "limit": 600,
- "increment": 0,
- "show": "10+0"
}, - "color": "random",
- "finalColor": "black",
- "perf": {
- "icon": "",
- "name": "Rapid"
}, - "direction": "out"
}
Get details about a challenge, even if it has been recently accepted, canceled or declined.
challengeId required | string The challenge ID |
{- "id": "H9fIRZUk",
- "status": "created",
- "challenger": {
- "id": "bot1",
- "name": "Bot1",
- "rating": 1500,
- "title": "BOT",
- "provisional": true,
- "online": true,
- "lag": 4
}, - "destUser": {
- "id": "bobby",
- "name": "Bobby",
- "rating": 1635,
- "title": "GM",
- "provisional": true,
- "online": true,
- "lag": 4
}, - "variant": {
- "key": "standard",