user4399: I would like to generalise What are examples of grandmaster games where both Black and White castle opposite sides and the queenside players loses?
Question: Is there a way I can search this up myself?
Like perhaps in the chessgames, chesstempo, lichess or chessdotcom database or perhaps youtube via chessvision (You can select the theme 'opposite site castling'), I plug in parameters like

Title/rating parameter: both (or at least 1 of the) players, say, Alice and Bob, obtained the title of GM or have a certain rating (either at the time of the game or later on in life)

Some middlegame parameter: Alice castled queenside while Bob castled kingside

Winning parameter: Alice lost.

Date parameter: games from date t to date t+X

Perhaps also some endgame parameter: Like they reached a rook endgame or a bishop vs knight endgame.


Ideal answer: I'm asking if there's a readily available way to do this. Like someone's already made this kind of thing where we can plug in these themes/parameters.
Next best thing/s: Well I suppose there's manually downloading perhaps some grandmaster database and then we write script in python or something that searches O-O vs O-O-O and then use the same way lichess or chessvision identifies 'rook endgame' or 'bishop vs knight endgame'. In this case, please give whatever suggestions you can.

user4418: 
Question: Is there a way I can search this up myself?

Yes. There is a tool called CQL (Chess Query Language) which allows you to search a PGN file database of games for games that match some set of criteria in the same way that SQL allows you to search a relational database for records which match a set of criteria.
The CQL User Guide describes what CQL does, how to download and install CQL, how to use it and gives example CQL queries to get you started.
Tim Krabbe also has a useful page on his website describing how he has used the tool to find interesting positions and games.

4399: <p>I would like to generalise <a href="https://chess.stackexchange.com/questions/13918/what-are-examples-of-grandmaster-games-where-both-black-and-white-castle-opposit">What are examples of grandmaster games where both Black and White castle opposite sides and the queenside players loses?</a></p>
<p><strong>Question</strong>: Is there a way I can search this up myself?</p>
<p>Like perhaps in the chessgames, chesstempo, lichess or chessdotcom database or perhaps youtube via <a href="https://my.chessvision.ai/search" rel="nofollow noreferrer">chessvision</a> (You can select the theme 'opposite site castling'), I plug in parameters like</p>
<ol>
<li><p>Title/rating parameter: both (or at least 1 of the) players, say, Alice and Bob, obtained the title of GM or have a certain rating (either at the time of the game or later on in life)</p>
</li>
<li><p>Some middlegame parameter: Alice castled queenside while Bob castled kingside</p>
</li>
<li><p>Winning parameter: Alice lost.</p>
</li>
<li><p>Date parameter: games from date t to date t+X</p>
</li>
<li><p>Perhaps also some endgame parameter: Like they reached a rook endgame or a bishop vs knight endgame.</p>
</li>
</ol>
<p><strong>Ideal answer</strong>: I'm asking if there's a readily available way to do this. Like someone's already made this kind of thing where we can plug in these themes/parameters.</p>
<p><strong>Next best thing/s</strong>: Well I suppose there's manually downloading perhaps some grandmaster database and then we write script in python or something that searches O-O vs O-O-O and then use the same way lichess or chessvision identifies 'rook endgame' or 'bishop vs knight endgame'. In this case, please give whatever suggestions you can.</p>
 4418: <blockquote>
<p>Question: Is there a way I can search this up myself?</p>
</blockquote>
<p>Yes. There is a tool called <a href="https://en.wikipedia.org/wiki/Chess_Query_Language" rel="nofollow noreferrer">CQL</a> (Chess Query Language) which allows you to search a PGN file database of games for games that match some set of criteria in the same way that SQL allows you to search a relational database for records which match a set of criteria.</p>
<p>The <a href="http://www.gadycosteff.com/cql/" rel="nofollow noreferrer">CQL User Guide</a> describes what CQL does, how to <a href="http://www.gadycosteff.com/cql/download.html" rel="nofollow noreferrer">download</a> and install CQL, how to use it and gives <a href="http://www.gadycosteff.com/cql/" rel="nofollow noreferrer">example CQL queries</a> to get you started.</p>
<p>Tim Krabbe also has a <a href="https://timkr.home.xs4all.nl/chess2/cql.htm" rel="nofollow noreferrer">useful page</a> on his website describing how he has used the tool to find interesting positions and games.</p>
