A Better Way to Get Opponents Country from api.chess.com

Sort:
anathanatoid

I am building a map of countries I've played opponents from.  I have a rather extensive history (30,000 games) and can get the list of games easily enough, but to get the country of the opponents it seems I have to make an individual request, per player, to get it.  Gak.

I thought about using the "country players" endpoint (https://api.chess.com/pub/country/{iso}/players) to just fetch as many players as possible, but that seems pretty idiotic.  Any other suggestions?

tehanu

https://www.chess.com/awards/anathanatoid/passport

Guendulain

You can use the https://api.chess.com/pub/player/{username} endpoint, 'country' tag.

anathanatoid

@Guendulain - thanks, but, to be clear, that is what I'm trying to avoid because it would be 30,000 API requests.

Nevfy

@anathanatoid  The only way to fulfill your request is to ask country for each of your opponents. I do not see the other way to perform your request.

gullupakka

check the passport section in your awards, like deeper thinking said, to check which countries' opponents you have played

erik

There is probably no other way at this time, or in the near future. Sorry! (You are an awesomely rare person to have played that many people!)