Forums

Please ive me a way to quickly search and (bulk) download my games and I am happy to upgrade.

Sort:
sokoban

The title says it all.

Please give me a way to quickly search and (bulk) download my chess games. and I would be happy to upgrade my membership.

Upgrading my membership up from Gold does not add up for me right now. I am not really interested in the extra functionality currently offered. 

GM-BrilliantEmote

You can search your games by going to your game archives and setting specific requirements to narrow down the game ur looking for. If you want to bulk download games, you can write a simple script to go through chess.com's api and get all ur games.

GM-BrilliantEmote

Alternatively you can just select one row of games at a time in ur archive and download them

sokoban
Yep, I have been pretty busy with that lately. Whenever I play a game on my iPad that I consider worthwhile, I mail the link to my own email account, pick it up later on my laptop, click on the link, go to analyze in the browser, download the pgn, delete the email and check if the number of deleted mails equals the number of downloads. If not, I have to figure that out. This is exactly what I mean.

Regarding the api script, can you provide me with one?
GM-BrilliantEmote

from chessdotcom import get_player_game_archives, Client

import requests
Client.request_config["headers"]["User-Agent"] = (
"My Python Application. Contact me at [email protected]"
)

def fetch_all_games(username):
response = get_player_game_archives(username)
data = response.json
games = []

for archive_url in data['archives']:
headers = {"User-Agent": "My Python Application. Contact me at [email protected]"}
archive_response = requests.get(archive_url, headers=headers)
archive_response.raise_for_status() # Raises HTTPError for bad responses (4xx and 5xx)
games_data = archive_response.json()['games']
games.extend(games_data)
return games

all_games = fetch_all_games(username)

GM-BrilliantEmote

You can use this python script to get all your games in a large list: I dont know what you want to do with it but I can help you write a script to store all each game in a txt file or something.
To run this you will need to (pip install chessdotcom) and (pip install requests) (in the environment you use to run the code (i use the terminal)
Additionally u will have to fix some of the indentation in that code: i dont know how to fix the formatting in the chat
Let me know if you need any other help happy.png