> ## Documentation Index
> Fetch the complete documentation index at: https://oddspapi-v4.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# API Errors & Rate Limits: Codes, Causes and Fixes

> Every OddsPapi v4 error code with its HTTP status, cause and fix, plus per-endpoint rate limits and how to handle 429 responses.

When a request fails, the API returns an HTTP status code and a JSON body that explains what went wrong. A successful request always returns a `2xx` status.

## Error response format

Every error has the same shape:

```json theme={null}
{
  "error": {
    "message": "Invalid sportId parameter.",
    "code": "INVALID_PARAMETER",
    "details": "Invalid sportId: 99. Valid sportId's are: 10, 11, 12"
  }
}
```

| Field | Type | Description |
| - | - | - |
| `message` | string | A short summary of the error. |
| `code` | string | A machine-readable error code. See Error codes below. |
| `details` | string | A longer explanation, usually with a hint on how to fix the request. |

Branch your error handling on `code`. We may reword messages at any time, but codes stay the same.

`RATE_LIMITED` errors carry two extra fields. See [Rate limits](#rate-limits).

## HTTP status codes

| Status | Meaning |
| - | - |
| `400` | Bad Request: a parameter is missing or invalid. |
| `401` | Unauthorized: the API key is missing or invalid. |
| `402` | Payment Required: a payment for a subscription change failed. |
| `403` | Forbidden: your subscription doesn't include what you asked for. |
| `404` | Not Found: the endpoint or resource doesn't exist. |
| `429` | Too Many Requests: either you called an endpoint too fast (`RATE_LIMITED`) or your request quota is used up (`REQUEST_LIMIT_EXCEEDED`). See [Rate limit or quota?](#rate-limit-or-quota) |
| `500` | Internal Server Error: something went wrong on our side. |
| `503` | Service Unavailable: the API is down for maintenance. |

## Error codes

### `MISSING_API_KEY`

**Status:** `401`

The request has no API key.

**Fix:** Add your key as the `apiKey` query parameter, for example `/v4/sports?apiKey=YOUR_API_KEY`.

### `INVALID_API_KEY`

**Status:** `401`

The API key doesn't match any account.

**Fix:** Check that you copied the full key. If you refreshed your key recently, the old one no longer works. Use the new key from your account dashboard.

### `RESTRICTED_ACCESS`

**Status:** `403`

You're authenticated, but your subscription doesn't cover the request. Common causes:

| `message` | Cause |
| - | - |
| `Subscription inactive` | Your subscription has expired or been cancelled. |
| `Restricted sportId. / Restricted sport.` | Your plan doesn't include this sport. |
| `Restricted tournament.` | The tournament belongs to a sport your plan doesn't include. |
| `Restricted bookmaker(s).` | Your plan doesn't include one or more of the requested bookmakers. |
| `No bookmakers available for the user.` | Your plan has no bookmakers. |
| `No sports available for the user.` | Your plan has no sports. |
| `No bookmakers with live access found.` | The fixture is live, and none of your bookmakers include live odds. |
| `Restricted access to player props.` | Your plan doesn't include player props for the requested bookmakers. |
| `Forbidden` | Your IP address has been blocked. |

**Fix:** Check your plan on the account dashboard and upgrade or add the sports and bookmakers you need. If your IP address is blocked and you think that's a mistake, contact support.

With an inactive subscription you can still call `/v4/account`, so you can check your account status.

### `MISSING_PARAMETER`

**Status:** `400`

A required parameter is missing. The `message` names it, for example `Missing fixtureId parameter.`

**Fix:** Add the parameter named in `message`. The `details` field shows an example value.

### `MISSING_PARAMETERS`

**Status:** `400`

The request is missing a required combination of parameters. Refer to the documentation of the given endpoint to correct the sent parameters.

**Fix:** Add the parameters listed as required.

### `INVALID_PARAMETER`

**Status:** `400`

A parameter has a value the API can't accept. Common causes:

* `fixtureId` doesn't start with `id` or `pn`.
* `sportId` isn't a known sport. `details` lists the valid IDs.
* A `tournamentIds` entry isn't an integer.
* A bookmaker slug isn't recognised. Get the valid slugs from `/v4/bookmakers`.
* A `from` or `to` value isn't a valid ISO 8601 timestamp.
* `from` is after `to`.
* The date range is too wide: 10 days at most with only `sportId`, and 2 days at most with no ID filter.
* `statusId` isn't one of `0` (upcoming), `1` (live), `2` (finished) or `3` (cancelled).
* `verbosity` isn't an integer from 1 to 3.
* `language` isn't a supported language code. Get the valid codes from `/v4/languages`.
* `/v4/odds-by-tournaments` got more than one bookmaker.
* `/v4/odds-by-tournaments` got more than 5 tournament IDs, or more than 3 for an exchange bookmaker.
* `/v4/historical-odds` got an exchange bookmaker without exactly one bookmaker and one `outcomeId`.
* An outcome ID or player ID isn't a number.
* `/v4/change-email` got an email that is badly formatted or already in use.

**Fix:** Read `details`, which says which value is wrong and what's allowed.

### `MISSING_LANGUAGE`

**Status:** `400`

The endpoint needs a language, but you didn't send `language` and your account has no default language.

**Fix:** Add `language` (for example `language=en`), or set a default language on your account.

### `TOO_MANY_BOOKMAKERS`

**Status:** `400`

You asked `/v4/historical-odds` for more than 3 bookmakers.

**Fix:** Send 3 bookmakers or fewer, and split larger requests into several calls.

### `FIXTURE_NOT_FOUND`

**Status:** `404`

No fixture matches the `fixtureId` you sent, or no fixtures match your filters.

**Fix:** Check the fixture ID. Fixture IDs start with `id` or `pn`, for example `id1200255561449509`. If you used filters, try widening them.

### `NOT_FOUND`

**Status:** `404`

The endpoint doesn't exist, or the resource has no data yet. Common causes:

* The URL path is wrong. Check the spelling and the `/v4` prefix.
* No tournaments, participants or players exist for that `sportId`.
* The fixture has no scores or settlements yet. Try again later.
* No historical odds match your filters.

### `REQUEST_LIMIT_EXCEEDED`

**Status:** `429`

You've used all the requests in your plan for the current period. `details` shows your limit, for example `You have exceeded your request limit of 100,000 requests.`

**Fix:** Waiting a few seconds and retrying does not help. Wait for your quota to reset (the free plan resets at 00:00 UTC on the 1st of each month, a paid plan at its renewal), or upgrade your plan, which applies immediately. You can still call `/v4/account` to check your usage.

This is not the same as `RATE_LIMITED`, which also returns `429`. See [Rate limit or quota?](#rate-limit-or-quota)

### `RATE_LIMITED`

**Status:** `429`

You called the same endpoint again too soon. Your quota is fine: this is the per-endpoint rate limit. See [Rate limits](#rate-limits).

**Fix:** Wait for the time given in `retryMs`, then retry.

### `PAYMENT_ERROR`

**Status:** `402`

A payment for a subscription change didn't go through.

**Fix:** Check your payment method in the billing portal and try again.

### `MAINTENANCE`

**Status:** `503`

The API is down for planned maintenance. `details` may say when it's expected back.

**Fix:** Retry later with a backoff.

### `INTERNAL_ERROR`

**Status:** `500`

Something went wrong on our side. Your request may have been valid.

**Fix:** Retry after a short wait. If the error keeps happening, contact support with the time of the request and the endpoint you called.

## Rate limits

Each endpoint has a rate limit: a minimum wait between two calls from the same API key. It is also shown at the top of each endpoint page.

| Endpoint | Rate limit (minimum wait between two calls) |
| - | - |
| `/v4/odds`, `/v4/fixture` | 0.5 seconds |
| `/v4/odds-by-tournaments`, `/v4/scores`, `/v4/account`, `/v4/sports`, `/v4/tournaments`, `/v4/bookmakers`, `/v4/markets`, `/v4/participants`, `/v4/languages` | 1 second |
| `/v4/fixtures`, `/v4/settlements` | 2 seconds |
| `/v4/historical-odds`, `/v4/players` | 5 seconds |

How the rate limit works:

* It is **per API key and per endpoint**, not per IP address. Every server that uses your key shares it.
* Each endpoint has its own limit, so calling `/v4/odds` doesn't slow down `/v4/fixtures`.
* Parallel calls to the same endpoint land in the same window, so only the first is served and the rest get `429`. Send calls to one endpoint one after another.
* It is the same on every self-serve plan. A bigger plan raises your request quota, not the rate limit.
* There is no `Retry-After` or `X-RateLimit-*` header. The wait time is in the response body.

A `RATE_LIMITED` response tells you how long to wait:

```json theme={null}
{
  "error": {
    "message": "You are being rate limited. Please wait before making more requests to this endpoint.",
    "code": "RATE_LIMITED",
    "details": "Please wait 0.42 seconds before making another request to /v4/odds.",
    "retryAfter": "0.42 seconds",
    "retryMs": 420
  }
}
```

| Field | Type | Description |
| - | - | - |
| `retryAfter` | string | The wait time as readable text. |
| `retryMs` | integer | The wait time in milliseconds. Use this in code. |

### Rate limit or quota?

The API has two separate limits, and both come back as HTTP `429`. Check `error.code` to tell them apart:

| | `RATE_LIMITED` | `REQUEST_LIMIT_EXCEEDED` |
| - | - | - |
| Which limit | The rate limit of one endpoint | The request quota of your plan |
| What it means | You called the same endpoint again too soon | You used all requests of the current period |
| Scope | One endpoint. Other endpoints still work | Every endpoint except `/v4/account` |
| How long it lasts | Up to a few seconds. `retryMs` has the exact time | Until the quota resets or you upgrade |
| What to do | Wait `retryMs` milliseconds, then retry | Stop retrying. Check `/v4/account`, then wait or upgrade |

> [!WARNING]
>
> A call rejected with `RATE_LIMITED` still uses one request of your quota. Retrying in a tight loop spends requests without returning data, so always wait `retryMs` first.

More on the quota is on the [requests and quota](https://oddspapi-v4.mintlify.site/docs/requests-and-quota.md) page.

> [!NOTE]
>
> `/v4/account` doesn't count against your quota. `/v4/historical-odds` doesn't count against your quota either, but you can't call it once the quota is used up.

## Handling errors

* Branch on `error.code`, not on the HTTP status alone. Several codes share a status.
* Don't retry `400`, `401`, `403` or `404` errors unchanged. Fix the request first.
* Retry `429 RATE_LIMITED` after `retryMs`.
* Retry `500` and `503` with exponential backoff.
* Log the full `error` object. Its `details` field usually says exactly what to fix.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.