NNUE
The neural network Stockfish uses to evaluate positions since 2020.
NNUE (efficiently updatable neural network) replaced the hand-tuned evaluation. The network scores a position from the piece-square features and is updated incrementally as moves are made, so it runs on CPUs at millions of positions per second. Stockfish ships a large and a small net; this API's in-Worker engine uses the small net, the native fast lane uses the large one.
Example
curl -s https://stockfishapi.com/v1/eval \
-H "Authorization: Bearer $STOCKFISH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"fen":"rnbqk2r/ppp1ppbp/6p1/8/3PP3/2P5/P4PPP/R1BQKBNR w KQkq - 1 7","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": "rnbqk2r/ppp1ppbp/6p1/8/3PP3/2P5/P4PPP/R1BQKBNR w KQkq - 1 7",
"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": "rnbqk2r/ppp1ppbp/6p1/8/3PP3/2P5/P4PPP/R1BQKBNR w KQkq - 1 7",
"depth": 14
},
)
data = r.json()