basketballapi.net

Documentation / Start here

Errors

Every error code, what it means and what to do about it.

One shape for every error

{
  "error": {
    "code": "quota_exceeded",
    "message": "This key has used its 100 calls for today. The allowance resets at 2026-10-03T00:00:00Z.",
    "resets_at": "2026-10-03T00:00:00Z",
    "docs": "https://basketballapi.net/documentation/errors"
  }
}

Switch on code: codes never change. message is a plain sentence you can show as it is, and may be reworded.

The codes

HTTPCodeWhat to do
400bad_requestA value is wrong, such as a date that is not a date. The message names it.
401unauthorizedNo key, or a key that is not valid or was revoked. Check the header.
403upgrade_requiredThe endpoint or the date is on another plan. The answer names it in plan, with a link in pricing.
404not_foundNo record with that id, or no such endpoint.
422unknown_parameterA parameter this endpoint does not take. The message lists the ones it does.
429rate_limitedToo many calls this minute. Wait the seconds in Retry-After.
429quota_exceededToday's calls are used up. Try again after resets_at, or move to a bigger plan.
500server_errorSomething went wrong on our side. It is logged; try again shortly.

Retrying

Retry a 429 after Retry-After and a 500 after a short wait. Never retry a 400, 401, 403, 404 or 422 unchanged: the same request fails the same way.