This should work
https://api.chess.com/pub/player/{username}
but do note that this returns the country using
the format "Alpha2" which you can find a list online.
example: https://api.chess.com/pub/player/hikaru
response:
The user hikaru is from the US also known as The United States of America
I cannot find an API that allows me to enter a player's name and have it return data containing the country they are from.. Any help is appreciated.