DEV Community

Cover image for Odds Normalization Explained: How a Sports Odds API Turns Bookmaker Chaos Into One Schema
orbistats
orbistats

Posted on

Odds Normalization Explained: How a Sports Odds API Turns Bookmaker Chaos Into One Schema

Odds Normalization Explained: How a Sports Odds API Turns Bookmaker Chaos Into One Schema

Pull odds from three bookmakers and you will get three different answers to a simple question: what is the price on the home team? One feed calls the market “Match Winner”, another calls it “Full Time Result”, a third calls it “1X2”. One returns decimal odds, one returns fractions, one returns American odds. Team names are spelled differently, markets get suspended without warning, and no two feeds agree on what a “live” price means.

Odds normalization is the work of turning all of that into one consistent structure, so that a price from one book can be compared, averaged, stored and displayed next to a price from another. It is also the difference between a product that ships in weeks and one that spends months maintaining parsers.

This guide explains what normalization actually involves, walks through the maths every odds developer needs (formats, implied probability and the bookmaker margin), and shows working code. The examples use the Orbistats Odds API, which delivers pre-match and live odds in one schema across 13 sports.

Why Raw Bookmaker Odds Are Hard to Use

Each bookmaker built its feed for its own platform, not for yours. If you integrate directly, you inherit every one of those decisions. In practice, the same match can differ across feeds in at least four ways:

What differs Typical raw-feed variation What a normalized feed gives you
Market names “Match Winner”, “Full Time Result”, “1X2” One market name per market type
Outcome structure Arrays, nested objects, home/away vs team IDs One outcome structure (home, draw, away)
Odds format Decimal, fractional, American One default format, with conversions available
Entity naming Different spellings and abbreviations for teams Consistent team and match identifiers

Normalization maps all of this into a single schema once, centrally. According to the Odds API page, Orbistats pulls odds from major sportsbooks and maps them into one set of market names, one outcome structure and one odds format, so you integrate once instead of writing a parser per book.

Odds Formats You Need to Understand

Even with a normalized feed, you will convert formats, because your users may expect fractions in the UK or American odds in the US. Orbistats returns decimal odds by default, with fractional and American formats available.

The formulas:

Decimal → implied probability: 1 / decimal
Decimal → fractional: decimal − 1 expressed as a fraction
Decimal → American: if decimal ≥ 2, (decimal − 1) × 100; otherwise −100 / (decimal − 1)
Decimal Fractional American Implied probability
1.50 1/2 −200 66.67%
1.91 10/11 −110 52.36%
2.50 3/2 +150 40.00%
3.40 12/5 +240 29.41%
4.20 16/5 +320 23.81%

If you just need a quick conversion while testing, the Orbistats odds converters and calculators and the glossary (implied probability and other terms) cover the basics.

Implied Probability and the Bookmaker Margin

Decimal odds are a price, but they are also a probability estimate. A price of 2.00 implies a 50% chance, because 1 / 2.00 = 0.50.

Here is the catch. Add up the implied probabilities of every outcome in a market, and you will get more than 100%. The excess is the bookmaker’s margin (also called the overround or vig). It is how the bookmaker earns a living, and it is why you cannot treat raw implied probabilities as true probabilities.

Worked example. The Odds API page shows a sample response for a Manchester City vs Arsenal 1X2 market. Using those sample prices:

Outcome Decimal odds Implied probability
Home 1.91 52.36%
Draw 3.40 29.41%
Away 4.20 23.81%
Total 105.58%

The market adds up to 105.58%, so the overround is 5.58%. To estimate fair probabilities, divide each implied probability by the total. This is the simplest method, called proportional (or multiplicative) margin removal:

Outcome Fair probability
Home 49.59%
Draw 27.86%
Away 22.55%
Total 100.00%

More sophisticated methods exist, including the power method and Shin’s method, which treat favourites and longshots differently. For a comparison, see Erik Štrumbelj’s paper On determining probability forecasts from betting odds (International Journal of Forecasting, 2014). The proportional method is a sensible default for dashboards and quick comparisons.

Code: Fetch Normalized Odds and Strip the Margin

Node.js: fetch the current odds for a match and compute the margin. This uses the documented endpoint GET /v1/football/odds?match_id=... with a Bearer key.

javascript
const BASE = "https://api.orbistats.com/v1";

async function getOdds(matchId) {
const res = await fetch(${BASE}/football/odds?match_id=${encodeURIComponent(matchId)}, {
headers: { Authorization: Bearer ${process.env.ORBISTATS_API_KEY} },
signal: AbortSignal.timeout(10_000),
});
if (!res.ok) throw new Error(Odds request failed: HTTP ${res.status});
const body = await res.json();
const payload = body.data ?? body; // tolerate an envelope or a flat object
return Array.isArray(payload) ? payload[0] : payload; // confirm the exact shape in the sandbox
}

function analyse(o) {
if (o.format !== "decimal") throw new Error(Expected decimal odds, got ${o.format});
const implied = Object.entries(o.odds).map(([outcome, d]) => [outcome, 1 / d]);
const total = implied.reduce((sum, [, p]) => sum + p, 0);
return {
market: o.market,
status: o.status, // e.g. pre_match
updatedAt: o.updated_at,
overround: total - 1, // 0.0558 means a 5.58% margin
fair: Object.fromEntries(implied.map(([k, p]) => [k, p / total])),
};
}

getOdds(48213).then((o) => console.log(analyse(o))).catch(console.error);

How it works. The function reads the odds object (home, draw, away), converts each price to an implied probability, sums them to get the overround, then divides each probability by the total to get fair probabilities. It works for two-way markets too, because it iterates over whatever outcomes are present. It refuses non-decimal data instead of silently producing wrong numbers.

Security note: keep the API key on your server and never call the API directly from browser code.

Python: odds format conversions and margin removal. These are pure maths helpers you can use with any odds source.

python
from fractions import Fraction

def decimal_to_american(d: float) -> int:
return round((d - 1) * 100) if d >= 2 else round(-100 / (d - 1))

def american_to_decimal(a: int) -> float:
return 1 + (a / 100 if a > 0 else 100 / abs(a))

def decimal_to_fraction(d: float, max_denominator: int = 100) -> Fraction:
return Fraction(d - 1).limit_denominator(max_denominator)

def remove_margin(decimals: dict[str, float]) -> tuple[float, dict[str, float]]:
implied = {k: 1 / d for k, d in decimals.items()}
total = sum(implied.values())
return total - 1, {k: p / total for k, p in implied.items()}

overround, fair = remove_margin({"home": 1.91, "draw": 3.40, "away": 4.20})
print(f"overround {overround:.2%}") # overround 5.58%
print({k: f"{v:.2%}" for k, v in fair.items()}) # home 49.59%, draw 27.86%, away 22.55%
print(decimal_to_american(1.91), decimal_to_fraction(1.91)) # -110 10/11
Markets You Can Expect

The Odds API page lists five market families. Availability varies by sport and league, with major competitions carrying the full set.

Market Also known as Typical use
1X2 Moneyline (two-way in sports without draws) Outright result pricing
Spreads Handicap Point or goal handicaps
Totals Over/Under Combined score above or below a line
Player props Player specials Individual player performance markets
Futures Outrights Season or tournament winners
Line Movement and Closing Line Value

A price is not a fixed fact. It moves from the opening line through pre-match drift and live in-play changes to the closing line. Tracking that movement is useful in three ways:

Pricing teams see where the market is heading and how fast.
Analysts judge whether a model’s prices beat the closing line, a measure often called closing line value (CLV).
Product teams show users how an odd has changed, which builds trust in an odds comparison page.

The Odds API page states that opening lines, closing lines and full movement history are tracked, and that multi-season history is available through the Historical Sports Data API using the same schema. That shared schema matters: you can build a model on history and run it on live data without rewriting your parsing.

How to Get Odds: REST, WebSocket and History

The Odds API page describes three delivery routes for the same schema:

Method Best for Typical latency (per the page)
REST query Displaying current odds, scheduled jobs Seconds
WebSocket Trading desks, pricing engines, live UI Under 1 second
Historical query Backtesting pricing models Archival

REST is the right start for most products. Add the WebSocket API when users watch prices move and seconds matter, and use webhooks when your backend should react to an odds move without polling. For help choosing, read our guide to the sports data API and the developer documentation.

Who Benefits Most From Normalized Odds
Sportsbooks and trading teams use a consensus view of the market for pricing and risk instead of depending on one book. See Sportsbooks & Trading and Trading Desks.
Media and publishers can power an odds comparison board without building the plumbing. The widgets offer a drop-in odds board.
Analytics and data science teams backtest on closing lines and movement history. See Analytics & Data Science.
Fantasy and betting-tool developers convert formats, show implied probabilities and flag margins for their users.
Building an Odds Comparison Feature: A Practical Checklist
Pick one internal format. Store decimal odds and convert only for display.
Store the context with every price: market, status (pre-match or live), bookmaker field and updated_at.
Compute margin per market, not per bookmaker, and show fair probabilities alongside prices if your audience values them.
Never mix pre-match and live lines in the same comparison.
Show freshness. Display when a price was last updated and hide stale prices.
Cache sensibly. Live odds need short caching; closing lines and history can be cached much longer.
Common Pitfalls and How to Fix Them
Symptom Likely cause Fix
Implied probabilities add up to more than 100% Bookmaker margin (overround) Divide each probability by the total to get fair probabilities
Prices look wrong next to another source Different odds formats compared directly Convert everything to decimal first
A market is missing for a league Market depth varies by sport and league Handle empty markets gracefully; check coverage before promising a market
Odds on screen look stale Cached or paused feed Check updated_at and status; refresh over REST or move to streaming
Pre-match and live prices get mixed up status ignored Filter and label by status
Totals drift in tests Floating-point rounding Round only for display, never in the calculation
Odds Across 13 Sports

Orbistats covers 13 sports: Football, Basketball, American Football, Cricket, Tennis, Baseball, Esports, Combat Sports, Volleyball, Handball, Ice Hockey, Golf and Horse Racing. The schema is the same for all of them, but market depth varies by sport and league. A two-way sport such as tennis has no draw outcome, and your margin code should simply work on whatever outcomes the market contains, as the examples above do. Check the API Reference for the sport you plan to launch with.

Getting Started

Orbistats offers a free self-serve API key with no card required, and a sandbox where you can test requests before choosing a plan. Compare plans on the pricing page, and confirm the markets and limits your plan includes before you design around them.

Key Takeaways
Normalization replaces a parser per bookmaker with one schema for markets, outcomes and odds format.
Store decimal odds internally and convert to fractional or American only for display.
Raw implied probabilities total more than 100%. The excess is the bookmaker margin.
Dividing by the total gives simple fair probabilities, and more advanced methods exist for sharper work.
Line movement from open to close is valuable for pricing, analytics and user-facing products.
Use REST first, add WebSocket when seconds matter and historical queries for backtesting, all in the same schema.
Market availability varies by sport and league, so check coverage before you promise a market.
Frequently Asked Questions

  1. What is odds normalization?
    It is the process of mapping odds from different bookmakers into one consistent structure, with the same market names, outcome fields and odds format, so prices can be compared and combined without custom parsing per source.

  2. What is the difference between decimal, fractional and American odds?
    They are three ways of writing the same price. Decimal (2.50) shows total return per unit staked, fractional (3/2) shows profit relative to stake, and American (+150) shows profit on a 100 stake for positive numbers or the stake needed to win 100 for negative numbers.

  3. How do I convert odds to implied probability?
    For decimal odds, divide 1 by the odds. A price of 4.00 implies a 25% probability.

  4. What is the bookmaker margin or overround?
    It is the amount by which the implied probabilities of all outcomes in a market exceed 100%. A total of 105.58% means a 5.58% margin.

  5. How do I remove the margin from odds?
    The simplest method is proportional: divide each outcome’s implied probability by the sum of all of them. Power and Shin’s methods are more advanced alternatives.

  6. Does the Orbistats Odds API provide live and historical odds?
    Per the Odds API page, it provides pre-match and live odds, line movement, and multi-season history through the Historical Sports Data API in the same schema.

  7. Which odds formats does the API return?
    Decimal by default, with fractional and American formats available.

  8. How fast are live odds?
    The Odds API page lists typical latency as seconds over REST and under one second over WebSocket.

  9. Do all sports have the same markets?
    No. The schema is consistent, but market depth varies by sport and league, and major competitions carry the full set.

Conclusion

Odds look simple until you have to combine them. Different names, formats and structures turn every new bookmaker into a new parser, and raw prices hide a margin that distorts any probability you derive from them. Normalization solves the first problem, and a few lines of maths solve the second.

Start with one match, convert it to decimal, remove the margin, and compare. When that works, add line movement, streaming and history.

Ready to build? Start free and get an API key, try requests in the sandbox, read the Odds API documentation or compare API plans.

INTERNAL LINKS USED (all from the live site)
URL Anchor in the article
/api/odds-api.html Orbistats Odds API
/api/historical-sports-data-api.html Historical Sports Data API
/api/websocket-api.html WebSocket API
/api/webhooks-api.html webhooks
/api/sports-data-api.html guide to the sports data API
/developers/documentation.html developer documentation
/developers/api-reference.html API Reference
/developers/sandbox.html sandbox
/resources/tools.html odds converters and calculators
/resources/glossary.html glossary
/solutions/sportsbooks.html, /solutions/trading.html, /solutions/analytics.html audience sections
/widgets.html widgets
/pricing.html pricing page
BACKLINK AND PUBLISHING OPPORTUNITIES

These are opportunities only. Approval is never guaranteed, and I have not verified dofollow/nofollow for any of them.

Platform and URL Approach Anchor Destination Type

1 dev.to · dev.to/new Tutorial: “Convert odds and remove the bookmaker margin in Node.js and Python” sports odds API /api/odds-api.html Distribution (canonical to your blog)
2 Hashnode · hashnode.com Architecture angle: designing an odds normalization pipeline odds normalization /api/odds-api.html Distribution
3 Medium · medium.com/new-story (orbistats account) Business angle: why normalized odds save engineering time Orbistats Odds API /api/odds-api.html Distribution
4 GitHub · github.com/new (under github.com/orbistats) Small repo with the conversion and margin-removal helpers, README links to the post odds API documentation /developers/documentation.html Resource (a repo you control)
5 Reddit r/algobetting · reddit.com/r/algobetting Discussion post on margin removal methods; follow the self-promotion rules full guide Blog URL Community
6 LinkedIn Article · linkedin.com Summary for sportsbook and trading engineers odds normalization Blog URL Distribution
7 HackerNoon · app.hackernoon.com/new Submission on “one schema instead of a parser per bookmaker” normalized odds /api/odds-api.html Editorial submission
8 DZone · dzone.com (contributor guidelines) Data-integration article odds data integration Blog URL Editorial guest post
9 Towards Data Science · towardsdatascience.com (contributor guidelines) Implied probability and margin removal for data scientists implied probability /resources/glossary.html Editorial submission
10 Stack Overflow · stackoverflow.com/questions Answer genuine questions on converting odds or removing vig, linking only where it helps and disclosing affiliation odds converter /resources/tools.html Community Q&A
11 Quora · quora.com Answer questions such as “How do I convert decimal odds to probability?” odds converters /resources/tools.html Community Q&A
12 Indie Hackers · indiehackers.com/post Founder story on building a multi-sport odds feed Orbistats /pricing.html Community

Top 5 first: dev.to, Hashnode, Medium, the GitHub repo, r/algobetting. Publish on orbistats.com first and set the canonical URL on every cross-post.

EXTERNAL REFERENCES
Erik Štrumbelj, On determining probability forecasts from betting odds, International Journal of Forecasting (2014). Search the title to find the paper.
Orbistats Odds API, API Reference and Pricing

Top comments (0)