Simple Stockfish API wrapper. Allows users to access powerful chess engine functionality, retrieve moves and evaluations from FEN and complete use of all Stockfish methods from native c++ code. Provides a convenient way to access Stockfish from anywhere. The API Wrapper is used in my Mobile Application Development Course final, Chess.
Clone the project and Stockfish 15.1
git clone https://github.com/vigneshsaravanakumar404/Stockfish_API_Wrapper.git
git clone https://github.com/official-stockfish/Stockfish.git
Install dependencies
pip install
pip stockfish
pip Flask
pip pyuac
Change stockfish path from
STOCKFISH_PATH = "C:/Users/vigne/PycharmProjects/Stockfish_API_Wrapper/Stockfish/src/stockfish.exe"
to your stockfish path in app.py
Run the program and start Ngrok tunnel
python app.py
ngrok http 5000
GET /api/bestmove/
Parameter | Type | Description |
---|---|---|
elo |
int |
Required Elo Stockfish will play at |
contempt |
int |
Aggression of Stockfish |
min-split-depth |
int |
Minimum depth Stockfish will search to |
ponder |
boolean |
Allow the engine to think during opponent's turn |
threads |
int |
Number of threads Stockfish will use |
multipv |
int |
Number of best moves to return |
fen |
string |
Required FEN of board position |
minimum-thinking-time |
int |
Minimum thinking time |
uci-chess960 |
boolean |
Set Chess960 |
uci-limit-strength |
boolean |
Limit max Stockfish level |
GET /api/bestmove/
Parameter | Type | Description |
---|---|---|
skill-level |
int |
Required Elo Stockfish will play at |
contempt |
int |
Aggression of Stockfish |
min-split-depth |
int |
Minimum depth Stockfish will search to |
ponder |
boolean |
Allow the engine to think during opponent's turn |
threads |
int |
Number of threads Stockfish will use |
multipv |
int |
Number of best moves to return |
fen |
string |
Required FEN of board position |
minimum-thinking-time |
int |
Minimum thinking time |
uci-chess960 |
boolean |
Set Chess960 |
uci-limit-strength |
boolean |
Limit max Stockfish level |
GET /is-fen-valid/
Parameter | Type | Description |
---|---|---|
fen |
string |
Required FEN of board position |
GET /is-move-correct/
Parameter | Type | Description |
---|---|---|
fen |
string |
Required FEN of board position |
move |
string |
Required Move to check |
GET /get-evaluation/
Parameter | Type | Description |
---|---|---|
fen |
string |
Required FEN of board position |
GET /get-top-moves/
Parameter | Type | Description |
---|---|---|
fen |
string |
Required FEN of board position |
number |
int |
Required Number of moves |