lichess-org / lila

♞ lichess.org: the forever free, adless and open source chess server ♞
https://lichess.org
GNU Affero General Public License v3.0
15.1k stars 2.24k forks source link

API arena tournament info - Page number limited to 200 #11368

Open tmmlaarhoven opened 2 years ago

tmmlaarhoven commented 2 years ago

As described on https://lichess.org/api#operation/tournament one can get detailed score sheets of participants in an arena via the endpoint https://lichess.org/tournament/{id}?page={p}, with page p returning the p-th group of 10 players. Currently the page option is limited to a number below 200, which is insufficient for big tournaments with more than 2000 players (e.g. some of the marathons, which had up to 31000 participants, a factor 15-16 above this limit).

Can this upper bound on the page be removed/increased, to be able to fetch score sheets of players finishing above the 2000th position?

(Using e.g. ?page=201 or ?page=202 still returns the 200th page, so this limit is actually enforced and seemingly cannot be circumvented.)

kraktus commented 2 years ago

I'm not sure why this limit is in place since I'd guess it's not more expensive to fetch results with page number superior to 200

ornicar commented 2 years ago

It is, because of the way database cursors work

tmmlaarhoven commented 2 years ago

So is there any option to make it possible to fetch more detailed scores of players finishing below the 2000th place in an arena?

The /results page only gives final scores, but not individual game results, berserks etc. The database contains the games, but does not say how many arena points were scored, or which games were berserked.

Also there are games where A beats B in an arena, and after A gets banned for cheating during the arena, the result changes to a win for B, which would not be visible via the database or any other API endpoint. The score sheets are the only place to see this, but they cannot be obtained via the API.

(An alternative would be scraping the arena score sheets via the website directly, but if that's the unofficial recommendation, then why not make it possible via the API.)