org.lichess.puzzle.getRandom
Get a random chess puzzle. Optionally filter by a target rating (a random puzzle within 100 of it is returned) and/or themes (matching at least one). With no parameters, returns a truly random puzzle from the dataset with no filtering.
Details · query
| Kind | query |
|---|---|
| Authority | puzzle.lichess.org |
| Indexed |
Checks
Validunlimited-stringdefs.main.parameters.properties.themes.itemsNo maxLength, maxGraphemes or format limits this string.
{
"$type": "com.atproto.lexicon.schema",
"defs": {
"main": {
"description": "Get a random chess puzzle. Optionally filter by a target rating (a random puzzle within 100 of it is returned) and/or themes (matching at least one). With no parameters, returns a truly random puzzle from the dataset with no filtering.",
"errors": [
{
"description": "No puzzle matches the given rating and/or theme filters.",
"name": "PuzzleNotFound"
}
],
"output": {
"encoding": "application/json",
"schema": {
"ref": "org.lichess.puzzle.defs#puzzleView",
"type": "ref"
}
},
"parameters": {
"properties": {
"rating": {
"description": "a target Glicko-2 rating; a random puzzle whose rating is within 100 of this value is returned. When omitted, rating is not filtered.",
"minimum": 0,
"type": "integer"
},
"themes": {
"description": "restrict the result to puzzles matching at least one of these themes (e.g. \"fork\", \"endgame\"). When omitted, themes are not filtered.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "params"
},
"type": "query"
}
},
"id": "org.lichess.puzzle.getRandom",
"lexicon": 1
}