Win / draw / loss
The engine's probability estimate for each result, per mille.
Stockfish can translate a centipawn score into expected win, draw and loss rates for the side to move, calibrated on engine games. A +50 cp position might be 25% win, 70% draw, 5% loss. It is more intuitive than centipawns for displaying to players and is on by default in this API (options.show_wdl).
Example
curl -s https://stockfishapi.com/v1/eval \
-H "Authorization: Bearer $STOCKFISH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"fen":"rnbqkb1r/pppppppp/5n2/8/3P1B2/8/PPP1PPPP/RN1QKBNR b KQkq - 2 2","depth":14}' const res = await fetch("https://stockfishapi.com/v1/eval", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.STOCKFISH_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"fen": "rnbqkb1r/pppppppp/5n2/8/3P1B2/8/PPP1PPPP/RN1QKBNR b KQkq - 2 2",
"depth": 14
}),
});
const data = await res.json(); import os, requests
r = requests.post(
"https://stockfishapi.com/v1/eval",
headers={"Authorization": f"Bearer {os.environ['STOCKFISH_API_KEY']}"},
json={
"fen": "rnbqkb1r/pppppppp/5n2/8/3P1B2/8/PPP1PPPP/RN1QKBNR b KQkq - 2 2",
"depth": 14
},
)
data = r.json()