Couple of questions regarding the API

Sort:
Ximoon

Hello, I'm using the published API for a couple of things mostly linked to daily matches and extracting stats from them, and I have a couple question. I dug a bit in the forums but I haven't found my answers there, sorry if I'm asking things that's already been answered before.

1. Getting admins in charge of a team match

Using the endpoint https://api.chess.com/pub/match/{ID} (e.g. https://api.chess.com/pub/match/1) I can get various information about a team match, but the IDs of the admins organizing the match for both teamis not present in the JSON, and I haven't found a way to get it at all. Is there a workaround for that?

2. Error with country code XX clubs

When trying to get the list of clubs per country, I get an error with code XX (international) : https://api.chess.com/pub/country/XX/clubs gets "{"status":"error","message":"Internal Server Error"}". I suspect it's probably giving a result too big or something. Is there a workaround to get that list?

3. Limit of 500 team matches

According to the API documentation, the list of team matches per club we can get using https://api.chess.com/pub/club/{ID}/matchesis limited to 500. Except by bruteforcing (which works but is not so clean), would there be a smarter way to get older matches of a team?

Thanks!

stephen_33

1. Getting admins in charge of a team match - no such data is made available by the site.

But you're referring to the admins that created the match and accepted the challenge? Is that particularly useful because in the match leagues I help run those admins are not always the ones that are designated 'match representatives'.

As for the most recent 500 finished matches, that was a decision made by the site a couple of years ago and there's no way of getting around that via the API that I know about.

The site's API is far from perfect (no endpoints whatsoever for vote chess!) but the data provided is useful enough I'd say. You just have to work within the limitations.

Ximoon

Thanks for your answers! For the admins as I said it's mostly for statistics, not very important in the end, but I was curious about this data as it's shown on the match public page but not on the API call. 

For the match number limitations I have already a workaround but it's just not optimal, and also for some reason I have the feeling that I fail to get about 0.02% of the team matches I'm looking for.

Maybe it's incomplete, but I'm glad this API exists in the first place!

stephen_33

https://api.chess.com/pub/country/XX/clubs

Is it possible that it's an invalid endpoint, that's to say no data is provided for that category? After all, 'international' isn't a country category.

I took a look at about 20 clubs that play in one of my leagues and while several have country flags associated with them, none have the international flag. Is it the default or is none the default? I'm not sure.

Ximoon

I explicitely checked with some international clubs, they have "XX" in their description.

E.g. https://api.chess.com/pub/club/daily-tournaments-fans-club

https://api.chess.com/pub/country/XX

Tricky_Dicky

You can set a group's country as 'International' but it doesn't display the associated flag as it does with all other countries. Also same issue with EU. So these country settings that are not UN recognized countries are dealt with as exceptions. So it probably handles the API end point in a similar manner.