Upcoming Club Tournament data troubles with the Published Data API

Sort:
tryingtolearn1234

I had the idea to write a simple moo.bot command that would use moo.bot's JSON url fetch integration and the chess.com Published data API to provide links to the next club tournament for a friends stream.  

Basic Concept

  1. A viewer watching on twitch goes into the chat window and types the command  e.g. "!tournament" 
  2. Alternatively schedule the command to run every few minutes.
  3. Moo.bot sees the command and executes a JSON URL fetch to get the next tournament for a specific club or perhaps using player endpoint for the streamer
  4. Moo.bot populates a message e.g. "Join my club {club url} and then join the tournament here: {tournament url} and posts to the chat.
  5. Everyone watching sees the message via twitch chat.
  6. Twitch mods and streamers rejoice as they don't have to keep modifying a copy and pasted message every time a new tournament is queued up.

All the ways I tried and failed cry.pngcry.png so far

Unfortunately it looks like this is impossible; but I'm posting here in hopes I've missed something or maybe the chess.com developers will take pity on me and offer a fix/workaround/enhancement.

Here are my investigations so far:

1- The Club Endpoint  (data not available) -- shows matches, but does not show tournaments :-( . No luck there

2- The Tournaments Endpoint (can't get a list of tournaments) -- only lets you get the tournament if you know the URL; no way to query for all upcoming live tournaments and get the URL. 

3- Player Tournament Participation Endpoint (broken) --https://api.chess.com/pub/player/{username}/tournaments) -- in theory this should work because the spec says it provides an array of registered tournaments with the tournament URLs.  Unfortunately this isn't working for example: https://api.chess.com/pub/player/tryingtolearn1234/tournaments always returns empty data even though I've played in many tournaments. I tried other players as well, it never seems to have data. 

{"finished":[],"in_progress":[],"registered":[]}


WhiteDrake
tryingtolearn1234 wrote:

3- Player Tournament Participation Endpoint (broken) --https://api.chess.com/pub/player/{username}/tournaments) -- in theory this should work because the spec says it provides an array of registered tournaments with the tournament URLs.  Unfortunately this isn't working for example: https://api.chess.com/pub/player/tryingtolearn1234/tournaments always returns empty data even though I've played in many tournaments. I tried other players as well, it never seems to have data. 

{"finished":[],"in_progress":[],"registered":[]}

This endpoint isn't broken, but it only shows daily tournaments (not live tournaments), unless I'm mistaken. I have the impression that the priority for the published API endpoints has been daily games so far (and info about players or teams), not live games.

tryingtolearn1234

The documentation isn’t clear on the subject of only daily tournaments.  Sigh.  

WhiteDrake

I'll use the name of an active moderator, @MGleason. (I hope he won't mind. happy.png I'd use myself but I never played any tournament.) The endpoint contains no live tournaments (e.g. no Untitled Tuesday etc.)

https://api.chess.com/pub/player/mgleason/tournaments

andreamorandini

@WhiteDrake , we added live tournaments to players tournaments endpoints. See for example https://api.chess.com/pub/player/mgleason/tournaments

 

WhiteDrake

I’m glad to see this change. happy.png Thank you for your good work!