VALUEODDSAPI / BUYER GUIDES
How should your odds API client handle errors?
Use the stable error code to decide whether to fix a request, check access, wait for Retry-After or retry a temporary failure.
Published by ValueOddsAPI · 27 November 2026
In 30 seconds
- Parse the error body. Stable
error.codeandrequest_idare more useful than guessing from a blank UI. - Fix permanent failures. An invalid parameter or missing entitlement will not be healed by rapid retries.
- Respect 429. Wait for
Retry-Afterand inspect rate-limit headers. - Measure recovery. Test your client with each documented failure category before buying.
What does an API error actually tell the client?
The v2 errors reference defines a JSON error object with stable code, human-readable message, docs_url and request_id. Plan-related errors can add upgrade_url. The example request ID in the documentation is illustrative; this article does not report a real failed customer request.
Save HTTP status, error code, request ID, endpoint, filter set and time in your server logs. Do not log the API key. Show an appropriate product state to users rather than a stale quote presented as fresh. The price-status guide covers availability even when HTTP succeeds.
Which errors should you fix, wait for or retry?
| Case | Contract | Client response |
|---|---|---|
| Invalid query | 400 validation_error | Fix parameter, spelling or signed cursor; do not retry unchanged. |
| Authentication | 401 missing_api_key or invalid_api_key | Check server-side key and account status; never put the key in a URL. |
| Account or product scope | 402 payment_required or 403 forbidden_* | Check /v2/me, product and bookmaker rights; route to account resolution. |
| Rate limit | 429 rate_limited | Wait the response Retry-After; reduce parallel or repeated calls. |
| Temporary failure | 500 internal_error or 503 unavailable | Retry a bounded number of times; narrow slow queries and retain request_id for support. |
Codes and response fields are from the published errors reference. Retry policy and user-facing behavior are client recommendations.
Why is a 403 not evidence that coverage is missing?
The v2 reference distinguishes forbidden_product, forbidden_bookmaker, forbidden_sport, forbidden_live and forbidden_unmapped. A denied request says the key may not access that scope; it does not establish that the underlying event or price is absent. Read GET /v2/me for the actual account and compare it with current plan terms.
For a buying pilot, report denied scope separately from a successful empty response. The entitlements guide explains how to distinguish product, sport and bookmaker access.
How should a client handle a 429?
The rate-limit reference documents X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and a warning header after 80% usage. A 429 rate_limited response includes Retry-After. Pause the affected worker for that interval instead of sending a burst of identical requests. Then retry with a bounded policy and record whether the call completed.
The same 429 category can reflect hourly quota, too many in-flight requests or too many failed key attempts. Therefore record concurrency and request volume alongside the error. The request-budget guide helps size a pilot without assuming a published price or universal throughput.
How do you test the failure path before purchase?
In a controlled test environment, deliberately send a bad filter, omit the key, request a scope the test key lacks and simulate a 429 or temporary 503 in your client. Confirm that the UI distinguishes configuration failure, permission failure and temporary unavailability. Measure time until recovery, number of retries and whether any stale quote was displayed as live. State the test setup and denominator with any result; this article claims no measured recovery time.
Capture a real request_id when discussing an unresolved 500 or 503 with support. Never publish a secret key or personal account payload. For a release gate, add the contract-test checklist to error-path checks, complete list pagination and a fresh snapshot after interruption.
Frequently asked questions
Should every non-200 response be retried?
No. Fix invalid parameters, keys and entitlements first; wait on 429 and bound retries for temporary failures.
What should support receive for a 500 error?
Include the documented request_id, UTC time, endpoint and non-secret filters. Never include the API key.
Does forbidden_bookmaker mean the bookmaker has no data?
No. It means this key cannot request that bookmaker; verify /v2/me and the licence.
Does 429 always mean the hourly quota is exhausted?
No. The docs also list concurrency and repeated failed-key attempts; inspect headers and client logs.
ValueOddsAPI provides odds data, not betting advice. Betting involves risk of loss and is for adults (18+) only. If gambling stops being fun, contact your local support service, such as StopSpillet in Denmark.
Run an error-recovery pilot
Use the v2 error catalogue and OpenAPI contract to map each code to a client action. Check the actual key with /v2/me before judging access or coverage.