I have been trying to acces the chess.com api via Python.
--------------------------------------------------------------------------------
import requests
x = requests.get("https://api.chess.com/pub/player/Hikaru/stats")
print(x.json())
----------------------------------------------------------------------------------------------
However, this gives me an error and when just printing 'x' I get <Response [403]> which indicates that the server understands the request but refuses to authorize it. Anybody knows how to solve this?
https://www.chess.com/club/chess-com-developer-community
You need to be hitting the Public API endpoints and you have to include a header with contact information in your scripts.
I have been trying to acces the chess.com api via Python.
--------------------------------------------------------------------------------
import requests
x = requests.get("https://api.chess.com/pub/player/Hikaru/stats")
print(x.json())
----------------------------------------------------------------------------------------------
However, this gives me an error and when just printing 'x' I get <Response [403]> which indicates that the server understands the request but refuses to authorize it. Anybody knows how to solve this?