I am working on a statistical chess project that needs to evaluate many (about 20-30) different positions per turn. They do not need to be deep but fast.

Is there a possibility to use engines (stockfish is preferred because I am familiar with its evaluation system) that receives a fen as an input and gives me a fast evaluation of the position (probably with a given deepness, e.g 10) as output.

It should run in a web browser. So I assume the official Stockfish is not suitable, because it is written in C++.

I found this and this, but there is no hint how to use them, so I would appreciate for some hints if I should use them. Does somebody has experience with this implementations? Could you advise me something else?

  • What about running on Python?
    – SmallChess
    Commented Jun 21, 2018 at 15:38
  • 1
    @SmallChess I am working on a web plugin. Is it possible to use python from plugins? I am experienced in Python and Java, but a newbie in web projects. Commented Jun 21, 2018 at 16:00

1 Answer 1


Stockfish JS is a Javascript port of the Stockfish engine. It should be useful for your project. You might want to learn the UCI protocol.


Use Stockfish JS. Consider:

  • Send MultiPV for a position. You will get an evaluation for the moves.


  • For n legal moves, play them one by one. Ask Stockfish for an evaluation on each of those possibilities.

The second approach is slower but more accurate. If you just want shallow search, try the first one.

If you could multithread, do it. If you could run positions independently, do it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.