Public API

This public API is available for free and provided without any guarantees on a best-effort basis.

JSON

GET argument fen is required.

Status code 400 if the fen argument is missing, invalid or the corresponding position is illegal.

{
  "bestmove": "f7e6",
  "dtm": null,
  "dtz": 484,
  "moves": {
    "f7e6": {
      "dtm": null,
      "dtz": -483,
      "wdl": -1
    },
    "f7e8": {
      "dtm": null,
      "dtz": 0,
      "wdl": 0
    },
    "f7f6": {
      "dtm": null,
      "dtz": 0,
      "wdl": 0
    },
    "f7f8": {
      "dtm": null,
      "dtz": 0,
      "wdl": 0
    },
    "f7g6": {
      "dtm": null,
      "dtz": 0,
      "wdl": 0
    },
    "g7g1": {
      "dtm": null,
      "dtz": 0,
      "wdl": 0
    },
    "g7g2": {
      "dtm": null,
      "dtz": 0,
      "wdl": 0
    },
    "g7g3": {
      "dtm": null,
      "dtz": 0,
      "wdl": 0
    },
    "g7g4": {
      "dtm": null,
      "dtz": 0,
      "wdl": 0
    },
    "g7g5": {
      "dtm": null,
      "dtz": 0,
      "wdl": 0
    },
    "g7g6": {
      "dtm": null,
      "dtz": 0,
      "wdl": 0
    },
    "g7h7": {
      "dtm": null,
      "dtz": 0,
      "wdl": 0
    },
    "g8e7": {
      "dtm": null,
      "dtz": 0,
      "wdl": 0
    },
    "g8f6": {
      "dtm": null,
      "dtz": 0,
      "wdl": 0
    },
    "g8h6": {
      "dtm": null,
      "dtz": 0,
      "wdl": 0
    }
  },
  "wdl": 1
}

wdl is 2 if the side to move is winning, 1 for a cursed win (that can not be realized under the fifty-move rule), 0 for a draw, -1 for a blessed loss and -2 for a loss.

dtz is the distance to zero as found in 6 piece Syzygy tablebases. The absolute value is 0 for a draw and otherwise the number of halfmoves for the winning side to force a pawn move or capture. The DTZ is positive if the side to move is winning. 100 is added to the absolute value indicate 50-move-rule draws in a later phase. In some cases the value can be off by one, but never so that it changes the outcome of practical play.

dtm is the distance to mate as found in 5 piece Gaviota tablebases.

moves is a dictionary containing all legal moves as keys (in UCI notation). In turn, each entry has a wdl, dtz and dtm values.

bestmove is a DTZ optimal move.

Any of the mentioned values might be null if the requested information was not available in the tablebases.

CORS

CORS is allowed for all origins.

JSONP

There is an optional callback argument for the normal JSON endpoint.

HTTP without TLS

HSTS is enabled for the entire site. However for clients that do not support TLS the API endpoint is also available via HTTP.

Download

If you want to use tablebase information in a chess engine you certainly need your own local tablebase files.

Generating the tablebases requires time and resources. It might be easier to download the tablebases via BitTorrent or via eMule or via HTTP (combined size about 150GB) with a fast internet connection.

Fork me on GitHub