8

I'd like to be able to automate downloading specific games that have been played on Lichess. Is there any software available that, if given useful information such as the Lichess usernames, colours, time control and (approximate) time of the game will download the game in pgn format? Command line please - ideally it will also flag an error if it fails to find exactly one match.

I'm running Linux, but as I expect anything that might exist will be in something like python I don't think that is a big issue.

12

Lichess has an API which can also be used to download games. For example:

https://lichess.org/api/games/user/{username}?max=3&color=white

This will download 3 most recent games played by {username} with the white pieces.

You can find the docs for this operation (and others) here:

https://lichess.org/api#operation/apiGamesUser

The introduction page lists some clients including one for Python:

https://lichess.org/api#section/Introduction

2
  • Thanks - I'm aware of this but as python is not my thing (I do compiled languages, mainly Fortran and C, on big supercomputers) I was hoping somebody skilled in it had done this already – Ian Bush Oct 30 '20 at 15:31
  • 2
    You can use any language to download a PGN via the web API. I only mentioned Python, because you mentioned it yourself in your question. Even using wget in a bash script should be possible. – Sleafar Oct 30 '20 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.