API v2 Documentation

Endpoints Code Lookup

Errors

Below are common errors returned by the API. These will be contained in the error block.

AUTHORIZE_FAILEDThe key is incorrect, invalid, or expired. Please refer to the account page (requires login) to check the API key.
TOO_MANY_REQUESTSThe API key has exceeded its rate limit. Please refer to information on rate limits.
NO_ENDPOINTA valid endpoint has not been specified. Please refer to the list of endpoints for guidance.
PARAMETER_MISSINGA valid sport or level path parameter has not been specified. Please refer to the list of acceptable values.
UNAUTHORIZEDThe API key has exhausted its allocation of free tokens, and the account must be upgraded in order for the key to be restored.
OUT_OF_RANGEThis message occurs when the API key is not valid for the sport requested (e.g. the API key is owned by a user with a valid NBA subscription, and the MBB endpoint is called).
UNDER_MAINTENANCEThe API is undergoing maintenance or temporary downtime. In the case of scheduled maintenance, the meta block may include details on when the service will be active again.
BLOCKEDThe API key has been temporarily suspended or permanently revoked due to multiple IP access, improperly written code that affects other customers' use of the API in any way, or construction of an identical app or website that utilizes a high percentage of National Statistical's data. Please review our three-strike policies on API abuse.

Below is a sample PHP-formatted error block for an account that has exhausted its allocation of free tokens.

[error] => SimpleXMLElement Object
(
[message] => UNAUTHORIZED
[detail] => Your account does not have API access. Please refer to http://natstat.com/subscribe for subscription options.
)