Answers.Body: <p>I found <a href="https://chess-api.com/" rel="nofollow noreferrer">https://chess-api.com/</a>. Quite easy but has limited depth (18). Runs SF 16.1 NNUE.</p>
  <p>Example POST request:</p>
  <pre><code>async function postChessApi(data = {}) {
      const response = await fetch(&quot;https://chess-api.com/v1&quot;, {
          method: &quot;POST&quot;,
          headers: {
              &quot;Content-Type&quot;: &quot;application/json&quot;
          },
          body: JSON.stringify(data),
      });
      return response.json();
  }
  </code></pre>
  <pre><code>postChessApi({ fen: &quot;7Q/8/8/6k1/2K5/8/8/8 w - -&quot;, depth: 30, variants: 1 }).then((data) =&gt; {
      console.log(data);
  });
  </code></pre>
  <p>Response:</p>
  <pre><code>{
      &quot;text&quot;: &quot;Move h8 → e5 (Qe5+): [100]. White is winning. Depth 18.&quot;,
      &quot;captured&quot;: false,
      &quot;promotion&quot;: false,
      &quot;isCapture&quot;: false,
      &quot;isPromotion&quot;: false,
      &quot;isCastling&quot;: false,
      &quot;fen&quot;: &quot;7Q/8/8/6k1/2K5/8/8/8 w - - 0 1&quot;,
      &quot;type&quot;: &quot;bestmove&quot;,
      &quot;depth&quot;: 18,
      &quot;move&quot;: &quot;h8e5&quot;,
      &quot;eval&quot;: 100,
      &quot;centipawns&quot;: 10000,
      &quot;mate&quot;: &quot;13&quot;,
      &quot;continuationArr&quot;: [
          &quot;g5g6&quot;,
          &quot;e5e6&quot;,
          &quot;g6g5&quot;,
          &quot;c4d4&quot;,
          &quot;g5f4&quot;,
          &quot;e6f6&quot;,
          &quot;f4g3&quot;,
          &quot;f6f5&quot;,
          &quot;g3g2&quot;,
          &quot;d4d3&quot;,
          &quot;g2g3&quot;,
          &quot;d3e2&quot;,
          &quot;g3h4&quot;,
          &quot;e2e3&quot;,
          &quot;h4g3&quot;,
          &quot;f5g5&quot;,
          &quot;g3h2&quot;
      ],
      &quot;debug&quot;: &quot;info depth 18 seldepth 21 multipv 1 score mate 13 nodes 98918 nps 32972666 hashfull 15 tbhits 0 time 3 pv h8e5 g5g6 e5e6 g6g5 c4d4 g5f4 e6f6 f4g3 f6f5 g3g2 d4d3 g2g3 d3e2 g3h4 e2e3 h4g3 f5g5 g3h2&quot;,
      &quot;winChance&quot;: 100,
      &quot;taskId&quot;: &quot;8w3cp3pf1&quot;,
      &quot;turn&quot;: &quot;w&quot;,
      &quot;color&quot;: &quot;w&quot;,
      &quot;piece&quot;: &quot;q&quot;,
      &quot;from&quot;: &quot;h8&quot;,
      &quot;to&quot;: &quot;e5&quot;,
      &quot;san&quot;: &quot;Qe5+&quot;,
      &quot;flags&quot;: &quot;n&quot;,
      &quot;lan&quot;: &quot;h8e5&quot;,
      &quot;fromNumeric&quot;: &quot;88&quot;,
      &quot;toNumeric&quot;: &quot;55&quot;,
      &quot;continuation&quot;: [
          {
              &quot;from&quot;: &quot;g5&quot;,
              &quot;to&quot;: &quot;g6&quot;,
              &quot;fromNumeric&quot;: &quot;75&quot;,
              &quot;toNumeric&quot;: &quot;76&quot;
          },
          {
              &quot;from&quot;: &quot;e5&quot;,
              &quot;to&quot;: &quot;e6&quot;,
              &quot;fromNumeric&quot;: &quot;55&quot;,
              &quot;toNumeric&quot;: &quot;56&quot;
          }
      ]
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-05T10:47:49.827Z
Answers.LastActivityDate: 2024-03-05T10:47:49.827Z
Answers.UserDisplayName: stealz
Answers.Body: <p>I think it's unlikely that you will find publically accessible API like this, since engines aren't cheap to run on scale.</p>
  <p>However you can get pretty close. First option is <a href="https://lichess.org/api#tag/Analysis/operation/apiCloudEval" rel="nofollow noreferrer">Lichess cloud evaluations database</a> that exposes engine evaluations for 15 million positions via API. Data available is analysis depth, kilonodes and best variations.</p>
  <p>If you are prepared to host engine yourself and just need to make it accessible via API it's possible with <a href="https://lichess.org/api#tag/External-engine" rel="nofollow noreferrer">Lichess external engine API</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-05T10:12:48.647Z
Answers.LastActivityDate: 2024-03-05T10:12:48.647Z
Answers.UserDisplayName: Matija Sirk
Body: <p>I'm on the hunt for an online Stockfish API where I can send either a FEN/PGN position or a list of moves and get back some info like evaluations / variants / best moves.</p>
  <p>I've been scouring StackExchange posts, but most of the services I've found seem to have gone AWOL. I stumbled upon the stockifish.online website, but it's a bit sluggish and doesn't offer much data.</p>
  <p>Got any other leads?</p>
  
Tags: <engines><analysis><software><stockfish><programming>
Title: Any functional Stockfish online API in 2024? (preferably with WebSocket support)
ThreadText: # Any functional Stockfish online API in 2024? (preferably with WebSocket support)
  
  (Asked by: username_0 on 2024-03-05)
  
  I'm on the hunt for an online Stockfish API where I can send either a FEN/PGN position or a list of moves and get back some info like evaluations / variants / best moves.
  
  I've been scouring StackExchange posts, but most of the services I've found seem to have gone AWOL. I stumbled upon the stockifish.online website, but it's a bit sluggish and doesn't offer much data.
  
  Got any other leads?
  
  **Tags:** engines, analysis, software, stockfish, programming
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2024-03-05. Score: 3 | Accepted answer
  
  I found <https://chess-api.com/>. Quite easy but has limited depth (18). Runs SF 16.1 NNUE.
  
  Example POST request:
  
  ```
  async function postChessApi(data = {}) {
      const response = await fetch("https://chess-api.com/v1", {
          method: "POST",
          headers: {
              "Content-Type": "application/json"
          },
          body: JSON.stringify(data),
      });
      return response.json();
  }
  
  ```
  
  ```
  postChessApi({ fen: "7Q/8/8/6k1/2K5/8/8/8 w - -", depth: 30, variants: 1 }).then((data) => {
      console.log(data);
  });
  
  ```
  
  Response:
  
  ```
  {
      "text": "Move h8 → e5 (Qe5+): [100]. White is winning. Depth 18.",
      "captured": false,
      "promotion": false,
      "isCapture": false,
      "isPromotion": false,
      "isCastling": false,
      "fen": "7Q/8/8/6k1/2K5/8/8/8 w - - 0 1",
      "type": "bestmove",
      "depth": 18,
      "move": "h8e5",
      "eval": 100,
      "centipawns": 10000,
      "mate": "13",
      "continuationArr": [
          "g5g6",
          "e5e6",
          "g6g5",
          "c4d4",
          "g5f4",
          "e6f6",
          "f4g3",
          "f6f5",
          "g3g2",
          "d4d3",
          "g2g3",
          "d3e2",
          "g3h4",
          "e2e3",
          "h4g3",
          "f5g5",
          "g3h2"
      ],
      "debug": "info depth 18 seldepth 21 multipv 1 score mate 13 nodes 98918 nps 32972666 hashfull 15 tbhits 0 time 3 pv h8e5 g5g6 e5e6 g6g5 c4d4 g5f4 e6f6 f4g3 f6f5 g3g2 d4d3 g2g3 d3e2 g3h4 e2e3 h4g3 f5g5 g3h2",
      "winChance": 100,
      "taskId": "8w3cp3pf1",
      "turn": "w",
      "color": "w",
      "piece": "q",
      "from": "h8",
      "to": "e5",
      "san": "Qe5+",
      "flags": "n",
      "lan": "h8e5",
      "fromNumeric": "88",
      "toNumeric": "55",
      "continuation": [
          {
              "from": "g5",
              "to": "g6",
              "fromNumeric": "75",
              "toNumeric": "76"
          },
          {
              "from": "e5",
              "to": "e6",
              "fromNumeric": "55",
              "toNumeric": "56"
          }
      ]
  }
  
  ```
  
  
  ---
  
  ### Answer by username_1 on 2024-03-05. Score: 2
  
  I think it's unlikely that you will find publically accessible API like this, since engines aren't cheap to run on scale.
  
  However you can get pretty close. First option is [Lichess cloud evaluations database](https://lichess.org/api#tag/Analysis/operation/apiCloudEval) that exposes engine evaluations for 15 million positions via API. Data available is analysis depth, kilonodes and best variations.
  
  If you are prepared to host engine yourself and just need to make it accessible via API it's possible with [Lichess external engine API](https://lichess.org/api#tag/External-engine).
  
  
  ---
  
  