Skip to main content

Performance Optimization

1. Use Batch Endpoints

Always use the multi-odds endpoint when fetching odds for multiple events: Bad:
Good:

2. Implement Caching

Cache responses based on data type and freshness requirements:
Recommended Cache TTLs:

3. Select Bookmakers Wisely

Don’t fetch odds from all 265+ bookmakers:

4. Filter Events by Bookmaker

When you only care about events available at specific bookmakers, use the bookmaker parameter on the events endpoint. This returns only events that have odds from that bookmaker:
This is much more efficient than fetching all events and then filtering client-side. It reduces response size and ensures you only process relevant events.

Rate Limit Management

1. Implement Rate Limiting

Track and respect API rate limits:

2. Handle 429 Responses

Implement exponential backoff for rate limit errors:

3. Monitor Usage

Track your API usage to avoid hitting limits:

Error Handling

1. Graceful Degradation

Handle missing data gracefully:

2. Validate Responses

Always validate API responses:

3. Timeout Handling

Set timeouts for API requests:

Security Best Practices

1. Secure API Keys

Never expose API keys in client-side code!

2. Validate Input

Always validate user input before using it in API calls:

Data Management

1. Database Schema

Store odds data efficiently:

2. Store Historical Data

Keep historical odds for analysis:

3. Cleanup Old Data

Regularly clean up stale data:

Monitoring & Logging

1. Log Important Events

2. Set Up Alerts

Monitor critical metrics:

Testing

1. Unit Tests

2. Integration Tests

Summary Checklist

  • ✅ Use batch endpoints when possible
  • ✅ Implement appropriate caching
  • ✅ Select relevant bookmakers only
  • ✅ Minimize unnecessary API calls
  • ✅ Implement rate limiting logic
  • ✅ Handle 429 responses with backoff
  • ✅ Monitor and track usage
  • ✅ Use multi-endpoints efficiently
  • ✅ Validate all responses
  • ✅ Handle missing data gracefully
  • ✅ Implement request timeouts
  • ✅ Log errors properly
  • ✅ Never expose API keys client-side
  • ✅ Use environment variables
  • ✅ Validate all user input
  • ✅ Implement server-side proxy
  • ✅ Design efficient database schema
  • ✅ Store historical data when needed
  • ✅ Clean up old data regularly
  • ✅ Index time-series queries