Why does the API return 401, 403, 404 or 429?
Each code has one cause:
-
401 means the key is missing or wrong (invalid_key), or has expired (key_expired). Check the X-Api-Key header, or create a new key.
-
403 browser_not_allowed means the request came from a browser. Requests with an Origin header are refused, so call the API from your server only.
-
404 means the game or league is not yours, or does not exist. The API returns only your own data.
-
429 rate_limited means you went over 60 requests per minute for that key. Slow down and use the X-RateLimit-Reset header to know when to retry.
A revoked key also returns 401. Error bodies look like {“error”: {“code”, “message”}}.