lichess.org
Donate

Lichess API, lag?

I hate to make a repeated thread. I asked the thing like a month or more ago and got no answers.

I am building my own bot using the lichess API and json event streams. Sometimes I encounter huge lag. Like +500ms round trip duration from sending a request and receiving a response. While at the same time the ping reported from the website itself is 40~80ms.

Could there be a reason the lichess API might be running slower than the lichess site itself?
Questions like this are generally better asked on Discord (discord.gg/lichess) in the #api-bots-boards channel. Games vs the Lichess AI have a forced 500ms delay. Not sure why.
@benwerner eh I really don't like using discord etc but thanks for your reply.
Can you elaborate on the Lichess AI 500ms delay? Is the lichess AI delaying its moves by a fixed 500ms amount or are the events in those games pushed with a delay?

I think I found a bug in my lichess API implementation. Not sure it is the cause of the lag but I will investigate regardless.
Move requests when playing against the Lichess API have artificial 500ms delays before they are processed. Which seems like what you are observing.
I am sorry for asking for an advice in this topic. I created school Club for children team. Any possibilities to send not only messeges to all menbers via lichess.org, but also to their parent e-mails. I am not familar with programing APis etc. I hope there is someone who can help. Thank you in advance.
@benwerner said in #4:
> Move requests when playing against the Lichess API have artificial 500ms delays before they are processed. Which seems like what you are observing.

Okay that is exactly what I was experiencing and just tested it in a game where I played it myself instead and the lag was reflective to what I am observing on the web. I will keep monitoring it.

But this 500ms delay is only for lichess AI, like two bots playing each other should not experience such a delay?
The 500ms delay is only when the bot API plays with the lichess AI.

It's here to prevent bot users from flooding the lichess AI with move requests. Like all limitations, it has been introduced after abuse happened.

This topic has been archived and can no longer be replied to.