FEN
The one-line text format for a chess position.
Forsyth–Edwards Notation records piece placement rank by rank from the 8th, then side to move, castling rights, en passant square, halfmove clock and move number. Every request to this API takes a FEN; POST /v1/validate checks one for free, and the cache ignores the two counters so transpositions share results.
Example
curl -s https://stockfishapi.com/v1/eval \
-H "Authorization: Bearer $STOCKFISH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"fen":"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1","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": "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1",
"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": "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1",
"depth": 14
},
)
data = r.json()