Exact endgame result (7 pieces or fewer)
tablebaseGet perfect play results for chess endgames with 7 or fewer pieces from Lichess's endgame database, including win/draw/loss, distance to mate or zeroing, and ranked moves.
Instructions
Exact result for an endgame with 7 or fewer pieces from the Lichess tablebase: win/draw/loss for the side to move, distance to mate or zeroing, and every move ranked. This is perfect play, not an estimate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fen | Yes | Position in FEN, e.g. "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1". Move counters may be omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dtm | Yes | Distance to mate in plies, when known (positive = side to move mates). | |
| dtz | Yes | Distance to zeroing move (capture or pawn move), in plies. | |
| fen | Yes | ||
| moves | Yes | Legal moves, best first (as Lichess sorts them), up to 8. | |
| pieces | Yes | ||
| result | Yes | For the side to move: win, loss, draw, cursed-win, blessed-loss, maybe-win, maybe-loss, unknown. | |
| source | Yes | ||
| verdict | Yes | One sentence, built from the tablebase result. | |
| checkmate | Yes | ||
| stalemate | Yes | ||
| side_to_move | Yes | ||
| insufficient_material | Yes |