DraftKings vs FanDuel: Line Shopping in Python (Free Odds API)
DraftKings or FanDuel: Which Has the Better Line Right Now?
If you bet in the US, you almost certainly have both apps on your phone. Same game, two prices and they are not the same. We pulled the Full Time Result market for 14 World Cup fixtures from both books and compared every outcome. The result: on 24 of 42 outcomes (57%) DraftKings and FanDuel quoted different odds. The catch? The book with the better price flips depending on the bet. There is no “always use DraftKings” rule and if you are not checking, you are leaving money on the table on more than half your bets.
This guide builds a DraftKings-vs-FanDuel line comparator in Python using a free odds API, then shows you how to extend it past two books to the full 350+ bookmaker market when you are ready to stop limiting yourself to two apps.
The Data: How Often They Actually Differ
Across 14 fixtures and 42 outcomes from one World Cup slate:
| Count | Share | |
|---|---|---|
| DraftKings better | 19 | 45% |
| FanDuel better | 5 | 12% |
| Identical price | 18 | 43% |
DraftKings led this slate, but look at where FanDuel won and you see the point about flipping:
| Fixture | Outcome | DraftKings | FanDuel | Better |
|---|---|---|---|---|
| France vs Iraq | Iraq (away) | 31.0 | 28.0 | DK (+10.7%) |
| Spain vs Saudi Arabia | Draw | 11.0 | 12.0 | FD (+9.1%) |
| Portugal vs Uzbekistan | Uzbekistan (away) | 14.0 | 15.0 | FD (+7.1%) |
| France vs Iraq | France (home) | 1.07 | 1.09 | FD |
| Argentina vs Austria | Argentina (home) | 1.57 | 1.54 | DK |
The biggest gaps land on the longshots that 31.0-vs-28.0 on Iraq is a 10.7% difference in payout for the exact same bet. Over a season, that spread is the difference between a winning and losing year. Picking the better of your two books, every time, is the single easiest edge in betting. It is called line shopping, and it is free.
Build the Comparator in Python
Both DraftKings (draftkings) and FanDuel (fanduel) are in the OddsPapi feed. Four steps: authenticate, find a fixture, pull both books, compare.
Step 1: Authenticate
The API key is a query parameter, not a header. Grab a free key.
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.oddspapi.io/v4"
r = requests.get(f"{BASE_URL}/sports", params={"apiKey": API_KEY})
print(r.status_code) # 200
Step 2: Find a Fixture
Soccer is sportId=10 (NFL is 14, NBA 11, MLB 13 the code is identical, just swap the ID). Keep fixtures with hasOdds=true.
params = {"apiKey": API_KEY, "sportId": 10, "from": "2026-06-23", "to": "2026-06-24"}
fixtures = requests.get(f"{BASE_URL}/fixtures", params=params).json()
fx = next(f for f in fixtures
if f.get("hasOdds") and f["participant1Name"] == "England")
FIXTURE_ID = fx["fixtureId"]
print(FIXTURE_ID, fx["participant1Name"], "vs", fx["participant2Name"])
Step 3: Pull DraftKings and FanDuel
The bookmakers query param filters the response to just the books you want. Market 101 is Full Time Result; outcomes 101/102/103 are Home/Draw/Away.
data = requests.get(f"{BASE_URL}/odds", params={
"apiKey": API_KEY,
"fixtureId": FIXTURE_ID,
"bookmakers": "draftkings,fanduel",
}).json()
OUTCOMES = {"101": "Home", "102": "Draw", "103": "Away"}
def price(slug, oid):
market = data["bookmakerOdds"].get(slug, {}).get("markets", {}).get("101")
if not market:
return None
p = market["outcomes"].get(oid, {}).get("players", {}).get("0")
# only trust an active price
return p["price"] if p and p.get("active") else None
Step 4: Compare and Pick the Winner
for oid, label in OUTCOMES.items():
dk, fd = price("draftkings", oid), price("fanduel", oid)
if dk is None or fd is None:
continue
if dk == fd:
verdict = "tie"
else:
best, edge = ("DraftKings", dk / fd) if dk > fd else ("FanDuel", fd / dk)
verdict = f"{best} (+{(edge - 1) * 100:.1f}%)"
print(f"{label:5} DK {dk:>6} FD {fd:>6} -> {verdict}")
# Home DK 1.22 FD 1.2 -> DraftKings (+1.7%)
# Draw DK 6.5 FD 6.5 -> tie
# Away DK 14.0 FD 14.0 -> tie
That is the whole tool. Run it before every bet and you always take the better of your two books.
Step 5: Don’t Stop at Two Books
Here is the uncomfortable part: DraftKings and FanDuel are both soft US books. They shade lines to balance their action, not to be sharp. The genuinely best price is often somewhere else entirely. Because OddsPapi carries 350+ bookmakers on one feed, widening the search is a one-line change drop the bookmakers filter and scan everyone:
all_books = requests.get(f"{BASE_URL}/odds",
params={"apiKey": API_KEY, "fixtureId": FIXTURE_ID}).json()
def best_price(oid):
prices = {}
for slug, book in all_books["bookmakerOdds"].items():
market = book.get("markets", {}).get("101")
if not market:
continue
p = market["outcomes"].get(oid, {}).get("players", {}).get("0")
if p and p.get("active") and p.get("price"):
prices[slug] = p["price"]
if not prices:
return None
book = max(prices, key=prices.get)
return book, prices[book], len(prices)
for oid, label in OUTCOMES.items():
book, odds, n = best_price(oid)
dk = price("draftkings", oid)
lift = (odds / dk - 1) * 100 if dk else 0
print(f"{label:5} best {odds} @ {book:12} (of {n} books) "
f"vs DK {dk} +{lift:.1f}%")
On the England vs Ghana fixture, the full-market best price beat DraftKings on every outcome the underdog (Ghana) paid 15.0 at the best book versus 14.0 at DraftKings, and the draw hit 7.1 versus 6.5. The two-app habit is a good start. The 350-book version is the actual edge.
Two Things to Watch
- Always filter on
active. A suspended price can linger in the payload withactive=false. If you do not filter, a stale number wins your comparison and sends you to a market that no longer exists. - Sanity-check outliers. When you widen to the full market, an odd price that is wildly higher than everyone else is usually a boosted promo or a stale line, not free money. Cross-check it against the sharp consensus (Pinnacle) before you trust it. Tools like jedibets do this for player props with alerting baked in.
FAQ
Does DraftKings or FanDuel have better odds?
Neither is consistently better. In a 42-outcome World Cup sample, DraftKings offered the better price on 19 outcomes, FanDuel on 5, and they tied on 18. The better book flips bet to bet, which is exactly why you should compare both every time rather than defaulting to one.
Do DraftKings and FanDuel have a public API?
No. Neither offers a public developer API. You access their odds through an aggregator like OddsPapi, which carries both books (plus 350+ others) on a single REST and WebSocket feed.
How much does line shopping actually save?
The gaps are largest on underdogs in our sample, 31.0 vs 28.0 on one longshot, a 10.7% payout difference for the same bet. Across a full season of bets, consistently taking the better price is one of the highest-ROI habits available to a bettor.
Can I compare more than two sportsbooks?
Yes. Drop the bookmakers filter and the same code scans all 350+ books on the fixture, including sharp books (Pinnacle, SBOBet) and exchanges. The two-book comparison is just the filtered version.
Is the odds data free?
Yes. OddsPapi has a free developer tier covering live odds across hundreds of books, plus free historical odds. The key is passed as a query parameter, not a header.
Stop Guessing. Compare Both. Then Compare Everyone.
You already have DraftKings and FanDuel use both. Get your free OddsPapi API key and run the comparison on every bet, then widen to 350+ books when you are ready for the real edge.