user34052: There's a feature on chess.com for highlighting brilliant moves. I have 30,000 games back to 2015 in one account before that statistics feature came online, and I'd love to hunt for any brilliant moves in the stack.
Is there a way to programmatically do that?
I checked the chess.com api, and getting game analysis details isn't one of the things provided.


user30545: According to chess.com support

Brilliant (!!) moves and Great Moves are always the best or nearly
best move in the position, but are also special in some way. We
replaced the old Brilliant algorithm with a simpler definition: a
Brilliant move is when you find a good piece sacrifice. There are some
other conditions, like you should not be in a bad position after a
Brilliant move and you should not be completely winning even if you
had not found the move. Also, we are more generous in defining a piece
sacrifice for newer players, compared with those who are higher rated.

That can be programmed based on that description. I will try it if I have the time.
Edit:
Started working on it, but not done yet, it needs more tests. Sample detection tests from tatasteel games. The mat sac from Ding-Maghsoodloo, Giri-Gukesh and Carlsen-Abdusattorov were detected.
[Event "85th Tata Steel Masters"]
[Site "Wijk aan Zee NED"]
[Date "2023.01.15"]
[Round "2"]
[White "Ding Liren"]
[Black "Maghsoodloo,Parham"]
[Result "1/2-1/2"]
[Annotator "Brilliant Finder v0.1.0"]
[BlackElo "2719"]
[ECO "C78"]
[EventDate "2023.01.13"]
[WhiteElo "2811"]

1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.O-O b5 6.Bb3 Bc5 7.a4 Rb8 8.c3 d6 9.d4 Bb6 10.a5 Ba7 11.h3 O-O 12.Be3 Ra8 13.Nbd2 Bb7 14.Re1 Re8 15.Ng5 Re7 16.Ndf3 h6 17.Nxf7 $3 { sacrifices material worth 1 pawn unit and has not regained the material in the next 2 plies. } 17...Rxf7 18.dxe5 Bxe3 19.exf6 Ba7 20.fxg7 Qf6 21.Qd5 Kxg7 22.Qxf7+ Qxf7 23.Bxf7 Kxf7 24.e5 Nxe5 25.Nxe5+ dxe5 26.Rxe5 Rg8 27.g4 Rd8 28.Rae1 Rd7 29.Kh2 c5 30.Rf5+ Kg7 31.Kg3 Bb8+ 32.Kh4 Bc7 33.Re6 Bd5 34.Rxa6 b4 35.Kh5 Bf7+ 36.Rxf7+ Kxf7 37.Kxh6 bxc3 38.bxc3 Be5 39.Rc6 Bxc3 40.Rxc5 Bd2+ 41.g5 Rd4 42.Kh5 Ra4 43.Rc7+ Kf8 44.Rd7 Bc3 45.Kg6 Rxa5 46.h4 Ra6+ 47.Kh7 Ra4 48.h5 Rf4 49.Rd3 Rf7+ 50.Kg6 Rg7+ 51.Kh6 Rc7 52.f4 Rc6+ 53.Kh7 Rc7+ 54.Kg6 Rc6+ 55.Kh7 Rc7+ 56.Kh6 Rc6+ 57.g6 Bf6 58.Ra3 Rc8 59.Ra6 Bc3 60.Ra7 Kg8 61.Kg5 Rc5+ 62.Kg4 Rc6 63.Rd7 Bb2 64.Rd8+ Kg7 65.Rd7+ Kg8 66.Kg5 Rc5+ 67.Kh6 Bf6 68.Rf7 Rc6 69.Ra7 Rd6 70.Ra8+ Rd8 71.Ra7 Rd6 72.Rb7 Rd8 73.f5 Rd6 74.Ra7 Rd8 75.Ra6 Rf8 76.Rc6 Bd8 77.Re6 Bf6 78.Rc6 Bd8 79.Re6 Bf6 1/2-1/2




[Event "85th Tata Steel Masters"]
[Site "Wijk aan Zee NED"]
[Date "2023.01.15"]
[Round "2"]
[White "Giri,A"]
[Black "Gukesh,D"]
[Result "1-0"]
[Annotator "Brilliant Finder v0.1.0"]
[BlackElo "2725"]
[ECO "D38"]
[EventDate "2023.01.13"]
[WhiteElo "2764"]

1.d4 Nf6 2.c4 e6 3.Nf3 d5 4.Nc3 Bb4 5.Bg5 h6 6.Bxf6 Qxf6 7.e3 O-O 8.Rc1 dxc4 9.Bxc4 c5 10.O-O cxd4 11.Ne4 Qe7 12.a3 Ba5 13.exd4 Rd8 14.Rc2 Bd7 15.Re2 Bc6 16.Qc2 Bb6 17.Rfe1 Kh8 18.Neg5 $3 { sacrifices material worth 2 pawn units and has not regained the material in the next 2 plies. } 18...hxg5 19.Rxe6 $3 { sacrifices material worth 6 pawn units and has not regained the material in the next 2 plies. } 19...fxe6 20.Rxe6 Qxe6 21.Bxe6 Bxf3 22.Qf5 Be4 23.Qxe4 Rxd4 24.Qf3 g4 25.Qf8+ Kh7 26.Bf5+ Kh6 27.Bc2 1-0



[Event "85th Tata Steel Masters"]
[Site "Wijk aan Zee NED"]
[Date "2023.01.19"]
[Round "5"]
[White "Carlsen,M"]
[Black "Abdusattorov,Nodirbek"]
[Result "0-1"]
[Annotator "Brilliant Finder v0.1.0"]
[BlackElo "2713"]
[ECO "A35"]
[EventDate "2023.01.13"]
[WhiteElo "2859"]

1.c4 c5 2.Nf3 Nf6 3.Nc3 Nc6 4.e3 e5 5.Be2 d5 6.cxd5 Nxd5 7.O-O Be7 8.Bb5 Nxc3 9.bxc3 Qc7 10.d4 cxd4 11.cxd4 exd4 12.Nxd4 Bd7 13.Nf3 Bf6 14.Ba3 $3 { sacrifices material worth 2 pawn units and has not regained the material in the next 2 plies. } 14...Bxa1 15.Qxa1 O-O-O 16.Rc1 Kb8 17.Qxg7 Rhg8 18.Qb2 Bg4 19.Ne1 Rd1 20.Rxd1 Bxd1 21.Bf1 Ne5 22.h3 Bf3 23.Qd4 Rd8 24.Qh4 Bd5 25.Qxh7 Bc4 26.Bb2 Bxf1 27.Kxf1 Qc4+ 28.Kg1 Nc6 29.Nf3 Qxa2 30.Bf6 Rd1+ 31.Kh2 a5 32.Nd4 Qd5 33.Qc2 Qd6+ 34.f4 Rxd4 35.Bxd4 Nxd4 36.exd4 Qxf4+ 37.g3 Qxd4 38.h4 a4 39.Qa2 f5 40.h5 Qh8 41.Qxa4 Qxh5+ 42.Kg1 Qf3 43.Kh2 Qe2+ 44.Kg1 Qe5 45.Kf2 b5 46.Qb4 Kb7 47.g4 fxg4 48.Qxg4 Kb6 49.Qg8 b4 50.Kf3 Kb5 51.Kg2 Qe2+ 52.Kg3 Qe3+ 53.Kg2 b3 54.Qb8+ Kc4 55.Qg8+ Kc3 56.Qc8+ Kd2 57.Qh8 Kc2 58.Qc8+ Kd1 59.Qh8 Qd2+ 60.Kg3 b2 0-1





34052: <p>There's a feature on chess.com for highlighting brilliant moves. I have 30,000 games back to 2015 in one account before that statistics feature came online, and I'd love to hunt for any brilliant moves in the stack.</p>
<p>Is there a way to programmatically do that?</p>
<p>I checked the chess.com api, and getting game analysis details isn't one of the things provided.</p>
<p><a href="https://i.stack.imgur.com/A6YZN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A6YZN.png" alt="enter image description here" /></a></p>
 30545: <p>According to <a href="https://support.chess.com/article/2965-how-are-moves-classified-what-is-a-blunder-or-brilliant-and-etc#:%7E:text=We%20replaced%20the%20old%20Brilliant,had%20not%20found%20the%20move." rel="nofollow noreferrer">chess.com support</a></p>
<blockquote>
<p>Brilliant (!!) moves and Great Moves are always the best or nearly
best move in the position, but are also special in some way. We
replaced the old Brilliant algorithm with a simpler definition: a
Brilliant move is when you find a good piece sacrifice. There are some
other conditions, like you should not be in a bad position after a
Brilliant move and you should not be completely winning even if you
had not found the move. Also, we are more generous in defining a piece
sacrifice for newer players, compared with those who are higher rated.</p>
</blockquote>
<p>That can be programmed based on that description. I will try it if I have the time.</p>
<h4>Edit:</h4>
<p>Started working on it, but not done yet, it needs more tests. Sample detection tests from tatasteel games. The mat sac from Ding-Maghsoodloo, Giri-Gukesh and Carlsen-Abdusattorov were detected.</p>
<pre><code>[Event &quot;85th Tata Steel Masters&quot;]
[Site &quot;Wijk aan Zee NED&quot;]
[Date &quot;2023.01.15&quot;]
[Round &quot;2&quot;]
[White &quot;Ding Liren&quot;]
[Black &quot;Maghsoodloo,Parham&quot;]
[Result &quot;1/2-1/2&quot;]
[Annotator &quot;Brilliant Finder v0.1.0&quot;]
[BlackElo &quot;2719&quot;]
[ECO &quot;C78&quot;]
[EventDate &quot;2023.01.13&quot;]
[WhiteElo &quot;2811&quot;]

1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.O-O b5 6.Bb3 Bc5 7.a4 Rb8 8.c3 d6 9.d4 Bb6 10.a5 Ba7 11.h3 O-O 12.Be3 Ra8 13.Nbd2 Bb7 14.Re1 Re8 15.Ng5 Re7 16.Ndf3 h6 17.Nxf7 $3 { sacrifices material worth 1 pawn unit and has not regained the material in the next 2 plies. } 17...Rxf7 18.dxe5 Bxe3 19.exf6 Ba7 20.fxg7 Qf6 21.Qd5 Kxg7 22.Qxf7+ Qxf7 23.Bxf7 Kxf7 24.e5 Nxe5 25.Nxe5+ dxe5 26.Rxe5 Rg8 27.g4 Rd8 28.Rae1 Rd7 29.Kh2 c5 30.Rf5+ Kg7 31.Kg3 Bb8+ 32.Kh4 Bc7 33.Re6 Bd5 34.Rxa6 b4 35.Kh5 Bf7+ 36.Rxf7+ Kxf7 37.Kxh6 bxc3 38.bxc3 Be5 39.Rc6 Bxc3 40.Rxc5 Bd2+ 41.g5 Rd4 42.Kh5 Ra4 43.Rc7+ Kf8 44.Rd7 Bc3 45.Kg6 Rxa5 46.h4 Ra6+ 47.Kh7 Ra4 48.h5 Rf4 49.Rd3 Rf7+ 50.Kg6 Rg7+ 51.Kh6 Rc7 52.f4 Rc6+ 53.Kh7 Rc7+ 54.Kg6 Rc6+ 55.Kh7 Rc7+ 56.Kh6 Rc6+ 57.g6 Bf6 58.Ra3 Rc8 59.Ra6 Bc3 60.Ra7 Kg8 61.Kg5 Rc5+ 62.Kg4 Rc6 63.Rd7 Bb2 64.Rd8+ Kg7 65.Rd7+ Kg8 66.Kg5 Rc5+ 67.Kh6 Bf6 68.Rf7 Rc6 69.Ra7 Rd6 70.Ra8+ Rd8 71.Ra7 Rd6 72.Rb7 Rd8 73.f5 Rd6 74.Ra7 Rd8 75.Ra6 Rf8 76.Rc6 Bd8 77.Re6 Bf6 78.Rc6 Bd8 79.Re6 Bf6 1/2-1/2

</code></pre>
<p><a href="https://i.stack.imgur.com/hTMEC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hTMEC.png" alt="enter image description here" /></a></p>
<hr />
<pre><code>[Event &quot;85th Tata Steel Masters&quot;]
[Site &quot;Wijk aan Zee NED&quot;]
[Date &quot;2023.01.15&quot;]
[Round &quot;2&quot;]
[White &quot;Giri,A&quot;]
[Black &quot;Gukesh,D&quot;]
[Result &quot;1-0&quot;]
[Annotator &quot;Brilliant Finder v0.1.0&quot;]
[BlackElo &quot;2725&quot;]
[ECO &quot;D38&quot;]
[EventDate &quot;2023.01.13&quot;]
[WhiteElo &quot;2764&quot;]

1.d4 Nf6 2.c4 e6 3.Nf3 d5 4.Nc3 Bb4 5.Bg5 h6 6.Bxf6 Qxf6 7.e3 O-O 8.Rc1 dxc4 9.Bxc4 c5 10.O-O cxd4 11.Ne4 Qe7 12.a3 Ba5 13.exd4 Rd8 14.Rc2 Bd7 15.Re2 Bc6 16.Qc2 Bb6 17.Rfe1 Kh8 18.Neg5 $3 { sacrifices material worth 2 pawn units and has not regained the material in the next 2 plies. } 18...hxg5 19.Rxe6 $3 { sacrifices material worth 6 pawn units and has not regained the material in the next 2 plies. } 19...fxe6 20.Rxe6 Qxe6 21.Bxe6 Bxf3 22.Qf5 Be4 23.Qxe4 Rxd4 24.Qf3 g4 25.Qf8+ Kh7 26.Bf5+ Kh6 27.Bc2 1-0
</code></pre>
<p><a href="https://i.stack.imgur.com/05ep7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/05ep7.png" alt="" /></a></p>
<hr />
<pre><code>[Event &quot;85th Tata Steel Masters&quot;]
[Site &quot;Wijk aan Zee NED&quot;]
[Date &quot;2023.01.19&quot;]
[Round &quot;5&quot;]
[White &quot;Carlsen,M&quot;]
[Black &quot;Abdusattorov,Nodirbek&quot;]
[Result &quot;0-1&quot;]
[Annotator &quot;Brilliant Finder v0.1.0&quot;]
[BlackElo &quot;2713&quot;]
[ECO &quot;A35&quot;]
[EventDate &quot;2023.01.13&quot;]
[WhiteElo &quot;2859&quot;]

1.c4 c5 2.Nf3 Nf6 3.Nc3 Nc6 4.e3 e5 5.Be2 d5 6.cxd5 Nxd5 7.O-O Be7 8.Bb5 Nxc3 9.bxc3 Qc7 10.d4 cxd4 11.cxd4 exd4 12.Nxd4 Bd7 13.Nf3 Bf6 14.Ba3 $3 { sacrifices material worth 2 pawn units and has not regained the material in the next 2 plies. } 14...Bxa1 15.Qxa1 O-O-O 16.Rc1 Kb8 17.Qxg7 Rhg8 18.Qb2 Bg4 19.Ne1 Rd1 20.Rxd1 Bxd1 21.Bf1 Ne5 22.h3 Bf3 23.Qd4 Rd8 24.Qh4 Bd5 25.Qxh7 Bc4 26.Bb2 Bxf1 27.Kxf1 Qc4+ 28.Kg1 Nc6 29.Nf3 Qxa2 30.Bf6 Rd1+ 31.Kh2 a5 32.Nd4 Qd5 33.Qc2 Qd6+ 34.f4 Rxd4 35.Bxd4 Nxd4 36.exd4 Qxf4+ 37.g3 Qxd4 38.h4 a4 39.Qa2 f5 40.h5 Qh8 41.Qxa4 Qxh5+ 42.Kg1 Qf3 43.Kh2 Qe2+ 44.Kg1 Qe5 45.Kf2 b5 46.Qb4 Kb7 47.g4 fxg4 48.Qxg4 Kb6 49.Qg8 b4 50.Kf3 Kb5 51.Kg2 Qe2+ 52.Kg3 Qe3+ 53.Kg2 b3 54.Qb8+ Kc4 55.Qg8+ Kc3 56.Qc8+ Kd2 57.Qh8 Kc2 58.Qc8+ Kd1 59.Qh8 Qd2+ 60.Kg3 b2 0-1

</code></pre>
<p><a href="https://i.stack.imgur.com/9rxAN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9rxAN.png" alt="enter image description here" /></a></p>
<hr />
