API Key Authentication
Odds-API.io uses API key authentication to secure access to the API. Your API key identifies your account and tracks your usage.Getting Your API Key
- Pick a plan at odds-api.io/pricing. Plans start at £49/month, cancel anytime. New free API keys are paused; existing free keys keep working.
- Check your email for the API key
- Copy and securely store your API key
Using Your API Key
Include your API key as a query parameter in all authenticated requests:Security Best Practices
Use Environment Variables
Store your API key in environment variables instead of hardcoding it:Server-Side Only
Bad Practice:Rotate Keys Regularly
For enhanced security:- Rotate your API keys periodically
- Generate separate keys for development and production
- Immediately revoke compromised keys
Rate Limiting
API requests are rate-limited based on your subscription plan:
Additional Request Packages:
- +10K requests/hour: £139/month ($185)
- +20K requests/hour: £229/month ($299)
- +30K requests/hour: £309/month ($409)
- Custom volumes available on request
Monitoring Rate Limits
The API returns rate limit information in response headers with every request:- x-ratelimit-limit: Total requests allowed in the current window
- x-ratelimit-remaining: Requests remaining in the current window
- x-ratelimit-reset: ISO 8601 timestamp when the rate limit resets
429 Too Many Requests response:
Repeated invalid API keys
After 60 requests with unknown API keys from one IP address within a minute, further requests from that IP get429 Too Many Requests with a Retry-After: 60 header for the rest of that minute. On REST the body is:
429, Retry-After: 60 and that message as plain text.
Check the key in your dashboard and stop retrying a key that returns 401. Keys already in active use keep working, and paused keys do not count towards this limit.
Best Practices for Rate Limiting
- Monitor response headers to track your usage and remaining requests
- Implement exponential backoff when you receive 429 errors
- Cache responses when appropriate to reduce API calls
- Use the multi-odds endpoint to fetch odds for multiple events in a single request
Error Responses
The API uses standard HTTP status codes:
All errors return a JSON response with an error message:
Next Steps
Quickstart
Make your first API call
Best Practices
Learn optimization techniques