Getting started
Errors
A failed call returns JSON with success set to 0 and an error code. You never get an HTML error page.
Error format
Check success on every response. When it is 0, there are no results and the body carries the error:
application/json
{
"success": 0,
"error": "PARAM_REQUIRED",
"error_detail": "sport_id"
}erroris a stable, uppercase code. Branch on it in your code.error_detailis optional. ForPARAM_REQUIREDandPARAM_INVALIDit names the parameter.
Error codes
These codes are also listed in the glossary as R-Errors.
| error | Meaning |
|---|---|
| INTERNAL_SERVER_ERROR | 500 Internal Server Error. Contact support if it keeps happening. |
| NOT_FOUND | 404 Not Found. |
| METHOD_NOT_ALLOWED | Method is not allowed, only GET is supported. |
| UNDER_MAINTENANCE | API is under maintenance. We announce it in advance. |
| AUTHORIZE_FAILED | Token is not provided or is incorrect. |
| TOO_MANY_REQUESTS | API rate limit exceeded. See X-RateLimit-Reset. |
| PERMISSION_DENIED | Your plan does not include this call. Contact support if this is wrong. |
| PARAM_REQUIRED | A required param is missing. Check error_detail. |
| PARAM_INVALID | A param is invalid. Check error_detail. |
Handling errors
AUTHORIZE_FAILED,PERMISSION_DENIED,PARAM_REQUIREDandPARAM_INVALIDfail again with the same call. Fix the token, plan or parameters first.NOT_FOUNDon an event id: the event may have been merged into another one. Check Merge History.TOO_MANY_REQUESTS: wait until the UTC epoch inX-RateLimit-Reset. See Rate limits.INTERNAL_SERVER_ERRORandUNDER_MAINTENANCE: retry with exponential backoff, for example after 1, 2, 4 and 8 seconds. If an internal error persists, contact support with the time and path of the call.METHOD_NOT_ALLOWED: every endpoint takesGETonly.
