guides

Odds API for arbitrage in Python: the math and the code

By · Published · Updated · 7 min read

An arbitrage betting API gives you prices from many books in one format, so you can check whether the best price on each side of a market adds up to less than 100%. PricedOdds does that check server-side in GET /v1/arbs, with a real response below. The check itself is one sum: take the best decimal price for each side across your books, add up 1 / price, and see if the total is under 1. This guide shows that check in Python against 16 books in one JSON format.

A sum under 1 is a price discrepancy between books at one moment. It is a calculation, not a result: prices move, books limit stakes, and rules differ. The last section covers those limits.

What is the arbitrage formula?

For a two-way market, such as an NBA moneyline, take the best price on each side from any book.

SideBest bookAmericanDecimalImplied (1 / decimal)
HomeBook A+1052.050.4878
AwayBook B+1022.020.4950
Sum0.9828

The numbers in this table are a made-up example to show the arithmetic. They are not prices from any book.

The sum is 0.9828. The margin is 1 minus the sum: 0.0172, or 1.72%. If the sum is 1 or more, there is no discrepancy. For a three-way soccer market (moneyline_3way), add the draw as a third term.

Which books can I compare?

The coverage file generated on November 28, 2026, 17:22 UTC lists 16 books of 7 types. A wider mix of types gives more price differences to check, and all 16 carry moneyline.

TypeBooks
SportsbookDraftKings, FanDuel, BetMGM, Fanatics Sportsbook, Caesars Sportsbook, bet365, Hard Rock Bet, BetRivers
Sharp bookCirca Sports
Social bookFliff
ExchangeNovig, ProphetX
Prediction marketKalshi, Polymarket
Offshore referenceBetOnline
Sharp referencePinnacle

Source: coverage.json, generated 2026-11-28 17:22 UTC. BetOnline is not licensed in US states and appears as a price reference only. Pinnacle is an add-on on Solo, Starter and Growth and is included in All-Access.

Your plan sets how many of these you can query: 2 on Solo, 5 on Starter, 10 on Growth and all of them on All-Access. With 2 books you compare one pair. With 10 you compare 45 pairs in the same call.

Step 1: pull one event with every book you picked

You need a key for this step. Start the trial at /signup, put the key in PRICEDODDS_API_KEY and choose your books with POST /v1/account/books.

import os
import requests

BASE = "https://api.pricedodds.com/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['PRICEDODDS_API_KEY']}"}

events = requests.get(f"{BASE}/events", headers=HEADERS,
                      params={"league": "nba"}, timeout=10).json()["data"]
event_id = events[0]["id"]

odds = requests.get(f"{BASE}/events/{event_id}/odds", headers=HEADERS,
                    params={"markets": "moneyline"}, timeout=10).json()["data"]

The response lists each market, each side, and one price per book. Every price has decimal, american, implied, updatedAt (last time the source confirmed the price) and changedAt (last time it changed).

Step 2: run the check

Each selection already carries best, the highest price across your books. The check is the sum of 1 / best decimal over the sides of one market.

def check_market(market):
    legs = []
    for sel in market["selections"]:
        best = sel["best"]
        legs.append((sel["side"], best["book"], best["decimal"]))

    total = sum(1 / dec for _, _, dec in legs)
    return legs, total

for market in odds["markets"]:
    legs, total = check_market(market)
    margin = 1 - total
    flag = "GAP" if total < 1 else "no gap"
    print(market["market"], market["period"], f"sum={total:.4f}", f"margin={margin:+.2%}", flag)
    for side, book, dec in legs:
        print("  ", side, book, dec)

Two rules keep the check honest:

  • Same line on both sides. For spread and total, only compare selections with the same line. Home -4.5 against away +5.5 is a different bet, not a gap.
  • Same period. A full-game total and a first-half total are different markets. Group by market and period.

Step 3: split a stake across the sides

If you want the same return whichever side wins, each side gets a share of the stake in proportion to 1 / decimal.

def split_stake(legs, stake=100.0):
    total = sum(1 / dec for _, _, dec in legs)
    return [(side, book, round(stake * (1 / dec) / total, 2)) for side, book, dec in legs]

With the example table and a $100 stake, the split is $49.63 on home and $50.37 on away. Either side returns about $101.75. That figure assumes both prices are still available at those stakes, which the API cannot tell you.

Is there an endpoint that does this for me?

Yes. GET /v1/arbs returns cross-book discrepancies where the sum of implied probabilities is under 100%. It takes league, sport, books, markets, status (live or scheduled), min_margin (default 0) and max_margin (default 0.10). A discrepancy above max_margin is hidden as a probable pricing error and counted in filters.above_max_margin. The parameters are in the docs.

curl -s "https://api.pricedodds.com/v1/arbs?league=nba&min_margin=0.005" \
  -H "Authorization: Bearer $PRICEDODDS_API_KEY"

We ran that call on November 24, 2026 at 19:46 UTC with an All-Access key. It returned 50 rows, and filters showed 4 more hidden above max_margin. This is the first row, trimmed to one leg per side:

{
  "asOf": "2026-11-24T19:46:41.825Z",
  "filters": { "min_margin": 0.005, "max_margin": 0.1, "above_max_margin": 4 },
  "data": [
    {
      "matchup": "Boston Celtics @ Washington Wizards",
      "startsAt": "2026-11-25T01:00:00.000Z",
      "status": "scheduled",
      "market": "player_pra",
      "period": "game",
      "player": { "name": "AJ Dybantsa" },
      "margin": 0.0669,
      "legs": [
        { "side": "over", "line": 26.5, "book": "novig", "decimal": 2.35, "american": 135, "stake_share": 0.456, "updatedAt": "2026-11-24T19:46:39.115Z" },
        { "side": "under", "line": 26.5, "book": "betrivers", "decimal": 1.97, "american": -103, "stake_share": 0.544, "updatedAt": "2026-11-24T19:29:42.549Z" }
      ]
    }
  ]
}

The margin checks by hand: 1 / 2.35 + 1 / 1.97 = 0.9331, and 1 minus 0.9331 is 0.0669. stake_share is the split from Step 3. The two updatedAt values are 17 minutes apart: the BetRivers price had not been confirmed since 19:29 UTC, which is the stale-price case in the limits below. To try other prices by hand, use the arbitrage calculator. The same call with its response is in the docs examples.

Two related endpoints use the same book selection:

EndpointWhat it returns
GET /v1/bestBest price per selection across your books
GET /v1/fairNo-vig fair price and each book's margin for one event
GET /v1/evPre-match prices above the fair price, with min_ev (default 0.02). Since November 23, 2026 the fair price needs 2 or more books (min_sources, default 2) and rows above +15% are dropped (max_ev, default 0.15)
GET /v1/arbsCross-book discrepancies, with min_margin and max_margin (default 0.10)

AI agents get the same check through the MCP tool find_arbitrage. The full parameter list is in the docs.

How often should I check?

Gaps between books close when one of them moves its price. Polling on a timer means you look at whatever the price was at your last request.

  • REST polling: your plan's rate limit sets the pace. Solo allows 1 request per second, Starter 3, Growth 5 and All-Access 10.
  • Delta polling: GET /v1/changes returns only what changed since your last call.
  • WebSocket: wss://api.pricedodds.com/v1/stream sends a snapshot when you subscribe, then each price change. Rerun the check for a market when one of its prices changes.

Use the two timestamps on each price. updatedAt is the last time the source confirmed the price, so an old value means the price may be gone. changedAt is the last time the price moved.

When is an arbitrage check not enough?

The sum tells you about two published prices. It does not tell you that you can bet them.

  • Stale prices. A gap often means one book has not moved yet. It may correct before you act.
  • Limits. Books cap stakes and can restrict accounts. The API has no stake limits in its data.
  • Different rules. Books settle some markets differently, for example overtime, voids or player props when a player does not start. Read both books' rules before you treat two selections as opposites.
  • Exchanges and prediction markets. Novig, ProphetX, Kalshi and Polymarket charge fees or commissions that the price does not include. Kalshi and Polymarket prices are event contracts converted to decimal odds.
  • Availability. Not every book is legal in every state. BetOnline is a price reference only.
  • Live games. All 16 books are listed with live prices in the coverage file generated on November 28, 2026, 17:22 UTC. That changes with the schedule, so read GET /v1/coverage before a live check.
  • You do not want to build anything. Pinnacle Terminal is an app with Pinnacle dropping odds and Telegram alerts.

PricedOdds is a data API, not a sportsbook. The data is informational, nothing here is betting advice, and the Terms prohibit using the data to accept or price wagers.

What does it cost?

PlanPrice per monthBooksRequest rateWebSocket
Solo$39Any 21 req/s+$59
Starter$99Any 53 req/s+$129
Growth$179Any 105 req/s+$169
All-Access$349All 15 + Pinnacle10 req/sIncluded

The number of books is what changes the check: 2 books give one pair to compare, 10 give 45. Every plan starts with a 3-day free trial. The $1 card verification is refunded immediately. The plan you pick is charged from day 4 unless you cancel before the trial ends. See pricing or start the trial.

For one league in detail, see NBA odds from every book. To split one stake across several outcomes for the same return, see the dutching calculator. Each extra book adds prices to check, such as Circa Sports lines as JSON. The same loop runs on Fliff odds through the API.