Downloading pgn files from lichess

Discuss anything you like about chess related matters in this forum.
Post Reply
Roger de Coverly
Posts: 22672
Joined: Tue Apr 15, 2008 2:51 pm

Downloading pgn files from lichess

Post by Roger de Coverly » Tue Jul 08, 2025 9:52 am

Coverage of the recent Crewe congress is at
https://lichess.org/broadcast/8th-crewe ... 1/MqwFmHLr

Could someone remind me of the method of capturing these games as a pgn file?

User avatar
Joey Stewart
Posts: 2173
Joined: Wed Apr 11, 2007 2:35 pm
Location: All Of Them
Contact:

Re: Downloading pgn files from lichess

Post by Joey Stewart » Tue Jul 08, 2025 10:01 am

There's a symbol that looks like three dots connected by lines to form a C shape you can click to share the game as a pgn. E.g.

[Event "Round 1: De Coverly, Roger D - Duxbury, Craig"]
[Round "1.2"]
[White "De Coverly, Roger D"]
[Black "Duxbury, Craig"]
[Result "1-0"]
[WhiteElo "1937"]
[WhiteFideId "405213"]
[BlackElo "2261"]
[BlackTitle "CM"]
[BlackFideId "3202089"]
[TimeControl "110+10"]
[Variant "Standard"]
[ECO "B01"]
[Opening "Scandinavian Defense: Icelandic-Palme Gambit"]
[StudyName "Round 1"]
[ChapterName "De Coverly, Roger D - Duxbury, Craig"]
[UTCDate "2025.06.27"]
[UTCTime "17:49:24"]

1. e4 { [%eval 0.18] [%clk 1:50:16] } 1... d5 { [%eval 0.54] [%clk 1:43:50] } 2. exd5 { [%eval 0.51] [%clk 1:50:08] } 2... Nf6 { [%eval 0.53] [%clk 1:43:46] } 3. c4 { [%eval 0.14] [%clk 1:50:03] } 3... e6 { [%eval 0.41] [%clk 1:42:35] } 4. Nf3 { [%eval -0.02] [%clk 1:49:47] } 4... exd5 { [%eval 0.0] [%clk 1:42:24] } 5. d4 { [%eval -0.08] [%clk 1:49:33] } 5... Be7 { [%eval 0.1] [%clk 1:33:00] } 6. Bd3 { [%eval 0.0] [%clk 1:49:28] } 6... O-O { [%eval 0.07] [%clk 1:19:41] } 7. O-O { [%eval 0.0] [%clk 1:49:14] } 7... Bg4 { [%eval 0.16] [%clk 1:12:39] } 8. Nc3 { [%eval -0.11] [%clk 1:48:41] } 8... Nc6 { [%eval 0.09] [%clk 0:36:26] } 9. cxd5 { [%eval 0.06] [%clk 1:47:36] } 9... Nxd4 { [%eval 0.05] [%clk 0:26:41] } 10. Bxh7+ { [%eval 0.0] [%clk 1:47:14] } 10... Nxh7 { [%eval 0.03] [%clk 0:26:40] } 11. Qxd4 { [%eval 0.12] [%clk 1:47:10] } 11... Bxf3 { [%eval 0.11] [%clk 0:26:43] } 12. gxf3 { [%eval 0.11] [%clk 1:47:06] } 12... Qd7 { [%eval 0.39] [%clk 0:25:24] } 13. Qg4 { [%eval 0.18] [%clk 1:45:18] } 13... f5 { [%eval 0.16] [%clk 0:18:11] } 14. Qc4 { [%eval 0.13] [%clk 1:41:55] } 14... Bd6 { [%eval 0.09] [%clk 0:09:40] } 15. Bf4 { [%eval 0.09] [%clk 1:37:28] } 15... b5 { [%eval 0.11] [%clk 0:05:47] } 16. Qd4 { [%eval 0.23] [%clk 1:36:46] } 16... b4?! { [%eval 0.9] } { Inaccuracy. Qe8 was best. } { [%clk 0:02:41] } (16... Qe8 17. Bxd6 cxd6 18. f4 a6 19. Rae1 Qh5 20. f3 Rf6 21. Kh1 Rh6 22. Qd2) 17. Bxd6?! { [%eval 0.0] } { Inaccuracy. Ne2 was best. } { [%clk 1:36:15] } (17. Ne2) 17... Qxd6 { [%eval 0.15] [%clk 0:01:46] } 18. Nb5 { [%eval 0.15] [%clk 1:32:33] } 18... Qg6+? { [%eval 1.48] } { Mistake. Ng5 was best. } { [%clk 0:01:38] } (18... Ng5) 19. Kh1 { [%eval 1.46] [%clk 1:31:43] } 19... Qh5 { [%eval 1.45] [%clk 0:00:59] } 20. Qf4 { [%eval 1.63] [%clk 1:28:34] } 20... g5? { [%eval 3.19] } { Mistake. Ng5 was best. } { [%clk 0:00:16] } (20... Ng5 21. Nxc7) 21. Qg3?! { [%eval 2.36] } { Inaccuracy. Rg1 was best. } { [%clk 1:26:51] } (21. Rg1 Rad8 22. Nxc7 Kh8 23. Qe5+ Rf6 24. Rg2 Qxf3 25. Re1 Kg8 26. Kg1 b3) 21... Qf7?! { [%eval 3.52] } { Inaccuracy. f4 was best. } { [%clk 0:00:15] } (21... f4 22. Qg2 Rad8 23. Nxc7 Rf5 24. Rfe1 Nf6 25. Rad1 Rd6 26. Re7 Qh4 27. Re6) 22. Rac1 { [%eval 3.44] [%clk 1:23:52] } 22... Qxd5?! { [%eval 4.63] } { Inaccuracy. Rac8 was best. } { [%clk 0:00:14] } (22... Rac8 23. d6 c6 24. Nc7 Qxa2 25. Rfe1 Qxb2 26. d7 Rcd8 27. Ne6 Rxd7 28. Nxf8) 23. Nxc7 { [%eval 4.6] [%clk 1:23:51] } 23... Qb7 { [%eval 4.66] [%clk 0:00:11] } 24. Nxa8 { [%eval 4.67] [%clk 1:23:37] } 24... Qxa8 { [%eval 4.61] [%clk 0:00:20] } 25. h4 { [%eval 4.57] [%clk 1:21:20] } 25... Kh8 { [%eval 5.29] [%clk 0:00:10] } 1-0
Any opinions expressed will not be held to account.

Jon D'Souza-Eva
Posts: 922
Joined: Mon Apr 24, 2023 7:53 am

Re: Downloading pgn files from lichess

Post by Jon D'Souza-Eva » Tue Jul 08, 2025 10:31 am

To remove the timestamps you can use this:
https://web.archive.org/web/20171012044 ... mover.html

Roger de Coverly
Posts: 22672
Joined: Tue Apr 15, 2008 2:51 pm

Re: Downloading pgn files from lichess

Post by Roger de Coverly » Tue Jul 08, 2025 11:41 am

Joey Stewart wrote: ↑
Tue Jul 08, 2025 10:01 am
There's a symbol that looks like three dots connected by lines to form a C shape you can click to share the game as a pgn. E.g.
That's just one game, I am looking to download the entire tournament. Incidently the three dots is applicable to phones and tablets; I am using a PC.

Did anyone notice that my opponent was down to his last 5 minutes by move 16? Time limit was 1 hr 50 for the game with 10 second increments. He took round 5 minutes at move 1.

User avatar
John Saunders
Posts: 2171
Joined: Thu Apr 19, 2007 3:10 pm
Location: Kingston-upon-Thames
Contact:

Re: Downloading pgn files from lichess

Post by John Saunders » Tue Jul 08, 2025 12:10 pm

Roger de Coverly wrote: ↑
Tue Jul 08, 2025 9:52 am
Coverage of the recent Crewe congress is at
https://lichess.org/broadcast/8th-crewe ... 1/MqwFmHLr

Could someone remind me of the method of capturing these games as a pgn file?
1. go to the link you gave above
2. click on any game
3. under the game window you should see four symbols - click on the one on the right ('Share & Export')
4. It should now show various options - you probably want 'Download all rounds'
Personal Twitter @johnchess
Britbase https://www.britbase.info
(I prefer email to PM - contact me via this link - https://www.saund.org.uk/email.html)

User avatar
Carl Hibbard
Posts: 6135
Joined: Fri Dec 08, 2006 8:05 pm
Location: Evesham

Re: Downloading pgn files from lichess

Post by Carl Hibbard » Tue Jul 08, 2025 1:49 pm

Cheers
Carl Hibbard

User avatar
John Saunders
Posts: 2171
Joined: Thu Apr 19, 2007 3:10 pm
Location: Kingston-upon-Thames
Contact:

Re: Downloading pgn files from lichess

Post by John Saunders » Thu Jul 10, 2025 9:43 am

I've uploaded a BritBase page with all the games from the 2025 Crewe Open...

https://www.saund.org.uk/britbase/pgn/2 ... iewer.html
Personal Twitter @johnchess
Britbase https://www.britbase.info
(I prefer email to PM - contact me via this link - https://www.saund.org.uk/email.html)

Reg Clucas
Posts: 663
Joined: Mon May 16, 2011 3:45 pm

Re: Downloading pgn files from lichess

Post by Reg Clucas » Sat Jul 12, 2025 7:42 pm

Jon D'Souza-Eva wrote: ↑
Tue Jul 08, 2025 10:31 am
To remove the timestamps you can use this:
https://web.archive.org/web/20171012044 ... mover.html
Is there anything that will remove the timestamps without removing the other comments?

Jon D'Souza-Eva
Posts: 922
Joined: Mon Apr 24, 2023 7:53 am

Re: Downloading pgn files from lichess

Post by Jon D'Souza-Eva » Sat Jul 12, 2025 7:56 pm

Reg Clucas wrote: ↑
Sat Jul 12, 2025 7:42 pm
Jon D'Souza-Eva wrote: ↑
Tue Jul 08, 2025 10:31 am
To remove the timestamps you can use this:
https://web.archive.org/web/20171012044 ... mover.html
Is there anything that will remove the timestamps without removing the other comments?
If you're OK running Python from a command prompt window then I could write something to do that for you.

Reg Clucas
Posts: 663
Joined: Mon May 16, 2011 3:45 pm

Re: Downloading pgn files from lichess

Post by Reg Clucas » Sat Jul 12, 2025 8:05 pm

Jon D'Souza-Eva wrote: ↑
Sat Jul 12, 2025 7:56 pm
Reg Clucas wrote: ↑
Sat Jul 12, 2025 7:42 pm
Jon D'Souza-Eva wrote: ↑
Tue Jul 08, 2025 10:31 am
To remove the timestamps you can use this:
https://web.archive.org/web/20171012044 ... mover.html
Is there anything that will remove the timestamps without removing the other comments?
If you're OK running Python from a command prompt window then I could write something to do that for you.
I'm sure I could write something myself, just don't want to re-invent the wheel!

Jon D'Souza-Eva
Posts: 922
Joined: Mon Apr 24, 2023 7:53 am

Re: Downloading pgn files from lichess

Post by Jon D'Souza-Eva » Sat Jul 12, 2025 8:19 pm

I managed to achieve it by using Notepad++ with three search and replace operations using regular expressions:

1) Remove the timestamp and evaluation parts of the comments:
replace:
\[\%[a-z,0-9,-. ,:]*\]
with nothing

2) Remove empty comments (i.e. those consisting entirely of spaces):
replace:
\{ *\}
with nothing

3) Remove move continuations after now removed comments (e.g. change "1. e4 1... d5" to simply "1. e4 d5")
replace:
[0-9]+\.\.\.
with nothing
(there is a space at the start and end of that regular expression)

User avatar
John Saunders
Posts: 2171
Joined: Thu Apr 19, 2007 3:10 pm
Location: Kingston-upon-Thames
Contact:

Re: Downloading pgn files from lichess

Post by John Saunders » Sun Jul 13, 2025 10:01 am

Thanks for that, Jon. I gave it a try and it works well.

When taking scores from Lichess, I usually do all the necessary amendments in ChessBase but of course not everyone uses it and there are some excellent free alternatives such as SCID or SCID vs PC which have good editing facilities. In ChessBase I usually prefer to strip out all the commentary from the entire database in one go as I find the automatic annotations given by Lichess at game-end somewhat irksome. ChessBase allows you to retain the last item of text commentary in each game, which is useful for retaining the fact of time loss when it happens but I can't think of a way of doing that via a PGN file edit. That's a challenge for you, Jon!

This is slightly off-topic but, coincidentally, I tried Notepad++ to amend a PGN file for the first time today myself. This was to remove the full stop character which ChessBase puts after player initials when using the (otherwise very handy) OUTPUT/SELECTION TO TEXT FILE option. It happens when you have a player name in the format Atkins, HE in your database - you select the game (or games) and use the foregoing options on the drop-down menu to create a PGN file, but when you examine the PGN file output, you find ChessBase has plonked a full stop after the initials, thus Atkins, HE. - which is slightly annoying. For which reason I devised a global edit for Notepad++ or TextPad which removes these unwanted additions from a PGN file...

Find ^\[(White|Black)( \"[a-z, ]*)\.(\"\])
Replace with [$1$2$3

n.b. there are a couple of necessary single spaces in the 'Find' field, so best to copy and paste

I've written up this procedure in more detail on my blog.

These days I routinely run a macro with the above text edit on PGN files before uploading files to BritBase.
Personal Twitter @johnchess
Britbase https://www.britbase.info
(I prefer email to PM - contact me via this link - https://www.saund.org.uk/email.html)

Post Reply