Giter Site home page Giter Site logo

api's People

Contributors

allanjoseph98 avatar andyklimczak avatar benediktwerner avatar canut avatar ddugovic avatar dependabot[bot] avatar devjiwonchoi avatar fitztrev avatar icp1994 avatar ion232 avatar jalpp avatar kraktus avatar lakinwecker avatar lelons avatar m-dinhhoangviet avatar markzh avatar mcognetta avatar mukundan314 avatar niklasf avatar nnickoloff1234 avatar ornicar avatar pamplemousse avatar richienb avatar schlawg avatar seanysean avatar sergioglorias avatar sujatrobhadra avatar tbonnin avatar tors42 avatar trevorbayless avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api's Issues

Translation insufficient for tournament threshold

I current have a rating if 1497, I tried to enter a <1500 Rapid tournament, which I could not.
image
This looked strange to me first, but when I enabled the "participate" button in HTML and clicked on it, it showed the following alert:
image

Your best highest rating this week Rapid (1504) is too high

Thus I would like to change the translation of:
image
to something like:

Rated ≥ %1$s in %2$s this week
Rated ≤ %1$s in %2$s this week

Plaintext API results

I'm a mod for a lichess streamer who uses Streamlabs' Cloudbot on Twitch, and would like to add a command that could automatically fetch the score of the current match. Unfortunately, the bot cannot parse JSON, and so cannot access any of the data within the crosstable API endpoint. Would it be possible to add some endpoints that return specific values in plaintext? Something like "https://lichess.org/api/crosstable/{user1}/{user2}/matchup/{user1}" to return the score of the first user in the current match as a plain string, and similarly with the other values. That would be greatly appreciated!

JSON exports of games from api doesn't have players' real names using the players parameter

From the game api when trying to export a game as json with pgnInJson parameter, neither the user fields nor the included pgn has the players' real names when using the players parameter. Exporting as pgn works as intended though. Tried with #operation/gamePgn, #operation/apiUserCurrentGame, and #operation/apiGamesUser. In all cases the pgn exports work as intended.

Example requests:

  • curl -H "Accept:application/json" -sS "https://lichess.org/game/export/fg59gH3A?pgnInJson=true&players=https://gist.githubusercontent.com/ornicar/6bfa91eb61a2dcae7bcd14cce1b2a4eb/raw/768b9f6cc8a8471d2555e47ba40fb0095e5fba37/gistfile1.txt"
  • curl -H "Accept:application/json" -sS "https://lichess.org/api/user/stl_caruana/current-game?pgnInJson=true&players=https://gist.githubusercontent.com/ornicar /6bfa91eb61a2dcae7bcd14cce1b2a4eb/raw/768b9f6cc8a8471d2555e47ba40fb0095e5fba37/gistfile1.txt"
  • curl -H "Accept:application/x-ndjson" -sS "https://lichess.org/api/games/user/stl_caruana?max=1&pgnInJson=true&players=https://gist.githubusercontent.com/ornicar/6bfa91eb61a2dcae7bcd14cce1b2a4eb/raw/768b9f6cc8a8471d2555e47ba40fb0095e5fba37/gistfile1.txt"

Create multiple challenges

Part of learning chess, a group of young chess students receives a challenge based on a position in lichess to solve themselves and play interactively against 1 trainer. This is kind of a simultane but different because a particular position is used (fen based) and after new insights are gathered and students understand the position a different position will be challenged to the same group. Sometimes this position is slightly different than the position used before, for example in a training we look at the case when the pawn on A6 is on A7 and then try to learn from that position plus we discuss what a difference it makes and let the students play the position themselves again against the trainer in lichess.
The api call to https://lichess.org/api/challenge/{username} (which is send from an app we created) is perfectly capabel for this purpose and works fine initially but after this api call is used several times for 1 token the lichess api responds with a 404 error.

Addidional info:

  • @ornicar asked to create a use case after a discord chat we had about this issue.
  • Our chess club has more than 100 members and we are planning to integrate lichess into our online training program. The api call to create challenges will be used a lot in this case.

Message not sent when calling api/bulk-pairing

As far as I understood it, a message should've been send when the api returns 200.

I successfully setup a pairing, but none of the players received a message. Did I understood something wrong?
Or does the creator don't receive messages?
My other test accounts were restricted to kids mode, so they won't receive a message. How are those supposed to play/join? Wouldn't a notification be better?

Another question regarding the documentation to messages. It says:
{opponent} and {game} are placeholders that will be replaced with the opponent and the game URLs.
Are there any other placeholders like {player}?

API endpoint is not working correct.

If I call curl https://lichess.org/account/playing -H "Authorization: Bearer <myToken>", I got a 404 HTML page.

If I call an other endpoint like curl https://lichess.org/tv/channels -H "Authorization: Bearer <myToken>", it is working correct.

I granted game access for my token.

board api error in running "yarn start" by following READMD.md

In config.ts, it is the port of 8080, while in README.md is 8087?

And "yarn start" only can be executed under back/ subdir, and with the following error:

/home/james/myRepos/wjw/lila_api/example/board-api/back/src/router.ts:25
const auth = await env.mongo.auth.get(req.session?.authId || '');
^

SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Module.m._compile (/home/james/myRepos/wjw/lila_api/example/board-api/back/node_modules/ts-node/src/index.ts:1043:23)
at Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Object.require.extensions. [as .ts] (/home/james/myRepos/wjw/lila_api/example/board-api/back/node_modules/ts-node/src/index.ts:1046:12)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/home/james/myRepos/wjw/lila_api/example/board-api/back/src/index.ts:6:1)
[nodemon] app crashed - waiting for file changes before starting...

Thank

Need "Login With Different Account" on OAuth page

Just suggestion. On https://oauth.lichess.org/oauth/authorize (oAuth page), can we have button that says "Login With Different Account"? We do oAuth on Tournament registration, and some parents have multiple kids to register, so after a parent register one child (oAuth completed), then register another child, on that page they lost (need to logout and try register again and so on ...)

regards

Chacha

Batch Analysis

I've discovered that only analysed games are shown on insights, but there is no way to analyze all my past games automatically. If the site uses my computer's process power, is hard to implement this feature?

Game created by API, only one player get notification

I am able to generate token with oAuth2. I have for player 1, and I have for player 2. I am also able to create game for both players. What I did was requesting game from Player 1 to Player 2. Put token Player 1 in Bearer, then put Token Player 2 in acceptByToken. It worked. The slight problem is that Player1 got notification (join the game), but player 2 did not get notification. Player 2 is still able to play a new other game, while player 1 can't do that without canceling the request.

Make the API specs useful for API client generation with OpenAPI Generator

As it stands right now, the Lichess API specs can not be used to generate an API with OpenAPI Generator. The API specs seem to be malformed in various ways:

  • Responses seem to require a description
  • security: None doesn't work correctly and can be replaced with security: [] and components.securitySchemes.None removed as per OpenAPI documentation
  • A specification for the path parameter userName of /games/export/{username} is missing

Furthermore, even when fixing these issues, all response objects properties (save BotGameState) aren't actually described in the API, those response objects merely hold an example JSON response.

There might be more issues yet unexplored, I'm not very proficient in OpenAPI.

If this issue were fixed, it would make using the API much easier.


OpenAPI Generator output when trying to generate a Java API for Lichess:

  PS B:\Marvin\Desktop\openapi-generator> java -jar .\modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/lichess-org/api/master/doc/specs/lichess-api.yaml -g java -o lichess-java
  Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
   | Error count: 49, Warning count: 1
  Errors:
          -attribute paths.'/api/games/user/{username}'(get).responses.200.description is missing
          -attribute paths.'/api/bot/account/upgrade'(post).responses.400.description is missing
          -attribute paths.'/api/stream/event'(get).responses.200.description is missing
          -attribute paths.'/api/challenge/{username}'(post).responses.200.description is missing
          -attribute paths.'/api/account/kid'(post).responses.200.description is missing
          -attribute paths.'/api/users/status'(get).responses.200.description is missing
          -attribute paths.'/api/account'(get).responses.200.description is missing
          -attribute paths.'/api/user/{username}/rating-history'(get).responses.200.description is missing
          -attribute components.securitySchemes.None.type.type is not of type `http|apiKey|oauth2|openIdConnect `
          -attribute paths.'/api/bot/account/upgrade'(post).responses.200.description is missing
          -attribute paths.'/api/challenge/{challengeId}/accept'(post).responses.200.description is missing
          -attribute paths.'/api/user/{username}/followers'(get).responses.200.description is missing
          -attribute paths.'/team/{teamId}/users'(get).responses.200.description is missing
          -attribute paths.'/api/tournament'(post).responses.200.description is missing
          -attribute paths.'/tv/channels'(get).responses.200.description is missing
          -attribute paths.'/api/bot/game/{gameId}/move/{move}'(post).responses.200.description is missing
          -attribute paths.'/api/bot/game/{gameId}/resign'(post).responses.400.description is missing
          -attribute paths.'/api/bot/game/{gameId}/move/{move}'(post).responses.400.description is missing
          -attribute paths.'/api/bot/game/{gameId}/resign'(post).responses.200.description is missing
          -attribute paths.'/api/tournament'(post).responses.400.description is missing
          -attribute paths.'/api/challenge/{challengeId}/decline'(post).responses.404.description is missing
          -attribute paths.'/api/account/playing'(get).responses.200.description is missing
          -attribute paths.'/games/export/{username}'. Declared path parameter username needs to be defined as a path parameter in path or operation level
          -attribute paths.'/api/user/{username}'(get).responses.200.description is missing
          -attribute paths.'/api/bot/game/stream/{gameId}'(get).responses.200.description is missing
          -attribute paths.'/api/account/email'(get).responses.200.description is missing
          -attribute paths.'/api/challenge/{challengeId}/decline'(post).responses.200.description is missing
          -attribute paths.'/streamer/live'(get).responses.200.description is missing
          -attribute paths.'/api/account/kid'(get).responses.200.description is missing
          -attribute paths.'/api/tournament/{id}/results'(get).responses.200.description is missing
          -attribute paths.'/api/bot/game/{gameId}/abort'(post).responses.400.description is missing
          -attribute paths.'/game/export/{gameId}'(get).responses.200.description is missing
          -attribute paths.'/api/stream/games-by-users'(post).responses.200.description is missing
          -attribute paths.'/api/bot/game/{gameId}/chat'(post).responses.200.description is missing
          -attribute paths.'/api/account/preferences'(get).responses.200.description is missing
          -attribute paths.'/games/export/_ids'(post).responses.200.description is missing
          -attribute paths.'/player/top/{nb}/{perfType}'(get).responses.200.description is missing
          -attribute paths.'/api/users'(post).responses.200.description is missing
          -attribute paths.'/api/bot/game/{gameId}/chat'(post).responses.400.description is missing
          -attribute paths.'/player'(get).responses.200.description is missing
          -attribute paths.'/games/export/{username}'(get).responses is missing
          -attribute paths.'/api/user/{username}/following'(get).responses.200.description is missing
          -attribute paths.'/api/challenge/{challengeId}/accept'(post).responses.404.description is missing
          -attribute paths.'/api/tournament/{id}/games'(get).responses.200.description is missing
          -attribute paths.'/api/bot/game/{gameId}/abort'(post).responses.200.description is missing
          -attribute paths.'/api/users/titled'(get).responses.200.description is missing
          -attribute paths.'/api/tournament'(get).responses.200.description is missing
          -attribute paths.'/api/challenge/{username}'(post).responses.400.description is missing
          -attribute paths.'/api/user/{username}/activity'(get).responses.200.description is missing
  Warnings:
          -attribute paths.'/api/games/user/{username}'(get).responses.200.description is missing
          -attribute paths.'/api/bot/account/upgrade'(post).responses.400.description is missing
          -attribute paths.'/api/stream/event'(get).responses.200.description is missing
          -attribute paths.'/api/challenge/{username}'(post).responses.200.description is missing
          -attribute paths.'/api/account/kid'(post).responses.200.description is missing
          -attribute paths.'/api/users/status'(get).responses.200.description is missing
          -attribute paths.'/api/account'(get).responses.200.description is missing
          -attribute paths.'/api/user/{username}/rating-history'(get).responses.200.description is missing
          -attribute components.securitySchemes.None.type.type is not of type `http|apiKey|oauth2|openIdConnect `
          -attribute paths.'/api/bot/account/upgrade'(post).responses.200.description is missing
          -attribute paths.'/api/challenge/{challengeId}/accept'(post).responses.200.description is missing
          -attribute paths.'/api/user/{username}/followers'(get).responses.200.description is missing
          -attribute paths.'/team/{teamId}/users'(get).responses.200.description is missing
          -attribute paths.'/api/tournament'(post).responses.200.description is missing
          -attribute paths.'/tv/channels'(get).responses.200.description is missing
          -attribute paths.'/api/bot/game/{gameId}/move/{move}'(post).responses.200.description is missing
          -attribute paths.'/api/bot/game/{gameId}/resign'(post).responses.400.description is missing
          -attribute paths.'/api/bot/game/{gameId}/move/{move}'(post).responses.400.description is missing
          -attribute paths.'/api/bot/game/{gameId}/resign'(post).responses.200.description is missing
          -attribute paths.'/api/tournament'(post).responses.400.description is missing
          -attribute paths.'/api/challenge/{challengeId}/decline'(post).responses.404.description is missing
          -attribute paths.'/api/account/playing'(get).responses.200.description is missing
          -attribute paths.'/games/export/{username}'. Declared path parameter username needs to be defined as a path parameter in path or operation level
          -attribute paths.'/api/user/{username}'(get).responses.200.description is missing
          -attribute paths.'/api/bot/game/stream/{gameId}'(get).responses.200.description is missing
          -attribute paths.'/api/account/email'(get).responses.200.description is missing
          -attribute paths.'/api/challenge/{challengeId}/decline'(post).responses.200.description is missing
          -attribute paths.'/streamer/live'(get).responses.200.description is missing
          -attribute paths.'/api/account/kid'(get).responses.200.description is missing
          -attribute paths.'/api/tournament/{id}/results'(get).responses.200.description is missing
          -attribute paths.'/api/bot/game/{gameId}/abort'(post).responses.400.description is missing
          -attribute paths.'/game/export/{gameId}'(get).responses.200.description is missing
          -attribute paths.'/api/stream/games-by-users'(post).responses.200.description is missing
          -attribute paths.'/api/bot/game/{gameId}/chat'(post).responses.200.description is missing
          -attribute paths.'/api/account/preferences'(get).responses.200.description is missing
          -attribute paths.'/games/export/_ids'(post).responses.200.description is missing
          -attribute paths.'/player/top/{nb}/{perfType}'(get).responses.200.description is missing
          -attribute paths.'/api/users'(post).responses.200.description is missing
          -attribute paths.'/api/bot/game/{gameId}/chat'(post).responses.400.description is missing
          -attribute paths.'/player'(get).responses.200.description is missing
          -attribute paths.'/games/export/{username}'(get).responses is missing
          -attribute paths.'/api/user/{username}/following'(get).responses.200.description is missing
          -attribute paths.'/api/challenge/{challengeId}/accept'(post).responses.404.description is missing
          -attribute paths.'/api/tournament/{id}/games'(get).responses.200.description is missing
          -attribute paths.'/api/bot/game/{gameId}/abort'(post).responses.200.description is missing
          -attribute paths.'/api/users/titled'(get).responses.200.description is missing
          -attribute paths.'/api/tournament'(get).responses.200.description is missing
          -attribute paths.'/api/challenge/{username}'(post).responses.400.description is missing
          -attribute paths.'/api/user/{username}/activity'(get).responses.200.description is missing

          at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:566)
          at org.openapitools.codegen.cmd.Generate.run(Generate.java:353)
          at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:61)

Swiss api results - score field

What does the score field in the current swiss api results endpoint mean, and/or how can it be mapped to the number of actual points? Can this be a bug?

Example

Tournament:
https://lichess.org/swiss/fe4Fzg8R

API endpoint:
https://lichess.org/api/swiss/fe4Fzg8R/results

ndjson:

{"rank":0,"score":60227444,"tieBreak":22.5,"rating":2304,"username":"bulletbaz","performance":2444}
{"rank":1,"score":60172286,"tieBreak":17,"rating":2092,"username":"destran","performance":2286}
{"rank":2,"score":50157170,"tieBreak":15.5,"rating":2226,"username":"Shuyebahmed123","performance":2170}
...

getting other people's information

I am creating an api. What I am trying to do is have someone put in their lichess username and then when they press submit I can call your API and get their information such as: bullet, blitz, classical, etc rating just to make it easier so they don't have to go to yoursite, login(if they need to) etc. I see that with the token it is linked to the person that created it (me for example) and then when making a curl to the link I get an HTML response and would rather not have to scrape it. Did I miss the docs that says where I could get the information?

Doc

Nothing is happening when I write

cd doc

What should I do?

Puzzles endpoint?

Are there plans for an endpoint to get puzzles and puzzle-related perfs? Something similar to what's displayed in the puzzle dashboards or the per-category perfs/to-replay puzzles.

Just please

Alright I know it's not an issue related with the api directly.
But next time you plan to completely remove an endpoint, at least give us some notice to change our codes. Email us or something.

API function to terminate an arena tournament

It is possible to create arena tournaments with the API but not possible to terminate a created one. Especially for tools automatically creating tournaments errors may happen and a terminate method would be helpful.

/api/challenge/{username} position parameter

The position parameter does not work.
Reproduce http request:

POST /api/challenge/{username} HTTP/1.1
Host: lichess.org
Authorization: Bearer
Content-Type: application/x-www-form-urlencoded

rated=false&variant=standard&position=rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 1 1&color=white&clock.limit=300&clock.increment=2

The position value will be encoded when request is made. Also tested with already encoded position value.

CORS headers missing on /games/export

I was trying to get my last game in browser:

https://tailuge.github.io/chess-o-tron/public/openings/test.html

It fails: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://tailuge.github.io' is therefore not allowed access.

It works using curl but the browser needs the CORS headers to proceed.

The curl is as follows:

curl 'https://lichess.org/games/export/tailuge?max=1&evals=true&moves=true&opening=true' -H 'Origin: https://preview.c9users.io' -H 'Accept: application/x-ndjson' --verbose

GET /games/export/tailuge?max=1&evals=true&moves=true&opening=true HTTP/1.1
User-Agent: curl/7.35.0
Host: lichess.org
Origin: https://preview.c9users.io
Accept: application/x-ndjson

< HTTP/1.1 200 OK

  • Server nginx is not blacklisted
    < Server: nginx
    < Date: Sun, 20 May 2018 08:38:55 GMT
    < Content-Type: application/x-ndjson
    < Transfer-Encoding: chunked
    < Connection: keep-alive
    < Content-Disposition: attachment; filename=lichess_tailuge_2018-05-20.json
    < Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
    <
    {"id":"iY4z1NqU","rated":false,"variant":"standard","speed":"blitz","perf":"blitz","createdAt":1526800649959,"lastMoveAt":1526801269714,"status":"outoftime","players":{"white":{"user":{"id":"tailuge","name":"tailuge"},"rating":1611},"black":{"user":{"id":"chessrest","name":"Chessrest"},"rating":1674}},"winner":"white","opening":{"eco":"B07","name":"Rat Defense: Harmonist","ply":3},"moves":"e4 d6 f4 f5 exf5 Bxf5 Nf3 Nf6 Bc4 d5 Bb3 c5 d4 c4 Ba4+ Bd7 Bxd7+ Nbxd7 Ne5 Nxe5 fxe5 Ne4 O-O Qb6 c3 O-O-O Nd2 Qc6 Nxe4 dxe4 Qg4+ e6 Be3 h5 Qe2 Rd7 Bg5 Be7 Qd2 h4 h3 Rh5 Bxe7 Rxe7 Rf4 g5 Rf8+ Kc7 Raf1 Rg7 R1f7+ Rxf7 Rxf7+ Kb6 Rg7 Qa4 a3 Qb3 Rg6 Ka6 Rxe6+ b6 Rc6 Qa2 Qe2 Qb1+ Kh2 Qd3 Qg4 Rh8 Qxg5 Qg3+ Qxg3 hxg3+ Kxg3 Kb5 Rf6 Rg8+ Kf2 Ka4 Rf4 Kb3 Rxe4 Kxb2 Re3 Kxa3 g4 b5 Ke2 b4 cxb4+ Kxb4 Kd2 c3+ Rxc3 Ka4 Rc4+","clock":{"initial":300,"increment":0,"totalTime":300}}

Puzzle storm endpoint?

Very similar to #82 , haha. Any chance we can get an endpoint to detect what puzzles were included (by ID?), whether a player passed/failed, what their puzzle storm scores were for the day, etc?

Board API gameState response has no winner field the first time it is received

Board API: When a game finishes in mate, the responses received from server are as follows:

  1. "type":"gameState"..."wdraw":false,"bdraw":false,"status":"mate"} (note no winner field)
  2. {"type":"gameFinish",...
  3. "type":"gameState"... ,"status":"mate","winner":"black"} (this time there is both status and winner fields!)

Ideally, in the first case itself, the winner field should have been received, since most Clients/GUIs will probably stop the game since "status" is already mate.. but unfortunately there is no winner field

Is filtering working on /games/export ?

I would expect the following to fetch my last two analysed games but it also returns unanalysed ones.

curl 'https://lichess.org/games/export/tailuge?analysed=1&evals=1&max=2'

Also the old interface https://en.lichess.org/api/user/"+player+"/games?nb=100&with_analysis=1&page=1
included the judgement information (i.e. blunder,mistake,inaccuracy). Are there any plans to support json responses for games like this in the new API? Should I stop using the old API?

Cant make it work

Hi.
Sorry the ignorance... i cant make it work.
Im trying to install this: https://github.com/lichess-org/api/tree/master/example/board-api

By the way building the front-end i get this error.

rc/main.ts → ../back/public/dist/app.dev.js...
(!) Plugin typescript: @rollup/plugin-typescript TS1110: Type expected.

6 export declare type SquareName = `${FileName}${RankName}`;
                                   ~~~

created ../back/public/dist/app.dev.js in 3s
Done in 3.44s.

there is a lot of this "`" on the code... i dont know much about coding... but it look like maybe that is the problem??? (i dont find that sentence to try to change it)...
(just asking, as i say... i dont know much about coding)

Thanks.

Potential issue with the open challenge api endpoint

Hi, I am experiencing something a bit strange with the open challenge endpoint in that there seems to be an issue with the limit field, the only value which seems to work is 0. For example this curl works fine:

curl -X POST -d "clock.limit=0&clock.increment=10" https://lichess.org/api/challenge/open

but this doesn't:

curl -X POST -d "clock.limit=1&clock.increment=10" https://lichess.org/api/challenge/open

In fact any non-zero limit value seems to cause an error. Am I misunderstanding something or this a bug?

Two-sided challenges

I'm sure this has been a past feature request, but I would like to re-iterate it. We have fairly successfully used Lichess for high school team chess in Illinois U.S.A. in the past year. However, there are certain aspects of it that are a bit complicated and one would hope could be improved with a new API method.

First, note that the current bulk pairings would be rather clumsy---collecting authcodes from literally thousands of players, in advance, just isn't feasible. The bulk pairings might work if it were possible to harvest authcodes so the process could be better automated (if some method were associated with the authcode that allowed userid=xxxx to query for it).

As it stands, the way it works is that each team sets its roster for a round. When the round is paired, a list of who played white and who black on each board is made available. Conventionally, the player with Black uses that to generate a challenge, and, if it appears to be correct, White accepts. Since the players (and not the TD) actually make the challenge, it's then necessary to harvest the game ID's to keep track of the results. It works, but it's very clumsy. Sometimes, Black gets the parameters wrong. Sometimes Black is slow to get the challenge out and the game starts five minutes late. Sometimes, White sends the challenge with the wrong colors.

If making authcode harvesting simpler isn't possible, what about something like an open ended challenge, but with specific players ID's for white and black. Both players have to accept to create a game, but the TD is able to make sure it's the correct players, with the correct colors and is able to get the game ID right away.

Font Options

I will like many font options like times new roman, Arial and other as I love the times new roman font in lichess.org so can there be an option of font change?

Get Studies of User API

Hi,

It would be wonderful if we had a /study/{user}/{optional-auth} endpoint to get a list of all studies-id of a specific user (including private studies if auth is implemented (maybe not necessary as you can also embed private studies, so they are not really private if you know the ID).

Use-case is to easily generate embedded studies on for example a club site, instead of copying all the links manually;
A little bit of a example on what I mean can be seen on https://franklambregts.com/deepdives

Don't know if this is the good way to request this. Thanks anyway!

Board api stream not returning gameState response when user resigns the game

Continuation of discord...
When the other user resigns, there is no gameState response. Only gameFinish is received. Whereas the API documentation shows a final gameState with status and winner fields (which is what we need)
this: https://lichess.org/api#operation/boardGameStream
Looks like the final gameState response is indeed received for 'checkmate' scenarios. But no final gameState with winner/status is received when the lichess user resigns (on the web)

Need API for update/delete created games

Being tournament organizer, sometime we need to correct board/game we have created. We are able to create board/game for 2 players base on their OAuth. Please add an update/delete method to correct those board if needed (limited to the boards that we created only):

  • delete/cancel the board. even if players are playing in it.
  • update time control on the board

regards

Chacha

problem with Redirect callback in OAuth app example

I try https://github.com/lichess-org/api/tree/master/example/oauth-authorization-code
When the user is not previously connected, the redirection in the callback fails, just after the login, it sends to 404. It seems that it redirects to

https://lichess.org/https://oauth.lichess.org/oauth/authorize ? response_type = code ....

the correct redirection would be to:

https://oauth.lichess.org/oauth/authorize?response_type=code .... .

If user is previously connected fine work.
I do not know how I can solve this problem. Thank you for the attention and for your great work for the community

Needs a 'help' link for dummies, right after each heading

... which links to a short explanation how to use the API. For example:

All Lichess API request urls have the format:

https://lichess.org<path parameters><query parameters>

For example (without the newlines and without any other whitespaces in between):

https://lichess.org
/api/games/user/{username}
?max=1

The first part is always necessary.

The second part are the path parameters, always seen top right in the black area, side to side with the current chapter heading. Curly brackets ({ and }) indicate variables, aka locations where you insert concrete text (without the curly brackets). For example in the above example your real Lichess username, for example /api/games/user/DrNykterstein .

The third part (optional) are the query parameters. They start with the character ?. Each query parameter consists of a key, then the character = and then a value. For example max=1 in the above example. More than one query parameters are joined together using the character &. For example ?max=1&analyzed=true.

Here is an example Python 3 script for Windows, which downloads your most recent game (using the third party requests module), saves it to a file lastgame.pgn , and then opens that file with the software which on your operating system is responsible for opening PGN files.

# open_last_game.pyw

import requests
from pathlib import Path
from subprocess import Popen

username = 'Here_goes_your_username'
saveto = Path('C:/Lichess/lastgame.pgn')
saveto.resolve().touch()

game = requests.get('https://lichess.org/api/games/user/' + username + '?max=1')
saveto.write_bytes(game.content)

Popen(
    [str(saveto)],
    shell=True
)

API LTI compliance or improved result handshaking?

Hi,

I'm the Chair of the Chess Institute of Canada. Because of the pandemic, we've had to rapidly swap all our in-class teaching in elementary schools to online. So we've obviously looking at LiChess, but we've also have been looking at full blown Learning Management Systems [LMS] like Moodle and Sakai.

Most of these packages have Learning Tools Interoperability [LTI] so lower level learning tools [like LiChess] can handshake results back. I think LTI is a complex model, since they take great steps via encryption to avoid hacking and cheating on results. [All the folks that take the online Java course always get 100% oddly...]

The current LiChess API is pretty good, but we'd be looking for results like did the student complete the LiChess activity, and how long they took to do so. Some of the functionality is already in the API, it's pretty close. Rather than a fullblown LTI implementation, I'd just be happy with some more handshaking. [I ain't worried about cheating frankly!]

i wish I knew more Java to help. My knowledge is beyond ancient, mainframes, UNIX, assembler, C.

LiChess is fabulous. Do think hooking it to LMS is the way to go. I need something we can scale to 800 schools or more. When you are teaching 50,000 kindergarten to grade 4 kids asynchronously, you need a lot of automation!

with thanks to the community,

Michael Sutton
Chair CIC

Trying to stream board using serverless architecture but CORS

Hi, I'm using Lambda functions to perform OAuth2 authentication and everything works fine until I want to stream the board by calling the /api/board/game/stream/{gameId} endpoint. Since I receive a NDJSON ReadableStream response which leaves the connection open I can't make this work from a serverless function since it times out after some time and closes the connection.

So my solution to keep this architecture was to break a bit the security and allow the browser to request the access token (which is stored in a HTTP only, same site cookie) and have the browser open this connection client-side. Problem is that I receive a cors type fetch response and I'm unable to receive any data at all.

Captura de Pantalla 2020-07-03 a la(s) 13 37 31

I know that by avoiding the whole serverless idea and deploying a full API on Heroku as opposed to Lambda functions would definitely make this work, but is there a way to have this working under the serverless paradigm?

Node.js error at running index.js : app.get('/callback', async (req, res) => {

Hello, I have configured my lichess account to have an oauth app and a personal API token.
When I was following the instructions of the oauth_app example, the following happened when I ran "node index.js"

app.get('/callback', async (req, res) => {
                           ^

SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.runMain (module.js:611:10)
    at run (bootstrap_node.js:387:7)
    at startup (bootstrap_node.js:153:9)

I have no idea of how to handle this error, and I'm new to nodejs. A better documentation or a quick help would be needed.

API Documentation page down.

https://lichess.org/api

Page states that something went wrong and gives a stack trace.

Device: Macbook pro 2015
Browser: Safari
OS: Macos Catelina v10.15 beta.

Let me know if you need any more information.

Stack trace for reference

[native code]
https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:93:102375
e@https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:101:69021
e@https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:121:27035
https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:101:74658
https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:101:75609
Fa@https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:77:69337
wl@https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:77:89200
vl@https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:77:89125
sl@https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:77:86067
sl@[native code]
https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:77:45376
https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:85:3708
Yo@https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:77:45322
Vo@https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:77:45257
nl@https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:77:82787
enqueueSetState@https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:77:49954
https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:69:1722
https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:101:75234
https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:22:2549
a@https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:22:1422
promiseReactionJob@[native code]

Swiss tournaments results

Make Swiss tournaments results (score + tie-breaks for each player) available, to be able to easily process results without having to parse the .trf file and re-calculate the Sonneborn–Berger tie-break score

Scope descriptions

Hi, in the authorize page, board:play and puzzle:read don't have descriptions.

Screenshot_20200429_011133

And this is the list of all scopes I found:

preference:read
preference:write
email:read
challenge:read
challenge:write
tournament:write
board:play
bot:play
team:write
puzzle:read
msg:write
study:write
study:read

for updating the scopes in https://lichess.org/api#section/Authentication

Are the descriptions "translatables"? :P

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.