api
api copied to clipboard
API for Studies
I would like an API that,
- Allows creation of a New Study
- Has study settings, as params, in the request call.
- Allows for adding of new chapters (specifically the PGN upload)
- Allows for auto-enabling"analyze each chapter"
I've built a system that pulls all games for a particular player (OTB games) from tournament sites and consolidates them into a single PGN. I then want a way of creating a study, uploading the PGN, and auto run the engine against each game (chapter), returning a link to that study.
Thank you!
A full REST API for studies would be nice.
My desired use is
- download a random assortment of interactive lesson chapters from my private studies;
- create a new (or replace an existing) study; and
- add the chapters to the study.
I have the same requirement. I would like to have an API where I can upload multiple games, positions, studies, and puzzles to Lichess. And most importantly, a way to classify and organize all the uploads into one study, chapter-wise in a logical manner via API, instead of doing it manually, which is so tedious and time-consuming.
for example, the below code uploads a PGN to Lichess, but it only returns a single link to the upload.
# pgn_text = imported pgn file
headers = {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Bearer " + YOUR_API_KEY
}
body = {
"pgn": pgn_text
}
response = requests.post(LICHESS_API_URL, headers=headers, data=body)
If only there was a way to collect all these links and pass it through another API to get them organized into a Study, chapter-wise, or do a bulk upload of all the PGNs together and pass in a JSON that would structure the uploads and organize them into a study.
Hi all,
Have you had a solution to this issue?
Right now Lichess has an import PGN api into an existing study: https://lichess.org/api#tag/Studies/operation/apiStudyImportPGN
I would like to be able to create a new study at least. Is this possible?
Hi all, thanks for the work you have been doing. I agree with comments in this thread, it would be great to enrich this API also allowing to import FEN as a new chapter, modify the parameters of the chapter and allowing to change the metadata.
Thanks
long ago, I recall creating a detailed issue on the same, with some ideas on what the API could be like. I will link it here so that everyone can take a look. Issue: #224
If I get some time in the future, I will try to implement the same and raise a PR. In the meantime, if anyone is interested, feel free to go ahead and start... and I might join in.