{ "opencollection": "1.0.0", "info": { "name": "Lichess.org API reference Account Tournaments (Arena) API", "version": "2.0.144" }, "items": [ { "info": { "name": "Tournaments (Arena)", "type": "folder" }, "items": [ { "info": { "name": "Get current tournaments", "type": "http" }, "http": { "method": "GET", "url": "https://lichess.org/api/tournament" }, "docs": "Get recently active and finished tournaments.\nThis API is used to display the [Lichess tournament schedule](https://lichess.org/tournament).\n" }, { "info": { "name": "Create a new Arena tournament", "type": "http" }, "http": { "method": "POST", "url": "https://lichess.org/api/tournament", "body": { "type": "form-urlencoded", "data": [ { "name": "name", "value": "" }, { "name": "clockTime", "value": "" }, { "name": "clockIncrement", "value": "" }, { "name": "minutes", "value": "" }, { "name": "waitMinutes", "value": "" }, { "name": "startDate", "value": "" }, { "name": "variant", "value": "" }, { "name": "rated", "value": "" }, { "name": "position", "value": "" }, { "name": "berserkable", "value": "" }, { "name": "streakable", "value": "" }, { "name": "hasChat", "value": "" }, { "name": "description", "value": "" }, { "name": "password", "value": "" }, { "name": "teamBattleByTeam", "value": "" }, { "name": "conditions.teamMember.teamId", "value": "" }, { "name": "conditions.minRating.rating", "value": "" }, { "name": "conditions.maxRating.rating", "value": "" }, { "name": "conditions.nbRatedGame.nb", "value": "" }, { "name": "conditions.allowList", "value": "" }, { "name": "conditions.bots", "value": "" }, { "name": "conditions.accountAge", "value": "" } ] }, "auth": { "type": "oauth2", "flow": "authorization_code", "authorizationUrl": "https://lichess.org/oauth", "accessTokenUrl": "https://lichess.org/api/token", "credentials": { "clientId": "{{clientId}}", "clientSecret": "{{clientSecret}}" } } }, "docs": "Create a public or private Arena tournament.\nThis endpoint mirrors the form on .\nYou can create up to 12 public tournaments per day, or 24 private tournaments.\nA team battle can be created by specifying the `teamBattleByTeam` argument.\nAdditional restrictions:\n - clockTime + clockIncrement > 0\n - 15s and 0+1 variant tournaments cannot be rated\n - Clock time in comparison to tournament length must be reasonable: 3 <= (minutes * 60) / (96 * clockTime + 48 * c" }, { "info": { "name": "Get info about an Arena tournament", "type": "http" }, "http": { "method": "GET", "url": "https://lichess.org/api/tournament/:id", "params": [ { "name": "id", "value": "", "type": "path", "description": "The tournament ID." }, { "name": "page", "value": "", "type": "query", "description": "Specify which page of player standings to view." } ] }, "docs": "Get detailed info about recently finished, current, or upcoming tournament's duels, player standings, and other info.\n" }, { "info": { "name": "Update an Arena tournament", "type": "http" }, "http": { "method": "POST", "url": "https://lichess.org/api/tournament/:id", "params": [ { "name": "id", "value": "", "type": "path", "description": "The tournament ID." } ], "body": { "type": "form-urlencoded", "data": [ { "name": "name", "value": "" }, { "name": "clockTime", "value": "" }, { "name": "clockIncrement", "value": "" }, { "name": "minutes", "value": "" }, { "name": "waitMinutes", "value": "" }, { "name": "startDate", "value": "" }, { "name": "variant", "value": "" }, { "name": "rated", "value": "" }, { "name": "position", "value": "" }, { "name": "berserkable", "value": "" }, { "name": "streakable", "value": "" }, { "name": "hasChat", "value": "" }, { "name": "description", "value": "" }, { "name": "password", "value": "" }, { "name": "conditions.minRating.rating", "value": "" }, { "name": "conditions.maxRating.rating", "value": "" }, { "name": "conditions.nbRatedGame.nb", "value": "" }, { "name": "conditions.allowList", "value": "" }, { "name": "conditions.bots", "value": "" }, { "name": "conditions.accountAge", "value": "" } ] }, "auth": { "type": "oauth2", "flow": "authorization_code", "authorizationUrl": "https://lichess.org/oauth", "accessTokenUrl": "https://lichess.org/api/token", "credentials": { "clientId": "{{clientId}}", "clientSecret": "{{clientSecret}}" } } }, "docs": "Update an Arena tournament.\nBe mindful not to make important changes to ongoing tournaments.\nCan be used to update a team battle.\nAdditional restrictions:\n - clockTime + clockIncrement > 0\n - 15s and 0+1 variant tournaments cannot be rated\n - Clock time in comparison to tournament length must be reasonable: 3 <= (minutes * 60) / (96 * clockTime + 48 * clockIncrement + 15) <= 150\n" }, { "info": { "name": "Join an Arena tournament", "type": "http" }, "http": { "method": "POST", "url": "https://lichess.org/api/tournament/:id/join", "params": [ { "name": "id", "value": "", "type": "path", "description": "The tournament ID." } ], "body": { "type": "form-urlencoded", "data": [ { "name": "password", "value": "" }, { "name": "team", "value": "" }, { "name": "pairMeAsap", "value": "" } ] }, "auth": { "type": "oauth2", "flow": "authorization_code", "authorizationUrl": "https://lichess.org/oauth", "accessTokenUrl": "https://lichess.org/api/token", "credentials": { "clientId": "{{clientId}}", "clientSecret": "{{clientSecret}}" } } }, "docs": "Join an Arena tournament, possibly with a password and/or a team.\nAlso unpauses if you had previously [paused](#tag/arena-tournaments/POST/api/tournament/{id}/withdraw) the tournament.\n" }, { "info": { "name": "Pause or leave an Arena tournament", "type": "http" }, "http": { "method": "POST", "url": "https://lichess.org/api/tournament/:id/withdraw", "params": [ { "name": "id", "value": "", "type": "path", "description": "The tournament ID." } ], "auth": { "type": "oauth2", "flow": "authorization_code", "authorizationUrl": "https://lichess.org/oauth", "accessTokenUrl": "https://lichess.org/api/token", "credentials": { "clientId": "{{clientId}}", "clientSecret": "{{clientSecret}}" } } }, "docs": "Leave a future Arena tournament, or take a break on an ongoing Arena tournament.\nIt's possible to join again later. Points and streaks are preserved.\n" }, { "info": { "name": "Terminate an Arena tournament", "type": "http" }, "http": { "method": "POST", "url": "https://lichess.org/api/tournament/:id/terminate", "params": [ { "name": "id", "value": "", "type": "path", "description": "The tournament ID." } ], "auth": { "type": "oauth2", "flow": "authorization_code", "authorizationUrl": "https://lichess.org/oauth", "accessTokenUrl": "https://lichess.org/api/token", "credentials": { "clientId": "{{clientId}}", "clientSecret": "{{clientSecret}}" } } }, "docs": "Terminate an Arena tournament\n" }, { "info": { "name": "Update a team battle", "type": "http" }, "http": { "method": "POST", "url": "https://lichess.org/api/tournament/team-battle/:id", "params": [ { "name": "id", "value": "", "type": "path", "description": "The tournament ID" } ], "body": { "type": "form-urlencoded", "data": [ { "name": "teams", "value": "" }, { "name": "nbLeaders", "value": "" } ] }, "auth": { "type": "oauth2", "flow": "authorization_code", "authorizationUrl": "https://lichess.org/oauth", "accessTokenUrl": "https://lichess.org/api/token", "credentials": { "clientId": "{{clientId}}", "clientSecret": "{{clientSecret}}" } } }, "docs": "Set the teams and number of leaders of a team battle.\nTo update the other attributes of a team battle, use the [tournament update endpoint](#tag/arena-tournaments/POST/api/tournament/{id}).\n" }, { "info": { "name": "Export games of an Arena tournament", "type": "http" }, "http": { "method": "GET", "url": "https://lichess.org/api/tournament/:id/games", "headers": [ { "name": "Accept", "value": "" } ], "params": [ { "name": "id", "value": "", "type": "path", "description": "The tournament ID." }, { "name": "player", "value": "", "type": "query", "description": "Only games of a particular player. Leave empty to fetch games of all players." }, { "name": "moves", "value": "", "type": "query", "description": "Include the PGN moves." }, { "name": "pgnInJson", "value": "", "type": "query", "description": "Include the full PGN within the JSON response, in a `pgn` field." }, { "name": "tags", "value": "", "type": "query", "description": "Include the PGN tags." }, { "name": "clocks", "value": "", "type": "query", "description": "Include clock status when available.\nEither as PGN comments: `2. exd5 { [%clk 1:01:27] } e5 { [%clk 1:01:28] }`\nOr in a `clocks` JSON field, as centisecond integers, depending on the response type.\n" }, { "name": "evals", "value": "", "type": "query", "description": "Include analysis evaluations and comments, when available.\nEither as PGN comments: `12. Bxf6 { [%eval 0.23] } a3 { [%eval -1.09] }`\nOr in an `analysis` JSON field, depending on the response type.\n" }, { "name": "accuracy", "value": "", "type": "query", "description": "Include [accuracy percent](https://lichess.org/page/accuracy) of each player, when available. Only available in JSON.\n" }, { "name": "opening", "value": "", "type": "query", "description": "Include the opening name.\nExample: `[Opening \"King's Gambit Accepted, King's Knight Gambit\"]`\n" }, { "name": "division", "value": "", "type": "query", "description": "Plies which mark the beginning of the middlegame and endgame.\nOnly available in JSON\n" } ] }, "docs": "Download games of a tournament in PGN or [ndjson](#description/streaming-with-nd-json) format.\nGames are sorted by reverse chronological order (most recent first).\nThe game stream is throttled, depending on who is making the request:\n - Anonymous request: 20 games per second\n - [OAuth2 authenticated](#description/authentication) request: 30 games per second\n" }, { "info": { "name": "Get results of an Arena tournament", "type": "http" }, "http": { "method": "GET", "url": "https://lichess.org/api/tournament/:id/results", "params": [ { "name": "id", "value": "", "type": "path", "description": "The tournament ID." }, { "name": "nb", "value": "", "type": "query", "description": "Max number of players to fetch" }, { "name": "sheet", "value": "", "type": "query", "description": "Add a `sheet` field to the player document.\nIt's an expensive server computation that slows down the stream.\n" } ] }, "docs": "Players of an Arena tournament, with their score and performance, sorted by rank (best first).\n**Players are streamed as [ndjson](#description/streaming-with-nd-json)**, i.e. one JSON object per line.\nIf called on an ongoing tournament, results can be inconsistent\ndue to ranking changes while the players are being streamed.\nUse on finished tournaments for guaranteed consistency.\n" }, { "info": { "name": "Get team standing of a team battle", "type": "http" }, "http": { "method": "GET", "url": "https://lichess.org/api/tournament/:id/teams", "params": [ { "name": "id", "value": "", "type": "path", "description": "The tournament ID." } ] }, "docs": "Teams of a team battle tournament, with top players, sorted by rank (best first).\n" }, { "info": { "name": "Get tournaments created by a user", "type": "http" }, "http": { "method": "GET", "url": "https://lichess.org/api/user/:username/tournament/created", "params": [ { "name": "username", "value": "", "type": "path", "description": "The user whose created tournaments to fetch" }, { "name": "nb", "value": "", "type": "query", "description": "Max number of tournaments to fetch" }, { "name": "status", "value": "", "type": "query", "description": "Include tournaments in the given status: \"Created\" (10), \"Started\" (20), \"Finished\" (30)\nYou can add this parameter more than once to include tournaments in different statuses.\nExample: `?status=10&status=20`\n" } ], "auth": { "type": "oauth2", "flow": "authorization_code", "authorizationUrl": "https://lichess.org/oauth", "accessTokenUrl": "https://lichess.org/api/token", "credentials": { "clientId": "{{clientId}}", "clientSecret": "{{clientSecret}}" } } }, "docs": "Get all tournaments created by a given user.\nTournaments are sorted by reverse chronological order of start date (last starting first).\nTournaments are streamed as [ndjson](#description/streaming-with-nd-json).\nThe stream is throttled, depending on who is making the request:\n - Anonymous request: 20 tournaments per second\n - [OAuth2 authenticated](#description/authentication) request: 30 tournaments per second\n - Authenticated, downloading your own tournaments: 50 tournaments per second\n" }, { "info": { "name": "Get tournaments played by a user", "type": "http" }, "http": { "method": "GET", "url": "https://lichess.org/api/user/:username/tournament/played", "params": [ { "name": "username", "value": "", "type": "path", "description": "The user whose played tournaments to fetch" }, { "name": "nb", "value": "", "type": "query", "description": "Max number of tournaments to fetch" }, { "name": "performance", "value": "", "type": "query", "description": "Include the player performance rating in the response, at some cost for the server.\n" } ], "auth": { "type": "oauth2", "flow": "authorization_code", "authorizationUrl": "https://lichess.org/oauth", "accessTokenUrl": "https://lichess.org/api/token", "credentials": { "clientId": "{{clientId}}", "clientSecret": "{{clientSecret}}" } } }, "docs": "Get all tournaments played by a given user.\nTournaments are sorted by reverse chronological order of start date (last played first).\nTournaments are streamed as [ndjson](#description/streaming-with-nd-json).\nThe stream is throttled, depending on who is making the request:\n - Anonymous request: 20 tournaments per second\n - [OAuth2 authenticated](#description/authentication) request: 30 tournaments per second\n - Authenticated, downloading your own tournaments: 50 tournaments per second\n" }, { "info": { "name": "Get team Arena tournaments", "type": "http" }, "http": { "method": "GET", "url": "https://lichess.org/api/team/:teamId/arena", "params": [ { "name": "teamId", "value": "", "type": "path", "description": "ID of the team" }, { "name": "max", "value": "", "type": "query", "description": "How many tournaments to download." }, { "name": "status", "value": "", "type": "query", "description": "[Filter] Only arena tournaments in this current state.\n" }, { "name": "createdBy", "value": "", "type": "query", "description": "[Filter] Only arena tournaments created by a given user.\n" }, { "name": "name", "value": "", "type": "query", "description": "[Filter] Only arena tournaments with a given name.\n" } ] }, "docs": "Get all Arena tournaments relevant to a team.\nTournaments are sorted by reverse chronological order of start date (last starting first).\nTournaments are streamed as [ndjson](#description/streaming-with-nd-json).\n" } ] } ], "bundled": true }