Answers.Body: <p>As others have said, UCI is the API you want.  The full specifications of the protocol is here (the zip file extracts to a text file): <a href="http://download.shredderchess.com/div/uci.zip" rel="noreferrer">http://download.shredderchess.com/div/uci.zip</a></p>
  
  <p>It's actually very straight forward and simple, a UCI engine must respond to and reply in plain text through stdin, stdout and stderr.  In fact, you should be able to launch the executable binary of any UCI engine on your platform and issue the UCI commands manually.</p>
  
  <p>UCI facilitates instructions from a GUI or other engine to tell the specific engine to do whatever it is that you want it to do, including analyse a specific PGN file (the loading of it is through the GUI or similar front-end, the raw moves are then fed to the engine in extended algebraic form, such as e4 becoming e2e4).  The second and third points of your requirements are standard with UCI, but it is up to each engine developer to support them (given how lean those requirements are, that should be most of them).</p>
  
  <p>Here's an example of UCI in action on the command line:</p>
  
  <pre><code>bash-3.2$ ./stockfish-5-64 
  Stockfish 5 64 by Tord Romstad, Marco Costalba and Joona Kiiski
  uci
  id name Stockfish 5 64
  id author Tord Romstad, Marco Costalba and Joona Kiiski
  
  option name Write Debug Log type check default false
  option name Write Search Log type check default false
  option name Search Log Filename type string default SearchLog.txt
  option name Book File type string default book.bin
  option name Best Book Move type check default false
  option name Contempt Factor type spin default 0 min -50 max 50
  option name Mobility (Midgame) type spin default 100 min 0 max 200
  option name Mobility (Endgame) type spin default 100 min 0 max 200
  option name Pawn Structure (Midgame) type spin default 100 min 0 max 200
  option name Pawn Structure (Endgame) type spin default 100 min 0 max 200
  option name Passed Pawns (Midgame) type spin default 100 min 0 max 200
  option name Passed Pawns (Endgame) type spin default 100 min 0 max 200
  option name Space type spin default 100 min 0 max 200
  option name Aggressiveness type spin default 100 min 0 max 200
  option name Cowardice type spin default 100 min 0 max 200
  option name Min Split Depth type spin default 0 min 0 max 12
  option name Threads type spin default 1 min 1 max 128
  option name Hash type spin default 32 min 1 max 16384
  option name Clear Hash type button
  option name Ponder type check default true
  option name OwnBook type check default false
  option name MultiPV type spin default 1 min 1 max 500
  option name Skill Level type spin default 20 min 0 max 20
  option name Emergency Move Horizon type spin default 40 min 0 max 50
  option name Emergency Base Time type spin default 60 min 0 max 30000
  option name Emergency Move Time type spin default 30 min 0 max 5000
  option name Minimum Thinking Time type spin default 20 min 0 max 5000
  option name Slow Mover type spin default 80 min 10 max 1000
  option name UCI_Chess960 type check default false
  uciok
  isready
  readyok
  quit
  bash-3.2$ 
  </code></pre>
  
  <p>The commands I issued were uci, isready and quit.</p>
  
  <p>To utilise the UCI commands you essentially have two main choices; you can use an existing interface (e.g. ChessX, Arena and a host of others) or you can write your own code to issue instructions to an engine or group of engines.  I believe there may already be Python wrappers for accessing UCI engines, but I'd need to double-check.  There's definitely python-chess (import chess) and pychess (import pychess), I just can't recall the extent of their functions.  I can't recall where pychess is lurking (probably github or google code), but python-chess can be installed with pip.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-23T14:02:09.397Z
Answers.Text: UCI doesn't seem to provide an API for setting the value of the pieces.
Answers.UserDisplayName: Snowcrash
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-23T14:18:32.240Z
Answers.Text: That sort of thing ought to be programmed into the engine itself and chess engines will use standard values. You'd only need to change it for some other game (e.g. faerie chess) and chances are you'll need to make a lot more changes than just the piece values then.
Answers.UserDisplayName: Ben
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-26T10:18:46.080Z
Answers.Text: I disagree. There aren't `standard` values.
Answers.UserDisplayName: Snowcrash
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-14T13:29:41.193Z
Answers.Text: Then you'd probably need to fork an engine code base to redesign it with variable values instead. Then set a separate configuration for the forked and recompiled engine to use the new values. Then continue to interact via UCI as normal. Alternatively look at the other engine language format that GNU Chess uses, I forget the details of it, though.
Answers.UserDisplayName: Ben
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-28T16:20:56.860Z
Answers.Text: @Snowcrash : all those option lines you see are specific to Stockfish, the engine used for this example. The UCI protocol does not deal with the content of the options and it is up to the engine to define and use them.
Answers.UserDisplayName: AlefSin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-25T04:50:03.173Z
Answers.LastActivityDate: 2014-07-25T04:50:03.173Z
Answers.UserDisplayName: Ben
Answers.Body: <p>python-chess provides a useful API and supports UCI, apparently:</p>
  
  <p><a href="http://python-chess.readthedocs.io/en/v0.15.3/uci.html?highlight=engine" rel="nofollow">http://python-chess.readthedocs.io/en/v0.15.3/uci.html?highlight=engine</a></p>
  
  <p>The above link gives a 'stockfish' example.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-16T07:25:34.970Z
Answers.Text: Python-chess + Stockfish executable is really easy to work with!
Answers.UserDisplayName: odinchess.com
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-26T14:03:51.097Z
Answers.LastActivityDate: 2016-10-26T14:03:51.097Z
Answers.UserDisplayName: Richard Prosser
Answers.Body: <p>I've googled on "chess engine api" but have not seen any real API's. As suggested in the comments of your question I would go with UCI. This is also the way GUI's communicate with chess engines.</p>
  
  <p>If you're really a hardcore programmer you could always check out the open source engine 
  Stockfish. It could very well be that there is some sort of API built in it, or you could make a clone and build your own API for it.</p>
  
  <p><a href="http://stockfishchess.org/" rel="nofollow">http://stockfishchess.org/</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-11-24T20:11:24.750Z
Answers.Text: The API for talking to Stockfish is also UCI.
Answers.UserDisplayName: dfan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-11-24T20:38:53.497Z
Answers.Text: Indeed it is. But using UCI or diving into the code will depend on how the engine is going to be used and not for what. The question was not clear on that.
Answers.UserDisplayName: Rafiek
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-11-24T21:06:02.380Z
Answers.Text: I think I mentioned what exactly I need to do with the engine. Load a particular PNG and evaluate after each move.
Answers.UserDisplayName: Salvador Dali
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-11-25T10:08:24.150Z
Answers.Text: It is perfectly clear what you want to do with the engine. How you will be using it is left in the open. In what setting will you be using the engine? It could be that UCI may not be the optimal way to communicate with the engine. I suggested another option if UCI is not sufficient for you.
Answers.UserDisplayName: Rafiek
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-11-25T20:28:40.230Z
Answers.Text: Sorry, but I can not understand what do you mean by how I am going to use the engine. Can you please clarify this?
Answers.UserDisplayName: Salvador Dali
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-11-26T12:00:29.987Z
Answers.Text: For instance, you could use it to build a GUI around it.I would use UCI in that case. But, you could also use it to do some research on search algorithms. In that case I would recommend to make "native" calls to the specific functions you would like to use.
Answers.UserDisplayName: Rafiek
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-11-24T14:52:33.887Z
Answers.LastActivityDate: 2013-11-24T14:52:33.887Z
Answers.UserDisplayName: Rafiek
Answers.Body: <p>I know of two APIs by which you can access Stockfish. The source code is available for both to implement yourself. In one case, the API is also hosted and can be queried freely.</p>
  <p>(This answer is essentially the same as <a href="https://chess.stackexchange.com/a/40470/17203">this answer</a> that I gave to <a href="https://chess.stackexchange.com/questions/9632/chess-engine-api/40470#40470">a similar, later question</a>.)</p>
  <h1>noobpwnftw/chessdb</h1>
  <p>I discovered this API through <a href="https://chess.stackexchange.com/a/24853/17203">Fabian Fichter’s answer</a> to <a href="https://chess.stackexchange.com/questions/13958/is-there-an-online-chess-evaluation-engine-with-a-rest-api">this similar, later question</a>.</p>
  <p>The front-end is a PHP script and uses in addition MongoDB. It requires a Redis-compatible server for data storage. See the <a href="https://github.com/noobpwnftw/chessdb" rel="nofollow noreferrer">source code on GitHub</a>.</p>
  <p>The API is actively hosted and can be freely queried. For example, here’s a position from the Fried Liver Attack, with the FEN: “r1bqkb1r/ppp2ppp/5n2/n2Pp1N1/2B5/8/PPPP1PPP/RNBQK2R w KQkq - 1 6”</p>
  <pre><code>r1bqkb1r/ppp2ppp/5n2/n2Pp1N1/2B5/8/PPPP1PPP/RNBQK2R w KQkq - 1 6
  </code></pre>
  <p>For example, to find just the best move, form the query like:</p>
  <pre><code>https://www.chessdb.cn/cdb.php?action=querybest&amp;board=FEN_STRING_WITH_BLANKS_ESCAPED
  </code></pre>
  <p>In this case:</p>
  <pre><code>https://www.chessdb.cn/cdb.php?action=querybest&amp;board=r1bqkb1r/ppp2ppp/5n2/n2Pp1N1/2B5/8/PPPP1PPP/RNBQK2R%20w%20KQkq%20-%201%206
  </code></pre>
  <p>which gives you <a href="https://www.chessdb.cn/cdb.php?action=querybest&amp;board=r1bqkb1r/ppp2ppp/5n2/n2Pp1N1/2B5/8/PPPP1PPP/RNBQK2R%20w%20KQkq%20-%201%206" rel="nofollow noreferrer">this result</a>:</p>
  <pre><code>move:c4b5
  </code></pre>
  <p>which translates to Bb5+, agreeing with theory.</p>
  <p>See the GitHub link for a little additional documentation, such as using <code>querypv</code> to get continuations.</p>
  <h2>Ilya Zhelyabuzhsky’s Python wrapper for Stockfish</h2>
  <p>See Ilya Zhelyabuzhsky’s Python wrapper (a) <a href="https://github.com/zhelyabuzhsky/stockfish" rel="nofollow noreferrer">on GitHub</a> and (b) available for installation <a href="https://pypi.org/project/stockfish/" rel="nofollow noreferrer">from PyPI</a>.</p>
  <p>This requires that Stockfish be installed on the server.</p>
  <p>This Python package implements a class to integrate Stockfish with Python.</p>
  <p>For example, you can define a position from a FEN and then request the best move:</p>
  <pre><code>stockfish.set_fen_position(&quot;rnbqkbnr/pppp1ppp/4p3/8/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2&quot;)
  stockfish.get_best_move()
  </code></pre>
  <p>See either of the above links for additional documentation.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-27T16:17:02.280Z
Answers.LastActivityDate: 2022-08-27T16:17:02.280Z
Answers.UserDisplayName: Jim Ratliff
Answers.Body: <p><a href="https://github.com/SamRagusa/Batch-First" rel="nofollow noreferrer">Batch First</a> is a JIT compiled chess engine written in Python, compiled using Numba, which would allow easy C++ interfacing and even easier Python interfacing.</p>
  
  <p>While Batch First itself is an engine not API, it heavily uses and relies upon the <a href="https://github.com/niklasf/python-chess" rel="nofollow noreferrer">Python-Chess</a> package, which is an awesome API.</p>
  
  <p>The JIT compilation of Batch First, and use of NumPy arrays for representing boards, allows a more practical Python interface (at least an order of magnitude faster) for actual use in a chess engine.</p>
  
  <p>The core of the engine is a zero-window k-best-first search algorithm used to evaluate ANNs in batches.</p>
  
  <p>Full disclosure, I am the author of the Batch First engine.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-06T15:32:19.643Z
Answers.LastActivityDate: 2018-07-07T02:18:54.190Z
Answers.LastEditDate: 2018-07-07T02:18:54.190Z
Answers.UserDisplayName: Sam Ragusa
Answers.Body: <p>Here there's a port version of Stockfish in .Net:
  <a href="https://github.com/bpfliegel/Portfish" rel="nofollow">https://github.com/bpfliegel/Portfish</a></p>
  
  <p>To use this engine (once it's compiled), you'll nedd a GUI like Arena <a href="http://wwww.playwitharena.com" rel="nofollow">http://wwww.playwitharena.com</a> or ScidVSPC <a href="http://scidvspc.sourceforge.net" rel="nofollow">http://scidvspc.sourceforge.net</a>. These applications are used to provide a nice interface and allow you to load games/positions, analyze them (I'm pretty sure you can load a game on pgn and analyze it by an engine with criteria like "n seconds per move" or "n plies per move"), run matches between engines, etc</p>
  
  <p>In (almost) every chess engine you should find something like a uci.cs or an xboard.cs file which is commited to this communication task.</p>
  
  <p>(A "chess engine" is a program that is capable of playing chess but has no graphical interface. The way it communicates to applications like Arena or ScidVSPC is by the UCI or xboard protocols. Most of the chess programs are written this way, so the developer can forget about the GUI stuff and focus on the "brain").</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-12-11T08:31:16.050Z
Answers.LastActivityDate: 2013-12-11T08:31:16.050Z
Answers.UserDisplayName: Emilio Díaz
Answers.Body: <p>I was looking around for something similar and came across Joe's Chess API:</p>
  <p><a href="http://chess-api.herokuapp.com/" rel="nofollow noreferrer">http://chess-api.herokuapp.com/</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-27T12:42:24.660Z
Answers.LastActivityDate: 2020-09-27T12:42:24.660Z
Answers.UserDisplayName: iCodeAndMakeVideos
Body: <p>I am looking for a chess engine which provides a normal API which I can use with some high level programming language like C# or python. I went through the list of leaders (Houdini, Komodo, Stockfish and Rybka) and was not able to find any signs that these engines provides API (which surprised me and suggested that I am missing something).</p>
  
  <p>To be less vague, here is what I need from this API:</p>
  
  <ul>
  <li>be able to load specific game into the engine</li>
  <li>be able to evaluate position of the game</li>
  <li>be able to make a move</li>
  </ul>
  
  <p>So, does anyone knows an engine which provides a clear API to it's functions?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-11-24T11:08:24.293Z
Comments.Text: UCI is a API which gets command via command line switches and standard input. You can write a wrapper around those commands and call commands by functions.
Comments.UserDisplayName: masoud
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-11-24T14:24:08.113Z
Comments.Text: Yes, UCI is exactly what you are looking for. All of those programs support UCI, which is how they are integrated into programs like ChessBase.
Comments.UserDisplayName: dfan
Tags: <engines><programming>
Title: Chess engine with API
ThreadText: # Chess engine with API
  
  (Asked by: username_0 on 2013-11-24)
  
  I am looking for a chess engine which provides a normal API which I can use with some high level programming language like C# or python. I went through the list of leaders (Houdini, Komodo, Stockfish and Rybka) and was not able to find any signs that these engines provides API (which surprised me and suggested that I am missing something).
  
  To be less vague, here is what I need from this API:
  
  * be able to load specific game into the engine
  * be able to evaluate position of the game
  * be able to make a move
  
  So, does anyone knows an engine which provides a clear API to it's functions?
  
  **Tags:** engines, programming
  
  > **Comments:**
  > **username_1**: UCI is a API which gets command via command line switches and standard input. You can write a wrapper around those commands and call commands by functions.  
  > **username_2**: Yes, UCI is exactly what you are looking for. All of those programs support UCI, which is how they are integrated into programs like ChessBase.  
  
  ---
  
  ## 7 answers
  
  ### Answer by username_3 on 2014-07-25. Score: 10
  
  As others have said, UCI is the API you want. The full specifications of the protocol is here (the zip file extracts to a text file): <http://download.shredderchess.com/div/uci.zip>
  
  It's actually very straight forward and simple, a UCI engine must respond to and reply in plain text through stdin, stdout and stderr. In fact, you should be able to launch the executable binary of any UCI engine on your platform and issue the UCI commands manually.
  
  UCI facilitates instructions from a GUI or other engine to tell the specific engine to do whatever it is that you want it to do, including analyse a specific PGN file (the loading of it is through the GUI or similar front-end, the raw moves are then fed to the engine in extended algebraic form, such as e4 becoming e2e4). The second and third points of your requirements are standard with UCI, but it is up to each engine developer to support them (given how lean those requirements are, that should be most of them).
  
  Here's an example of UCI in action on the command line:
  
  ```
  bash-3.2$ ./stockfish-5-64 
  Stockfish 5 64 by Tord Romstad, Marco Costalba and Joona Kiiski
  uci
  id name Stockfish 5 64
  id author Tord Romstad, Marco Costalba and Joona Kiiski
  
  option name Write Debug Log type check default false
  option name Write Search Log type check default false
  option name Search Log Filename type string default SearchLog.txt
  option name Book File type string default book.bin
  option name Best Book Move type check default false
  option name Contempt Factor type spin default 0 min -50 max 50
  option name Mobility (Midgame) type spin default 100 min 0 max 200
  option name Mobility (Endgame) type spin default 100 min 0 max 200
  option name Pawn Structure (Midgame) type spin default 100 min 0 max 200
  option name Pawn Structure (Endgame) type spin default 100 min 0 max 200
  option name Passed Pawns (Midgame) type spin default 100 min 0 max 200
  option name Passed Pawns (Endgame) type spin default 100 min 0 max 200
  option name Space type spin default 100 min 0 max 200
  option name Aggressiveness type spin default 100 min 0 max 200
  option name Cowardice type spin default 100 min 0 max 200
  option name Min Split Depth type spin default 0 min 0 max 12
  option name Threads type spin default 1 min 1 max 128
  option name Hash type spin default 32 min 1 max 16384
  option name Clear Hash type button
  option name Ponder type check default true
  option name OwnBook type check default false
  option name MultiPV type spin default 1 min 1 max 500
  option name Skill Level type spin default 20 min 0 max 20
  option name Emergency Move Horizon type spin default 40 min 0 max 50
  option name Emergency Base Time type spin default 60 min 0 max 30000
  option name Emergency Move Time type spin default 30 min 0 max 5000
  option name Minimum Thinking Time type spin default 20 min 0 max 5000
  option name Slow Mover type spin default 80 min 10 max 1000
  option name UCI_Chess960 type check default false
  uciok
  isready
  readyok
  quit
  bash-3.2$ 
  
  ```
  
  The commands I issued were uci, isready and quit.
  
  To utilise the UCI commands you essentially have two main choices; you can use an existing interface (e.g. ChessX, Arena and a host of others) or you can write your own code to issue instructions to an engine or group of engines. I believe there may already be Python wrappers for accessing UCI engines, but I'd need to double-check. There's definitely python-chess (import chess) and pychess (import pychess), I just can't recall the extent of their functions. I can't recall where pychess is lurking (probably github or google code), but python-chess can be installed with pip.
  
  > **Comments:**
  > **username_4**: UCI doesn't seem to provide an API for setting the value of the pieces.  
  > **username_3**: That sort of thing ought to be programmed into the engine itself and chess engines will use standard values. You'd only need to change it for some other game (e.g. faerie chess) and chances are you'll need to make a lot more changes than just the piece values then.  
  > **username_4**: I disagree. There aren't `standard` values.  
  > **username_3**: Then you'd probably need to fork an engine code base to redesign it with variable values instead. Then set a separate configuration for the forked and recompiled engine to use the new values. Then continue to interact via UCI as normal. Alternatively look at the other engine language format that GNU Chess uses, I forget the details of it, though.  
  > **username_5**: @username_4 : all those option lines you see are specific to Stockfish, the engine used for this example. The UCI protocol does not deal with the content of the options and it is up to the engine to define and use them.  
  
  ---
  
  ### Answer by username_6 on 2016-10-26. Score: 4
  
  python-chess provides a useful API and supports UCI, apparently:
  
  <http://python-chess.readthedocs.io/en/v0.15.3/uci.html?highlight=engine>
  
  The above link gives a 'stockfish' example.
  
  > **Comments:**
  > **username_7**: Python-chess + Stockfish executable is really easy to work with!  
  
  ---
  
  ### Answer by username_8 on 2013-11-24. Score: 3
  
  I've googled on "chess engine api" but have not seen any real API's. As suggested in the comments of your question I would go with UCI. This is also the way GUI's communicate with chess engines.
  
  If you're really a hardcore programmer you could always check out the open source engine
  Stockfish. It could very well be that there is some sort of API built in it, or you could make a clone and build your own API for it.
  
  <http://stockfishchess.org/>
  
  > **Comments:**
  > **username_2**: The API for talking to Stockfish is also UCI.  
  > **username_8**: Indeed it is. But using UCI or diving into the code will depend on how the engine is going to be used and not for what. The question was not clear on that.  
  > **username_0**: I think I mentioned what exactly I need to do with the engine. Load a particular PNG and evaluate after each move.  
  > **username_8**: It is perfectly clear what you want to do with the engine. How you will be using it is left in the open. In what setting will you be using the engine? It could be that UCI may not be the optimal way to communicate with the engine. I suggested another option if UCI is not sufficient for you.  
  > **username_0**: Sorry, but I can not understand what do you mean by how I am going to use the engine. Can you please clarify this?  
  > **username_8**: For instance, you could use it to build a GUI around it.I would use UCI in that case. But, you could also use it to do some research on search algorithms. In that case I would recommend to make "native" calls to the specific functions you would like to use.  
  
  ---
  
  ### Answer by username_9 on 2022-08-27. Score: 1
  
  I know of two APIs by which you can access Stockfish. The source code is available for both to implement yourself. In one case, the API is also hosted and can be queried freely.
  
  (This answer is essentially the same as [this answer](https://chess.stackexchange.com/a/40470/17203) that I gave to [a similar, later question](https://chess.stackexchange.com/questions/9632/chess-engine-api/40470#40470).)
  
  # noobpwnftw/chessdb
  
  I discovered this API through [Fabian Fichter’s answer](https://chess.stackexchange.com/a/24853/17203) to [this similar, later question](https://chess.stackexchange.com/questions/13958/is-there-an-online-chess-evaluation-engine-with-a-rest-api).
  
  The front-end is a PHP script and uses in addition MongoDB. It requires a Redis-compatible server for data storage. See the [source code on GitHub](https://github.com/noobpwnftw/chessdb).
  
  The API is actively hosted and can be freely queried. For example, here’s a position from the Fried Liver Attack, with the FEN: “r1bqkb1r/ppp2ppp/5n2/n2Pp1N1/2B5/8/PPPP1PPP/RNBQK2R w KQkq - 1 6”
  
  ```
  r1bqkb1r/ppp2ppp/5n2/n2Pp1N1/2B5/8/PPPP1PPP/RNBQK2R w KQkq - 1 6
  
  ```
  
  For example, to find just the best move, form the query like:
  
  ```
  https://www.chessdb.cn/cdb.php?action=querybest&board=FEN_STRING_WITH_BLANKS_ESCAPED
  
  ```
  
  In this case:
  
  ```
  https://www.chessdb.cn/cdb.php?action=querybest&board=r1bqkb1r/ppp2ppp/5n2/n2Pp1N1/2B5/8/PPPP1PPP/RNBQK2R%20w%20KQkq%20-%201%206
  
  ```
  
  which gives you [this result](https://www.chessdb.cn/cdb.php?action=querybest&board=r1bqkb1r/ppp2ppp/5n2/n2Pp1N1/2B5/8/PPPP1PPP/RNBQK2R%20w%20KQkq%20-%201%206):
  
  ```
  move:c4b5
  
  ```
  
  which translates to Bb5+, agreeing with theory.
  
  See the GitHub link for a little additional documentation, such as using `querypv` to get continuations.
  
  ## Ilya Zhelyabuzhsky’s Python wrapper for Stockfish
  
  See Ilya Zhelyabuzhsky’s Python wrapper (a) [on GitHub](https://github.com/zhelyabuzhsky/stockfish) and (b) available for installation [from PyPI](https://pypi.org/project/stockfish/).
  
  This requires that Stockfish be installed on the server.
  
  This Python package implements a class to integrate Stockfish with Python.
  
  For example, you can define a position from a FEN and then request the best move:
  
  ```
  stockfish.set_fen_position("rnbqkbnr/pppp1ppp/4p3/8/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2")
  stockfish.get_best_move()
  
  ```
  
  See either of the above links for additional documentation.
  
  
  ---
  
  ### Answer by username_10 on 2018-07-06. Score: 1
  
  [Batch First](https://github.com/username_10/Batch-First) is a JIT compiled chess engine written in Python, compiled using Numba, which would allow easy C++ interfacing and even easier Python interfacing.
  
  While Batch First itself is an engine not API, it heavily uses and relies upon the [Python-Chess](https://github.com/niklasf/python-chess) package, which is an awesome API.
  
  The JIT compilation of Batch First, and use of NumPy arrays for representing boards, allows a more practical Python interface (at least an order of magnitude faster) for actual use in a chess engine.
  
  The core of the engine is a zero-window k-best-first search algorithm used to evaluate ANNs in batches.
  
  Full disclosure, I am the author of the Batch First engine.
  
  
  ---
  
  ### Answer by username_11 on 2013-12-11. Score: 0
  
  Here there's a port version of Stockfish in .Net:
  <https://github.com/bpfliegel/Portfish>
  
  To use this engine (once it's compiled), you'll nedd a GUI like Arena <http://wwww.playwitharena.com> or ScidVSPC <http://scidvspc.sourceforge.net>. These applications are used to provide a nice interface and allow you to load games/positions, analyze them (I'm pretty sure you can load a game on pgn and analyze it by an engine with criteria like "n seconds per move" or "n plies per move"), run matches between engines, etc
  
  In (almost) every chess engine you should find something like a uci.cs or an xboard.cs file which is commited to this communication task.
  
  (A "chess engine" is a program that is capable of playing chess but has no graphical interface. The way it communicates to applications like Arena or ScidVSPC is by the UCI or xboard protocols. Most of the chess programs are written this way, so the developer can forget about the GUI stuff and focus on the "brain").
  
  
  ---
  
  ### Answer by username_12 on 2020-09-27. Score: 0
  
  I was looking around for something similar and came across Joe's Chess API:
  
  <http://chess-api.herokuapp.com/>
  
  
  ---
  
  