#Expanding Board API to support Study/Analysis/Puzzle modes

17 messages · Page 1 of 1 (latest)

unreal panther
#

Hey devs, I've been looking into the Lichess Board API for a hardware project.

Currently, the API seems heavily centered around the /api/board/game/ flow. I’m wondering if there are plans to expand this to support Study, Analysis, and Puzzles. Specifically, the ability to:

Receive the current FEN/position from a Study/Puzzle.

Push a move from a physical board to the active Study/Analysis board.

This would allow e-board users to use Lichess's amazing training tools without needing to constantly look at or touch their screens. If these endpoints don't exist yet, I'd like to officially request them or offer to help test any beta implementations. Cheers!

Chessnut Team
Daniel

hidden gorge
unreal panther
#

Thanks for the clarification, thibault!

To be more specific about our implementation: we aren't building a standalone client from scratch. Instead, our app embeds the Lichess website via a WebView to give users the full, native Lichess experience (UI, community features, etc.).

Our goal is to create a "bridge" between the physical Chessnut e-board and the active Lichess web session inside that WebView. Specifically:

For Puzzles: We want the physical move to be "pushed" to the active puzzle the user is currently looking at in the WebView.

For Study/Analysis: This is the bigger challenge. Since the Study API is mostly read-only, we are looking for a way to "inject" or push a move to the live Study/Analysis board so the web UI updates in real-time without the user having to touch their screen.

If the current APIs are designed for backend-to-backend data sync, would you consider (or is there already) a way to interact with a live web socket/session to trigger board moves on the frontend?

hidden gorge
#

That's quite a peculiar use-case, never seen that before

#

would you be able to interact with the webview javascript?

#

like, if I exposed a function like window.puzzle.move('e2e4') to the puzzle page, would you able to call that

#

we already expose window.lichess in all pages so you could check if you can access that

unreal panther
#

Thanks for the suggestion. Yes, interacting with the WebView's JavaScript is feasible via evaluateJavascript on both Android and iOS.
For our integration, the two primary functions we would need are:
makeMove(uci): To push a move from the physical board to the active session.
getFen(): To sync the initial position when a user starts a Puzzle or switches Study chapters.
Having these exposed (e.g., under window.lichess) would be very helpful for keeping the hardware in sync with the web UI. I will look into the existing window.lichess object in the meantime.

hidden gorge
#

ok then, I'll look into adding these! But never on live games ofc where it could be used for cheating

#

Puzzles and studies are not competitive so it's ok

#

Let me know when you have confirmed by test that you can access window.lichess from your webview

unreal panther
#

Thanks for the update. We have confirmed that we can successfully access and interact with the window.lichess object from the WebViews on both iOS and Android.
We are ready to test the integration whenever the new functions are available.

hidden gorge
#
window.lichess.chessground()
window.lichess.puzzle.playUci('d1d3')
unreal panther
#

Thanks for the quick update. We have tested the new methods in Puzzle mode, and they work as expected from our WebView.
Could you also expose similar functionality for Study and Analysis modes? Having access to the board state and a way to push moves in those modes would complete the integration for our users.

hidden gorge
#

done