Skip to main content

Polling intervals

Odds update every 5–30 seconds depending on the bookmaker and sport. There’s no benefit to polling faster than your use case requires — you’ll burn rate limit quota and get the same data. Use the WebSocket for live in-play events — it’s push-based and eliminates unnecessary requests entirely.

Filter server-side, not client-side

Always pass filters as query parameters rather than fetching everything and filtering locally. The difference in response size is significant:
Use competition codes (EPL, NBA) over sport names (Football, Basketball) when you know the league — they’re more precise. One sport can have 60+ competition codes, so filtering by sport can still return hundreds of events.

Use slugs, not match names

Match names can contain accented characters and spaces. Always use the URL-encoded slug field from GET /api/events:

Per-event drilldown pattern

For automated value detection when you need full market depth:
Use GET /api/value-bets instead if you just want pre-calculated EV opportunities — it applies all quality filters (TRJ, staleness, odds ratio) and is faster than building your own detection. The per-event drilldown pattern is useful when you want full control over the EV math or need markets that /api/value-bets doesn’t cover.

Understanding EV%

ev_pct in /api/value-bets measures your expected edge over fair value. In plain English:
A +5% EV bet means that if you placed this bet 1,000 times in identical conditions, you’d expect to profit around 5per5 per 100 wagered — long run.
The math:
Example:

Understanding payout_rate (TRJ)

payout_rate is Pinnacle’s Total Return on Juice — the sum of implied probabilities across all outcomes:
A sharp, reliable Pinnacle line has payout_rate between 1.00 and 1.03:
  • 1.018 → 1.8% margin — normal for football moneylines
  • 1.005 → 0.5% margin — very sharp (high-liquidity game)
  • > 1.05 → margin >5% — unreliable reference, filtered out by /api/value-bets

Data freshness

  • scraped_at fields are UTC ISO-8601 timestamps
  • /api/value-bets returns only bets detected in the last 30 minutes with odds scraped in the last 15 minutes
  • /api/odds uses a 10-minute default freshness window (stale_minutes=10)
Always check how old the data is before acting on it:
Always verify the current price on the bookmaker’s site before placing a bet. Odds can move significantly between detection and placement — especially on player props and live markets.

Error handling and retries

Handle the three common failure modes:

Monitor rate limits

Check X-RateLimit-Remaining on every response to avoid hard 429 errors:

Never expose your key

  • Make all API calls from your server, never from browser JavaScript
  • Never commit keys to git — add .env to .gitignore
  • Rotate immediately if a key is accidentally exposed
  • Use environment variables in all environments (local, staging, production)