Skip to main content
How to Build an Esports Betting App with an Odds API
Back to Blog

How to Build an Esports Betting App with an Odds API

James Whitfield

James Whitfield

4 min read

Esports betting is one of the fastest growing verticals in the industry, and the hardest part for most teams is the data layer: live odds across enough bookmakers, fast enough to be useful, for the titles your users actually care about. This guide walks through building an esports betting app on top of a real-time Esports Odds API, from listing matches to settling bets.

1. Pick Your Titles

Start with the titles that drive volume. The big four for betting are CS2, Valorant, League of Legends and Dota 2, followed by Rainbow Six, Rocket League, Mobile Legends and Call of Duty. Odds-API.io covers 15 esports titles with odds from 265+ bookmakers, so you can launch with a few titles and expand without changing your integration.

2. List Upcoming Matches

Every esports event lives under the esports sport slug. List upcoming matches with a single call:

curl "https://api.odds-api.io/v3/events?sport=esports&apiKey=YOUR_KEY"

Each event returns an id, the two competitors (home and away), the league and its status. Store the id, you will use it to fetch odds and to match live updates. By default the response covers the next 14 days; pass an explicit to parameter to widen the window.

3. Fetch Odds Across Bookmakers

Pull odds for an event from the books you want to display or compare:

curl "https://api.odds-api.io/v3/odds?eventId=58231904&bookmakers=Bet365,GG.BET,Thunderpick&apiKey=YOUR_KEY"

For esports you will want more than match winner. Map handicaps, total maps, correct map score, per-map winners, first blood and round handicaps are the bread and butter. See the per-title pages for the exact market list each game supports.

If you plan to compare prices across books for value or arbitrage, the same odds payload feeds that logic. Our Python arbitrage bot tutorial covers the math and the polling loop.

4. Stream Live Scores and Status Over WebSocket

The feature that makes a betting app feel live is real-time scores. Subscribe to the odds, scores and status channels on one WebSocket connection. The markets parameter is required whenever the odds channel is active:

const ws = new WebSocket(
  "wss://api.odds-api.io/v3/ws?apiKey=YOUR_KEY" +
    "&markets=ML&sport=esports&channels=odds,scores,status"
);

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  if (msg.type === "score") updateScoreboard(msg.id, msg.scores);
  if (msg.type === "status") handleStatusChange(msg.id, msg.status);
};

One thing to know: channels is an allowlist, you only receive what you list. Keep odds in there to keep receiving odds. Omitting channels entirely gives you the default odds-only stream.

Scores update in roughly one second, and the status channel tells you the moment a match is added, goes live, settles (with final score) or is cancelled. Those are exactly the events you need to open and close markets in your UI. The WebSocket guide covers filters, reconnects and message formats in detail.

5. Handle Map and Period Data Correctly

Esports scores are reported per map inside the periods object:

  • map1, map2, ... hold the score of each map
  • ft is the full result in maps (2-1 in a best of three)
  • the top-level home and away fields mirror the final map count

Settle per-map markets from the map keys and match winner from ft. Which keys appear depends on the title and the series format, so treat periods as a sparse map rather than a fixed schema.

6. Settle and Store

When a status message with status settled arrives it includes the final score, so you can settle bets immediately. Settled events also stay queryable over REST via /v3/events?sport=esports&status=settled, which is handy for reconciliation jobs and for backfilling anything you missed while disconnected.

6. Backtest with Historical Data

Settled results are only half the story. The /historical/events and /historical/odds endpoints let you pull past events for a league and date range, then fetch the odds those events closed at. That is what you need for backtesting a model or showing users how a line moved before kickoff.

# Past CS2 events for a league and date range
curl "https://api.odds-api.io/v3/historical/events?sport=esports&league=blast-premier&from=2026-06-01T00:00:00Z&to=2026-07-01T00:00:00Z&apiKey=YOUR_API_KEY"

# Odds history for one of those events
curl "https://api.odds-api.io/v3/historical/odds?eventId=EVENT_ID&bookmakers=Bet365,SingBet&apiKey=YOUR_API_KEY"

Both endpoints take the same shapes as their live counterparts, so the parsing code you wrote in section 3 works unchanged.

Ship It

That is the whole loop: list events, fetch odds, stream scores and status, settle. Grab a free key on the Esports Odds API page and start building. The free tier gives you 100 requests per hour with no credit card required.