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
- Sign up for a trial at odds-api.io
- Check your email for the API key
- Copy and securely store your API key
Keep your API key secure! Never share it publicly, commit it to version control, or expose it in client-side code.
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
Never expose your API key in client-side JavaScript code. Always make API calls from your backend server.
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:Plan | Requests per Hour | Additional Packages Available |
---|---|---|
Starter | 5,000 | +10K/20K/30K per hour |
Growth | 5,000 | +10K/20K/30K per hour |
Pro | 5,000 | +10K/20K/30K per hour |
- +10K requests/hour: £139/month
- +20K requests/hour: £229/month
- +30K requests/hour: £309/month
- 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:
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:Status Code | Description |
---|---|
200 | Success |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - API key doesn’t have access |
404 | Not Found - Resource doesn’t exist |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error |