Overview
The Unified API Poller polls the Odds API/v3/odds/updated endpoint every 60 seconds to fetch recent odds changes and update MongoDB collections for both team and player bots.
The poller shares a 5000 requests/hour quota with the WebSocket Updater and uses a global rate tracker to coordinate API usage.
Architecture
UnifiedAPIPoller Class
Core Structure
/UnifiedAPIPoller/core/unified_poller.py
Polling Flow
Key Features
1. Rate-Limited Polling
2. Date Filtering
Filter Logic
Filter Logic
Date Range Filter
- 3-minute buffer: Prevents betting on games already starting
- 14-day window: Focuses on relevant upcoming fixtures
3. Batch Processing
Batch Size
10 events per API call
Bookmakers
Bet365, Polymarket, M88, FB Sports, Betfair Exchange, Kambi, Vbet
Batch Fetching
4. Odds Drop Detection
Team Odds Drops
Team Odds Drops
Drop Detection (≥1%)
Market Filtering
Team Markets
- Core Markets
- Team Props
- Cerebro Markets
- ML / Moneyline / 1X2
- Totals / Goals Over/Under
- Spread / Asian Handicap
- Both Teams To Score (BTTS)
- Double Chance
- Draw No Bet
Team Market Filter
Player Markets
Player Market Filtering
Player Market Filtering
Player markets are filtered separately in the Player Odds Manager:See Player Bot Documentation for complete list.
Special Bookmaker Integrations
Overtime Markets
Polling Interval
30 seconds (configurable)
Collections
overtime_odds, overtime_mappingsOvertime Integration
Crypto Bookmakers
- Jackbit
- BetPanda
- Web3 bookmaker
- Soccer, Basketball, Tennis
- Polls every 30s
- Updates
team_odds.bookmakers.Jackbit
OddsChecker Scraper
OddsChecker Config
Document Structure
team_odds Schema
Running the Poller
Manual Start
Systemd Service
Performance & Monitoring
Statistics Tracking
Stats Object
Performance Metrics
| Metric | Value |
|---|---|
| Polling Interval | 60 seconds |
| Batch Size | 10 events/call |
| Processing Time | <5s for 100 fixtures |
| API Calls/Cycle | 2-15 (depends on updates) |
Troubleshooting
Rate limit errors (429)
Rate limit errors (429)
Symptoms:
Too Many Requests errors in logsSolutions:- Check
global_request_trackerusage - Reduce polling frequency
- Disable optional integrations (OddsChecker, crypto bookmakers)
'since' parameter too old
'since' parameter too old
Error:
400 Bad Request - since parameter too oldSolution: API enforces 60s max lookback. Poller auto-retries with suggested timestamp.Missing special bookmakers
Missing special bookmakers
Issue: Overtime/Jackbit odds not appearingFix: Special bookmakers are preserved during updates:
Configuration
Environment Variables
Related Documentation
WebSocket Updater
Real-time odds updates
Team Bot
Team market processing
Player Bot
Player market processing