Detecting closed/disabled clubs

Sort:
Avatar of ImperfectAge

When a club is disabled, it causes problems for any league it's in and any opponents.

I'd like to be able to programmatically detect disabled clubs.  Has anybody found a way to do it?

The club appears to look entirely normal from the API:

For example, Chess Champions Legion was recently disabled.

When you go to its club page on the site you get redirected to '/clubs' and there's a banner.  
https://www.chess.com/club/chess-champions-legion-1

But when you use the public-API, there's no indicator that I can see:

$ curl "https://api.chess.com/pub/club/chess-champions-legion-1" | jq
{
  "@id": "https://api.chess.com/pub/club/chess-champions-legion-1",
  "name": "Chess Champions  Legion",
  "club_id": 163600,
  "country": "https://api.chess.com/pub/country/XX",
  "average_daily_rating": 1668,
  "members_count": 575,
  "created": 1595998354,
  "last_activity": 1753252684,
  "admin": [
    "https://api.chess.com/pub/player/janisabolinss"
  ],
  "visibility": "private",
  "join_request": "https://www.chess.com/club/join/163600",
  "icon": "https://images.chesscomfiles.com/uploads/v1/group/163600.233be8f0.50x50o.d38deb646c07.jpg",
  "description": "<p><strong>Greetings we are a team with daily chess, vote chess,960 daily chess, and live chess tournaments, we participate in all major team Leagues</strong>&nbsp;<span style=\"color: #e03e2d;\"><span style=\"color: #e03e2d;\"><strong>1) TMCL</strong></span><strong style=\"color: #e03e2d;\">, 2) 1WL, </strong><span style=\"color: #e03e2d;\"><strong>3) KOTML</strong></span><strong style=\"color: #e03e2d;\">, 4) TCMAC. </strong><strong><span style=\"color: #e03e2d;\"><span style=\"color: #169179;\">W</span></span><span style=\"color: #169179;\">e intend to become a DIVISION A team in all these Leagues one day</span></strong><strong style=\"color: #e03e2d;\">, we would be honoured to have you with us!! Please be kind and active ,play fair ,that is all we ask!!</strong></span></p>\r\n<p><span style=\"color: #e03e2d;\"><strong style=\"color: #e03e2d;\">&nbsp;<br /></strong></span></p>",
  "url": "https://www.chess.com/club/chess-champions-legion-1"
}

Has anybody found a way to detect disabled clubs?

Avatar of adam_aau

I checked reference and looks like it might be unachievable by api. But maybe you hacks are ok?
you can check response code of join_request url, looks like it answer 302 inn that case.

Maybe you can decide to remove all inactive clubs as well? Then you can look at last activity, and remove it if its smaller than accepted

Avatar of Tricky_Dicky

Doubt that the API will be modified (but you never know).

Would it be possible to use a callback. Staff would need to agree to it's use.

Avatar of ImperfectAge

I noticed if you get the headers from the disabled club using the chess.com address you will get a HTTP 302 response, whereas normally you would get 200.

Try this, for example
$ curl -I "https://www.chess.com/club/world-chess-legion-1"
HTTP/2 302

Avatar of ImperfectAge

And renamed clubs return a 404 from their old URL.

$ curl -I "https://www.chess.com/club/the-faster-club"
HTTP/2 404 
(Is now the-fastest-club.. but the API doesn't help you there either)

Avatar of ninjaswat

For disabled clubs the notes / forums / etc are still accessible so I don't think it's more than a boolean flipping that changes that page. So unless that specific event was exposed to the api, back to getting permission for webscraping we go

Avatar of rwv37

I don't know if this has anything to do with the issue, but I do feel like it might, so:

I've noticed over the past several days, maybe week, that (in my browser, desktop) I get a whole lot of messages like that (red banner at the top) that are completely spurious. Including this one ("Oops! This club has been disabled."). Not limited to it, though: I've also been getting a lot of similar (red and spurious) notices that a tournament I've been looking at has been canceled.

So, are you absolutely certain that the club in question really has been disabled?

Avatar of XxDVDHSNxX

I dont think that

Chess.com’s API doesn’t show if a club is disabled. the only way is to visit the club’s URL directly.

If you get a redirect (HTTP 302) or see a banner, it’s disabled.
Renamed clubs return HTTP 404 at the old URL.
So i dont think that the API’s last_activity field isn’t reliable for this.

Avatar of DiegoD1390

can access the notes of the club even if It's disable, for example: https://www.chess.com/club/notes/clube-de-aprendizado-para-brasileiros-a-mestres

Avatar of Guendulain

A player cannot belong to a disabled club. Therefore, we only need to check in the API endpoint above if that club is in the list of clubs the admin (janisabolinss in this case) is member of. If not, the club is closed or disabled.