Skip to main content

Response Format

All API responses are JSON (Content-Type: application/json). This page describes the conventions used across different endpoint groups.

Data Endpoints

Trends, references, betting, and games endpoints return data directly — no envelope wrapper:

curl -X POST https://api.odditt.com/v1/trends/mixed-flows \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sport_id": 1, "league_id": 7, "page": 1, "page_size": 10}'
{
"flows": [ ... ],
"total_count": 42,
"page": 1,
"page_size": 10
}

Account Endpoints

Account management endpoints (/v1/account/*) wrap responses with a success field:

{
"success": true,
"api_keys": [ ... ]
}

Error Responses

All error responses across the API use a consistent format:

{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable description of the error"
}
}

Error Codes

HTTP StatusCodeDescription
400BAD_REQUESTInvalid request parameters or body
401UNAUTHORIZEDMissing or invalid authentication
403FORBIDDENValid credentials but access denied (e.g. network policy)
404NOT_FOUNDResource does not exist
409CONFLICTConflicting state (e.g. deactivating last API key)
429RATE_LIMIT_EXCEEDEDRate limit exceeded
500INTERNAL_ERRORUnexpected server error

See Error Handling for detailed guidance.

HTTP Status Codes

StatusMeaning
200 OKSuccessful request
201 CreatedResource created (e.g. new API key or secret)
400 Bad RequestValidation error
401 UnauthorizedAuthentication failure
403 ForbiddenAuthorization failure
404 Not FoundResource not found
409 ConflictState conflict
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorServer error

Common Headers

Request Headers

HeaderRequiredDescription
X-API-KeyConditionalAPI key authentication
AuthorizationConditionalBearer token authentication (Bearer <token>)
Content-TypeFor POSTMust be application/json for JSON request bodies
X-LanguageNoLocale code for localized responses

Response Headers

HeaderDescription
Content-TypeAlways application/json
X-Request-IdUnique request identifier for debugging
X-RateLimit-LimitYour rate limit ceiling
X-RateLimit-RemainingRemaining requests in the current window
X-RateLimit-ResetTimestamp when the rate limit window resets