Answers.Body: <p>@qwr’s answer to their own question mentions a “Python wrapper for chess.com API,” but I think it’s worthwhile answering with the API itself, because it’s very accessible without any need to know/use Python. Hence…</p>
  <p>Chess.com has, a fairly recently provided, Published Data API. See announcement by Ben Curtis, on May 10, 2022: “<a href="https://www.chess.com/news/view/published-data-api" rel="nofollow noreferrer">Published-Data API</a>”:</p>
  <blockquote>
  <p>The PubAPI is a read-only REST API that responds with JSON-LD data. Our goal is to re-package all currently public data from the website and make it available via the PubAPI. &quot;Public Data&quot; is information available to people who are not logged in, such as player data, game data, and club/tournament information. This excludes private information that is restricted to the logged in user, such as game chat and conditional moves.</p>
  </blockquote>
  <p>The key with using a REST API is to construct the appropriate URL that represents your query. (See Zell Liew, “<a href="https://www.smashingmagazine.com/2018/01/understanding-using-rest-api/" rel="nofollow noreferrer">Understanding And Using REST APIs</a>, Smashing Magazine, May 20, 2021, for the most-accessible intro I know about getting information from a REST API.)</p>
  <p>For example, to find out some basic information about Hikaru, specifically his “user profile,” put the following URL in your browser’s address bar:</p>
  <pre><code>https://api.chess.com/pub/player/hikaru
  </code></pre>
  <p>Your browser will return with:</p>
  <pre><code>    
  avatar  &quot;https://images.chesscomf…0x200o.f323efa57fd0.jpeg&quot;
  player_id   15448422
  @id &quot;https://api.chess.com/pub/player/hikaru&quot;
  url &quot;https://www.chess.com/member/Hikaru&quot;
  name    &quot;Hikaru Nakamura&quot;
  username    &quot;hikaru&quot;
  title   &quot;GM&quot;
  followers   983906
  country &quot;https://api.chess.com/pub/country/US&quot;
  location    &quot;Sunrise, Florida&quot;
  last_online 1662743764
  joined  1389043258
  status  &quot;premium&quot;
  is_streamer true
  twitch_url  &quot;https://twitch.tv/gmhikaru&quot;
  verified    true
  </code></pre>
  <p>For basic statistics about a player (ratings, win/loss, and other stats about a player's game play, tactics, lessons and Puzzle Rush score), tack on “/stats” to the previous URL:</p>
  <pre><code>https://api.chess.com/pub/player/hikaru/stats
  </code></pre>
  <p>This produces a long-ish regurgitation of statistics, for example, that Hikaru’s last bullet rating was 3352:</p>
  <pre><code>. . . 
  
  chess_bullet    
  last    
  rating  3352
  date    1661276020
  rd  41
  best    
  rating  3570
  date    1605136047
  game    &quot;https://www.chess.com/game/live/5710095242&quot;
  record  
  win 10136
  loss    1376
  
  . . .
  
  </code></pre>
  <p>Most directly on point to your question, you can get the PGN for all games a given player (i.e., <em>you</em>) played in a month. For Hikaru, for April 2022, the URL would be:</p>
  <pre><code>https://api.chess.com/pub/player/hikaru/games/2022/04/pgn
  </code></pre>
  <p>and your browser will download a multi-game PGN file.</p>
  <p>AFAICT, you can download a player’s game for a particular month, but not for any broader period.</p>
  <p>Since the URLs are very simple, it would be pretty easy to construct several year’s worth of URLs with a text editor and copy/pasting to change the years and months.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-10T03:20:31.850Z
Answers.Text: Very nice. Of course, if you're going to make multiple API requests and process the results, you might as well use a python wrapper to do all that
Answers.UserDisplayName: qwr
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-10T03:40:44.133Z
Answers.Text: @qwr That depends on (a) How many months of games you have and (b) how familiar you are with Python (or the fixed cost of becoming sufficiently familiar).
Answers.UserDisplayName: Jim Ratliff
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-10T01:04:56.870Z
Answers.LastActivityDate: 2022-09-10T01:04:56.870Z
Answers.UserDisplayName: Jim Ratliff
Answers.Body: <p>For anyone who needs this in the future, using chessinsights.xyz (a new feature from chess.com) allows you to trivially load all your games and export them into a csv or pgn file with more options as well.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-09-08T00:39:22.293Z
Answers.LastActivityDate: 2024-09-08T05:48:15.100Z
Answers.LastEditDate: 2024-09-08T05:48:15.100Z
Answers.UserDisplayName: user40834
Answers.Body: <p>Use my API to get all games.</p>
  <p><a href="https://github.com/ChameleonRed/cw_download_chess_com_games" rel="nofollow noreferrer">https://github.com/ChameleonRed/cw_download_chess_com_games</a></p>
  <p>It is very simple.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-20T20:29:43.057Z
Answers.LastActivityDate: 2022-10-20T20:29:43.057Z
Answers.UserDisplayName: Chameleon
Answers.Body: <ol>
  <li><p><a href="https://www.openingtree.com/" rel="nofollow noreferrer">OpeningTree.com</a> allows you to export all games played as White or Black by username.</p>
  </li>
  <li><p><a href="https://github.com/sarartur/chess.com" rel="nofollow noreferrer">Python wrapper for chess.com API</a> by  Artur Saradzhyan (I have not tested this.)</p>
  </li>
  <li><p>Manually export games from the chess.com game list, 50 at a time by date range (may require trivial deduplication). Supports chess clock info.</p>
  </li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-06T22:41:48.253Z
Answers.LastActivityDate: 2022-09-08T22:57:47.970Z
Answers.LastEditDate: 2022-09-08T22:57:47.970Z
Answers.UserDisplayName: qwr
Body: <p>How can I export all my games played on chess.com?</p>
  <p>For example to import to another program for analysis.</p>
  <p>Exporting from the chess.com games list only shows the most recent 50 games.</p>
  
Tags: <software><pgn><chess.com><download-games>
Title: Export all of my played games from chess.com
ThreadText: # Export all of my played games from chess.com
  
  (Asked by: username_0 on 2022-09-06)
  
  How can I export all my games played on chess.com?
  
  For example to import to another program for analysis.
  
  Exporting from the chess.com games list only shows the most recent 50 games.
  
  **Tags:** software, pgn, chess.com, download-games
  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_0 on 2022-09-06. Score: 5 | Accepted answer
  
  1. [OpeningTree.com](https://www.openingtree.com/) allows you to export all games played as White or Black by username.
  2. [Python wrapper for chess.com API](https://github.com/sarartur/chess.com) by Artur Saradzhyan (I have not tested this.)
  3. Manually export games from the chess.com game list, 50 at a time by date range (may require trivial deduplication). Supports chess clock info.
  
  
  ---
  
  ### Answer by username_1 on 2022-09-10. Score: 3
  
  @username_0’s answer to their own question mentions a “Python wrapper for chess.com API,” but I think it’s worthwhile answering with the API itself, because it’s very accessible without any need to know/use Python. Hence…
  Chess.com has, a fairly recently provided, Published Data API. See announcement by Ben Curtis, on May 10, 2022: “Published-Data API”:
  
  The PubAPI is a read-only REST API that responds with JSON-LD data. Our goal is to re-package all currently public data from the website and make it available via the PubAPI. "Public Data" is information available to people who are not logged in, such as player data, game data, and club/tournament information. This excludes private information that is restricted to the logged in user, such as game chat and conditional moves.
  
  The key with using a REST API is to construct the appropriate URL that represents your query. (See Zell Liew, “Understanding And Using REST APIs, Smashing Magazine, May 20, 2021, for the most-accessible intro I know about getting information from a REST API.)
  For example, to find out some basic information about Hikaru, specifically his “user profile,” put the following URL in your browser’s address bar:
  https://api.chess.com/pub/player/hikaru
  
  Your browser will return with:
      
  avatar  "https://images.chesscomf…0x200o.f323efa57fd0.jpeg"
  player_id   15448422
  @id "https://api.chess.com/pub/player/hikaru"
  url "https://www.chess.com/member/Hikaru"
  name    "Hikaru Nakamura"
  username    "hikaru"
  title   "GM"
  followers   983906
  country "https://api.chess.com/pub/country/US"
  location    "Sunrise, Florida"
  last_online 1662743764
  joined  1389043258
  status  "premium"
  is_streamer true
  twitch_url  "https://twitch.tv/gmhikaru"
  verified    true
  
  For basic statistics about a player (ratings, win/loss, and other stats about a player's game play, tactics, lessons and Puzzle Rush score), tack on “/stats” to the previous URL:
  https://api.chess.com/pub/player/hikaru/stats
  
  This produces a long-ish regurgitation of statistics, for example, that Hikaru’s last bullet rating was 3352:
  . . . 
  
  chess_bullet    
  last    
  rating  3352
  date    1661276020
  rd  41
  best    
  rating  3570
  date    1605136047
  game    "https://www.chess.com/game/live/5710095242"
  record  
  win 10136
  loss    1376
  
  . . .
  
  
  Most directly on point to your question, you can get the PGN for all games a given player (i.e., you) played in a month. For Hikaru, for April 2022, the URL would be:
  https://api.chess.com/pub/player/hikaru/games/2022/04/pgn
  
  and your browser will download a multi-game PGN file.
  AFAICT, you can download a player’s game for a particular month, but not for any broader period.
  Since the URLs are very simple, it would be pretty easy to construct several year’s worth of URLs with a text editor and copy/pasting to change the years and months.
  
  > **Comments:**
  > **username_0**: Very nice. Of course, if you're going to make multiple API requests and process the results, you might as well use a python wrapper to do all that  
  > **username_1**: @username_0 That depends on (a) How many months of games you have and (b) how familiar you are with Python (or the fixed cost of becoming sufficiently familiar).  
  
  ---
  
  ### Answer by username_2 on 2024-09-08. Score: 1
  
  For anyone who needs this in the future, using chessinsights.xyz (a new feature from chess.com) allows you to trivially load all your games and export them into a csv or pgn file with more options as well.
  
  
  ---
  
  ### Answer by username_3 on 2022-10-20. Score: 0
  
  Use my API to get all games.
  
  <https://github.com/username_3Red/cw_download_chess_com_games>
  
  It is very simple.
  
  
  ---
  
  