Skip to content

Lichess API Worker

Ben Olden-Cooligan edited this page Sep 5, 2016 · 5 revisions

The Lichess API Worker is a local service running on the server to allow both Chesster and the website to coordinate calls to the Lichess API and avoid exceeding rate limits.

Endpoint

http://localhost:8880/lichessapi/{path}?priority={n}&max_retries={n}&{args}

Adds an API call for the URL https://en.lichess.org/{path}?{args} to the execution queue. Higher priority calls are executed first. In case of failures (e.g. rate-limits) the retry count will be used.

A successful request returns HTTP 200 with a response body consisting of a string for a Redis key. The caller should poll Redis at redis://127.0.0.1:6379/1 for the provided key at an interval (e.g. 0.1s) until it is available (with some timeout, e.g. 2 minutes). A successful call to the Lichess API will set the value in Redis to the Lichess API call's response body. A failed call (that exceeded the retry count) will set it to an empty string.

Priority Values

These are just conventions. Any relative numeric values will do.

0 - Background updates 1 - Manual updates 10 - Responsiveness is critical

Clone this wiki locally