Concepts
Errors
Errors use normal HTTP status codes and always come with a short JSON body that says what went wrong.
Every error is a JSON object with an error string. Some carry one more field: retryAfter or resetIn on rate limits and lookup on player errors. The full shape is the Error object.
Response404
{
"error": "Unknown item"
}A 400 names every parameter that failed and why, separated by semicolons. Fix the request rather than retrying it.
GET /v1/players?limit=1000400
{
"error": "limit: Too big: expected number to be <=200"
}GET /v1/leaderboards/coins400
{
"error": "board: Invalid option: expected one of \"money\"|\"deaths\"|\"playtime\"|\"placedBlocks\"|\"brokenBlocks\"|\"mobsKilled\"|\"kills\"|\"shards\"|\"bounties\""
}Retry 429 after retry-after seconds and 500 or network failures after a short backoff. Never retry 400, 401, 403 or 404 unchanged: the answer will be the same.
Player 404s are remembered
When DonutSMP says a player does not exist, that answer is kept for 10 minutes, so a typo does not start the same live lookup over and over.
