api icon indicating copy to clipboard operation
api copied to clipboard

API for Studies

Open jynfairchild opened this issue 3 years ago • 5 comments

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!

jynfairchild avatar Dec 13 '21 00:12 jynfairchild

A full REST API for studies would be nice.

My desired use is

  1. download a random assortment of interactive lesson chapters from my private studies;
  2. create a new (or replace an existing) study; and
  3. add the chapters to the study.

stevecheckoway avatar Dec 15 '22 23:12 stevecheckoway

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.

mratanusarkar avatar Jan 24 '23 16:01 mratanusarkar

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?

sertaco avatar Oct 15 '23 08:10 sertaco

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

jlkhermes38 avatar Dec 17 '23 13:12 jlkhermes38

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.

mratanusarkar avatar Dec 19 '23 09:12 mratanusarkar