lichess-org / api

Lichess API documentation and examples
https://lichess.org/api
GNU Affero General Public License v3.0
417 stars 140 forks source link

The rationale for omitting the last 3 moves for ongoing games in /game/export/{gameId} is not documented #244

Closed Pipeliner closed 1 year ago

Pipeliner commented 1 year ago

/game/export/{gameId} and similar endpoints omit 3 last moves of ongoing games for some reason. That is very unexpected and is left unexplained. I'd really like

  1. An explanation why are the moves omitted
  2. A suggestion on what to do instead if I need the latest game state.

I guess you want to avoid some bots making repeated requests to this endpoint? It might be less relevant for correspondence games which is what I'm trying to use this for.

kraktus commented 1 year ago

The rationale is documented on the streamGame endpoint: https://lichess.org/api#tag/Games/operation/streamGame

After move 5, the stream intentionally remains 3 moves behind the game status, as to prevent cheat bots from using this API.

We have been talking about switching this limitation from being move based to time based, will create an issue

kraktus commented 1 year ago
  1. https://github.com/lichess-org/api/commit/7690de2201578a0b92d4914f51ba1e42e1198d95
  2. https://github.com/lichess-org/lila/issues/12720