📢 Got something to promote? This is your space! Whether it's: A coding project or tool A Fiverr or Upwork gig Your Discord server or Chess.com club A YouTube channel, website, or anything else 👉 Post it right here. 🚫 Do not advertise anywhere else in the forums.All off-thread promos will be deleted — no exceptions. ✅ Use this thread to connect, promote, and support others in the ChessDev Hub. Let’s help each other grow the right way. Share your connections below.⬇️
AlAlper 2 days ago
🧠 ♟ 🔧⚡Hi all! I'm curious what tools people are using to program for Chess.com --- whether you're writing scripts, working with the API, automating tournament workflows, or analyzing games. My background is in C# and C++, but these days I'm building tools with Python and using a fully free AI-enhanced setup: 🔧 My current stack: VS Code (free) Pylance (free, fantastic Python AI autocomplete) GitHub Copilot (free-ish if you’re under the usage limit) ChatGPT-4 (for coding, debugging, and generating samples fast) Pylance often finishes 10+ lines of code just from a few keystrokes — sometimes even useful 😄Copilot lets me click an error, ask for a fix, and it will suggest changes. Not perfect, but a huge boost to productivity.You can even right-click code and get detailed explanations or (caution ⚠️) use the refactor option... which may or may not destroy your code 😅 I rarely search through volumes of documentation anymore — ChatGPT and Copilot usually give me a fast starting point or complete snippet. 💬 What about you? Let’s share what works and build a thread that helps new coders dive into Chess.com dev with confidence!
AlAlper 4 days ago
What are you working on?What’s spinning around in your brain today?Coding something cool? Debugging something evil?Found a weird API? Built a funky bot? Just tinkering? Whether it’s Python, C#, Selenium, database hacks, or a completely random thought, drop it here. Show us what you’re doing (or trying to do). Screenshots, rants, victories, and questions all welcome. 👨‍💻⚙️🧩💡This is your space. Devs helping devs. Coders helping coders. Or just vibing. If it is is big make a new thread. 
AlAlper 3 hrs ago
Many ways to return API endpoint in various environments and coding method. This is mine. Using VBA to return data into MS Excel spreadsheet. Standarised module for every call. ' 13/02/23' Input: 'up_HTTP' String of URL API endpoint' Input: 'ModName' calling Subroutine to include in 'User-Agent'' Input: 'svalidate', additional checking if required' Output: 'get_API' string contains endpoint data or error string' Changed to include .status return value Public Function get_data_API(ByRef up_http As Variant, ByRef ModName As Variant, Optional sValidate As Variant) As String If IsMissing(sValidate) Then sValidate = "" Dim xmlHttpDim iCount, iPCount As IntegerDim sStatus As Variant Set xmlHttp = CreateObject("msxml2.xmlhttp.6.0") Dim UNameWindows As VariantDim sPath, sFileLog As VariantUNameWindows = Environ("USERNAME") sPath = ActiveWorkbook.PathsFileLog = sPath & "\MPLog.txt" booLog = ThisWorkbook.Worksheets("Control Panel").CheckBox9.Value With xmlHttpiCount = 0iPCount = 0Do.Open "get", up_http, False.setRequestHeader "User-Agent", ModName & ", username: " & UNameWindows & "; contact: xxxxxx@xxx.com".sendsStatus = .Status'Debug.Print CSng(Trim(.Status))Select Case sStatus Case Is = 200get_data_API = .responseTextCase Is = 301'MsgBox "Wrong URL", vbCritical, "Incorrect"get_data_API = "Error 301: Wrong URL " & up_httpiCount = 100 ' Not viable immediate returnbooLog = TrueCase Is = 304'MsgBox "Data unchanged", vbCritical, "If-Modified-Since"get_data_API = "Error 304: Data unchanged: " & up_httpiCount = iCount + 1 ' Try againCase Is = 404'MsgBox "No Data for URL" & xmlHttp, vbCritical, "Error 404"get_data_API = "Error 404: No Data for URL: " & up_httpiCount = 100 ' Not viable immediate returnbooLog = TrueCase Is = 410'MsgBox "No Data for URL will be available" & xmlHttp, vbCritical, "Error 410"get_data_API = "Error 410: No Data for URL will be available: " & up_httpiCount = 100 ' Not viable immediate returnbooLog = TrueCase Is = 429'MsgBox "Rate limit", vbCritical, "Error 429"get_data_API = "Error 429: rate limit"iCount = iCount + 1 ' Try againbooLog = TrueCase Is = 502'MsgBox "DB Overload", vbCritical, "Oh no!"get_data_API = "Error 502: DB Overload"iCount = iCount + 1 ' Try againDoEventsApplication.Wait (Now + TimeValue("00:10:00"))Case Elseget_data_API = "Error xxx: Unknown error"iCount = iCount + 1 ' Try againbooLog = TrueEnd SelectIf booLog Then Call Log2File(sFileLog, sStatus, up_http)If InStr(get_data_API, "Temporary rate limit exceeded") > 0 TheniPCount = iPCount + 1If InStr(Application.StatusBar, " Upload Paused") ThenApplication.StatusBar = Left(Application.StatusBar, Len(Application.StatusBar) - 1) & iPCountElseApplication.StatusBar = Application.StatusBar & " Upload Paused " & iPCountEnd IfDoEventsApplication.Wait (Now + TimeValue("00:10:00"))get_data_API = "" End IfLoop While (get_data_API = "" And iCount < 100) Or InStr(LCase(get_data_API), "bad gateway") > 0End With Set xmlHttp = Nothing End Function
AlAlper 1 day ago
💬 New here? Stuck on something? Need a hand? This is the go-to hub for asking questions, getting help, and troubleshooting anything Chess.com-related — including but not limited to: 🧩 Scripts, bots, and automations ⚙️ Chess.com tools or APIs 🖥️ Setup issues or code problems 🧪 Or just figuring out where to start! 📌 Quick question? Ask it here.If your issue is more detailed or you’d prefer your own space, you can create a new forum topic here. We’re here to help — post below and someone will jump in! ⬇️
AlAlper 2 days ago
🧠 How to Use the Chess.com API in Python — With Headers & Real Examples♟️🐍 So what do you want to do with the Chess.com API? You can pull user profiles, ratings, games, tournament participants, and more. The data is all public, and it's a great way to build analysis tools, or club automation systems. ⚠️ Why You Need Custom Headers Before we jump into the code, here’s a critical tip:Always include headers in your API requests. Chess.com uses rate limiting and spam prevention. If you skip the headers, you’ll be Forbidden. 403 Forbidden (Access denied) If do do to much to fast you will get. 429 Too Many Requests (You’ve hit the rate limit) Adding a proper User-Agent with your app name and contact info tells their system: “Hey, I’m not a bot. I’m a human using this responsibly. Here’s how to reach me.” 🧰 Setup: Define Your Custom Headers in Python We'll use an Enum to organize different headers for different purposes. This is optional but clean and scalable: from enum import Enum import requests # 🧠 Define headers for each type of API call class Api_Headers(Enum): ACTIVE_PLAYERS = { "User-Agent": "GT-Active-Players-App/1.0 (Python 3.9.13) -- Finds daily players. (contact- BEST @YourUsername on Chess.com or LEAST RELIABLE dev@example.com)", "Accept": "application/json", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive" } TOURNAMENT_PARTICIPANTS = { "User-Agent": "GT-Tournament-Participation-App/1.0 (Python 3.9.13) -- Gets tournament player list. (contact- BEST @YourUsername on Chess.com or LEAST RELIABLE dev@example.com)", "Accept": "application/json", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive" } USER_INFO = { "User-Agent": "GT-User-Info-App/1.0 (Python 3.9.13) -- Gets user info. (contact- BEST @YourUsername on Chess.com or LEAST RELIABLE dev@example.com)", "Accept": "application/json", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive" } 🧪 Example: Get the List of Players in a Tournament Let’s say you want to get a list of usernames who joined a specific tournament. 📘 Endpoint:https://api.chess.com/pub/tournament/{tournament-name}/players Here’s a full Python function to do just that: def get_tournament_usernames(tournament_name): """ Queries the Chess.com public API to get the list of player usernames in a tournament. Parameters: tournament_name (str): The slug or URL-friendly name of the tournament (e.g., 'gt-april-showers-knockout-1-1600'). Returns: list: A list of usernames who are participants in the tournament. """ # Build the full API URL using the tournament name url = f"https://api.chess.com/pub/tournament/{tournament_name}/players" # Make the GET request with headers to avoid rate-limiting or blocking response = requests.get( url, headers=Api_Headers.TOURNAMENT_PARTICIPANTS.value ) # If the request fails (e.g., bad tournament or missing headers), print status if response.status_code != 200: print(f"⚠️ Failed to get players: HTTP {response.status_code}") return [] # Convert the JSON API response into a Python dictionary data = response.json() # Extract the list of usernames from the response usernames = [ player["username"] for player in data.get("players", []) if "username" in player ] return usernames 🧪 Try It Out: players = get_tournament_usernames("gt-april-showers-knockout-1-1600") print(players) Output: ['ChessFan123', 'QueenCrusher', 'KnightRider89', ...] ✅ Summary Headers matter: use User-Agent to avoid getting blocked. The API is free and public — but you still need to be polite. The data you can grab is super useful for clubs, tournaments, analysis, and automation. 💬 Got questions? Want to explore more endpoints like user stats, game history, or leaderboards? Drop a comment in this thread.
AlAlper 3 days ago