Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.fieldfunded.com/llms.txt

Use this file to discover all available pages before exploring further.

Build a Live Esports Odds App with Real-Time Market Data

Get live odds for CS2, League of Legends, Dota 2, Valorant, and 4 more esports titles — all from a single API. This guide shows you how to build a real-time esports odds dashboard with map-level markets, live scores, and automatic settlement.

Why Esports API Data Is Hard to Find

Most sports data APIs treat esports as an afterthought — limited coverage, delayed odds, and zero settlement support. FieldFunded covers 8 esports titles with the same depth as traditional sports: 1,000+ markets per event, sub-second latency, and full automatic settlement including map winner, total maps, handicap, and player-specific props.

Supported Esports Titles

TitleKeyMarketsExample Leagues
Counter-Strike (CS2)counter-strikeMatch Winner, Map Winner, Map Handicap, Total Maps, Round HandicapESL Pro League, BLAST, IEM, Majors
Dota 2dota-2Match Winner, Map Winner, Total Maps, First Blood, HandicapThe International, DPC, ESL One
League of Legendsleague-of-legendsMatch Winner, Map Winner, Total Maps, First Tower, HandicapWorlds, LCK, LEC, LCS, MSI
ValorantvalorantMatch Winner, Map Winner, Total Maps, Map HandicapVCT, Champions, Masters
Rainbow Sixrainbow-sixMatch Winner, Map Winner, Total MapsSix Invitational, Pro League
King of Gloryking-of-gloryMatch Winner, Map WinnerKPL
Call of Dutycall-of-dutyMatch Winner, Map Winner, Total MapsCDL Major, Champs
Mobile Legendsmobile-legendsMatch Winner, Map WinnerMPL, M-Series

What You’ll Use

SDK MethodEndpointPurpose
getEvents()GET /v1/eventsList upcoming esports matches
getLive()GET /v1/liveGet live esports events
getEventOdds()GET /v1/events/{id}/oddsGet odds with all markets
getScores()GET /v1/scoresLive scores and map scores
checkBets()POST /v1/bets/checkSettle bets automatically

Step 1: Fetch Live Esports Events

Filter by sport key to get only esports events:
import { FieldFundedSDK } from '@fieldfunded/sdk';

const ff = new FieldFundedSDK({
  apiKey: process.env.FIELDFUNDED_API_KEY!,
  baseUrl: 'https://api.fieldfunded.com/v1',
});

// Get all live CS2 matches
const cs2Live = await ff.getLive({ sport: 'counter-strike' });

// Get all live LoL matches
const lolLive = await ff.getLive({ sport: 'league-of-legends' });

// Get all live esports (all titles at once)
const allEsports = await ff.getLive();
const esportsSlugs = [
  'counter-strike', 'dota-2', 'league-of-legends', 'valorant',
  'rainbow-six', 'king-of-glory', 'call-of-duty', 'mobile-legends'
];
const esportsOnly = allEsports.events?.filter(
  (e: any) => esportsSlugs.includes(e.sport_key)
) || [];

console.log(`${esportsOnly.length} live esports matches right now`);

Step 2: Get Deep Market Odds

Esports events support the same market depth as traditional sports. A typical CS2 match includes Match Winner, Map Winner (per map), Map Handicap, Total Maps Over/Under, and more:
// Get all odds for a CS2 match
const odds = await ff.getEventOdds(eventId);

// Filter by market type
const mapMarkets = odds.markets?.filter(
  (m: any) => m.name.toLowerCase().includes('map')
) || [];

const matchWinner = odds.markets?.find(
  (m: any) => m.name === 'Winner' || m.name === 'Match Winner'
);

// Display
if (matchWinner) {
  console.log('Match Winner:');
  for (const sel of matchWinner.selections) {
    console.log(`  ${sel.name}: ${sel.odds}`);
  }
}

console.log(`\n${mapMarkets.length} map-level markets available`);
for (const market of mapMarkets.slice(0, 5)) {
  console.log(`  ${market.name}:`);
  for (const sel of market.selections) {
    console.log(`    ${sel.name}: ${sel.odds}`);
  }
}

Step 3: Live Scores with Map Tracking

Esports scores include per-map breakdowns:
// Poll scores every 30 seconds
const scores = await ff.getScores({ sport: 'counter-strike' });

for (const match of scores.scores || []) {
  console.log(`${match.home_team} vs ${match.away_team}`);
  console.log(`  Score: ${match.score.home} - ${match.score.away} (maps)`);

  // Period scores contain per-map round scores
  if (match.score.period_scores) {
    for (const period of match.score.period_scores) {
      console.log(`  Map ${period.period}: ${period.home} - ${period.away}`);
    }
  }
}

Step 4: Settle Esports Bets Automatically

Settlement works identically for esports and traditional sports — markets resolve within seconds after a match ends:
// Check if a bet on "Natus Vincere to win Map 1" settled
const result = await ff.checkBets({
  event_id: eventId,
  market: 'Map 1 Winner',
  selection: 'Natus Vincere',
  stake: 25,
  odds: 1.85,
});

console.log(`Status: ${result.status}`);      // "won" | "lost" | "refund"
console.log(`Payout: $${result.payout}`);      // 46.25 if won
console.log(`Profit: $${result.profit}`);      // 21.25 if won
For multi-map parlays, use the parlay resolution endpoint:
// Parlay: NAVI wins Map 1 + Over 2.5 maps
const parlay = await ff.checkParlay({
  legs: [
    { event_id: eventId, market: 'Map 1 Winner', selection: 'Natus Vincere', odds: 1.85 },
    { event_id: eventId, market: 'Total Maps', selection: 'Over 2.5', odds: 2.10 },
  ],
  stake: 10,
});

console.log(`Combined odds: ${parlay.combined_odds}`);
console.log(`Payout: $${parlay.payout}`);

Rate Limit Math

On the free tier (10,000 req/month, 2 req/s):
  • Polling live esports events every 30s = 2,880 req/day (1 sport)
  • Polling 3 esports titles every 60s = 4,320 req/day
  • On-demand odds checks = ~1-2 req per user action
For a dashboard tracking CS2 + LoL + Valorant with 60s polling: ~4,300 req/day = ~130,000 req/monthStarter plan ($29/mo) covers this comfortably.

Architecture for Production

┌──────────────┐     ┌──────────────┐     ┌──────────────┐
│  Frontend    │────▶│  Your Server │────▶│ FieldFunded  │
│  (React/Vue) │◀────│  (Node.js)   │◀────│  API         │
└──────────────┘     └──────┬───────┘     └──────────────┘

                     ┌──────▼───────┐
                     │  Cache Layer │
                     │  (Redis/mem) │
                     └──────────────┘
Cache odds for 5-10 seconds to reduce API calls. Live scores can be cached for 15-30 seconds since round scores don’t change sub-second.

Supported Sports List

Full list of all 30+ sports and esports with sport keys →

Market Types Reference

All market types including esports-specific markets →

Get Your Free API Key

Start building in 5 minutes — 10,000 free requests/month, all esports titles included