Skip to main content

fanduelapi

Python client for FanDuel API: FanDuel Sportsbook player props, game lines, alternates, futures, DFS salaries and the history of every line move, as JSON. Standard library only, Python 3.8+.

FanDuel API is an independent data service operated by Stunning Couches LLC. It is not affiliated with, endorsed by or sponsored by FanDuel.

Install

pip install fanduelapi

Try it with no key

Two helpers need no account: a small delayed sample of real props, and the credit cost of any call.

import fanduelapi

for p in fanduelapi.sample_props("nba")[:5]:
    print(f"{p['player']:<22} {p['stat']:<9} {p['line']:>5}  over {p['over_american']:>5}  under {p['under_american']:>5}")

print(fanduelapi.credit_costs("/api/v1/props?league=nba&limit=200"))

Output on 15 November 2026 (the sample is delayed like the Free plan, so yours will differ):

Aaron Nesmith          assists     1.5  over   108  under  -144
Aaron Nesmith          pa         14.5  over  -114  under  -114
Aaron Nesmith          points     13.5  over   102  under  -136
Aaron Nesmith          pr         16.5  over  -118  under  -112
Aaron Nesmith          pra        18.5  over  -104  under  -128
{'path': '/api/v1/props?league=nba&limit=200', 'credits': 6}

With a key

Get a free key (no card) at https://fanduelapi.com/sign-up and export it:

export FANDUEL_API_KEY="fd_..."
from fanduelapi import FanDuelAPI

fd = FanDuelAPI()  # reads FANDUEL_API_KEY

# Every NBA points prop, with where it opened and how often it moved
for p in fd.props(league="nba", stat="points", limit=50):
    m = p["move"]
    print(p["player"], p["line"], p["over_american"], p["under_american"],
          "opened", m["open"]["line"], "line moves", m["line_moves"])

# The whole board in one call (compact rows, 1 credit per 100 rows)
board = fd.props(league="nfl", view="compact", limit=1000)

# Every recorded move of one prop
history = fd.prop_history(board[0]["id"])

# Game lines for every game of a league
games = fd.odds(league="nhl")

# FanDuel prices above the exchange fair price (min_edge is in percent)
value = fd.ev(league="nba", min_edge=2)

Follow line moves

follow_changes reads the change feed with a cursor and sleeps between empty pages for as long as the API's X-Next-Update-Seconds header says:

for c in fd.follow_changes(league="NBA"):
    if c["kind"] == "line_move":
        print(c["player"], c["stat"], c["previous"]["line"], "->", c["current"]["line"])

Errors and limits

Non-2xx responses raise FanDuelAPIError with status, code and the API's error body. Short rate limits (429 with Retry-After) are retried automatically. A monthly stop (QUOTA_EXCEEDED) is raised at once with topup_url and upgrade_url for the person to click; the client never buys anything.

from fanduelapi import FanDuelAPIError
try:
    fd.results(league="nba")
except FanDuelAPIError as e:
    print(e.code, e.topup_url)

fd.credits_used() returns the X-Credits-* headers of the last response.

Methods

Method Endpoint
props(league, stat, player, event_id, view, updated_since, limit, offset) GET /api/v1/props
prop_history(prop_id) GET /api/v1/props/{id}/history
changes(since, league, limit), follow_changes(...) GET /api/v1/changes
odds(league, date, market_type) GET /api/v1/odds
events, markets, futures, game_report(event_id) events, markets, futures, game report
compare, ev, arbitrage alternates and other venues, +EV, arbitrage
results, hit_rates(player, stat), training_set graded results and model data (paid plans)
dfs_slates, dfs_players(slate_id), injuries, coverage DFS salaries, injuries, what is tracked
fanduelapi.sample_props(sport), fanduelapi.credit_costs(path) keyless

Plans, credits and limits: https://fanduelapi.com/pricing and https://fanduelapi.com/credits. Full reference: https://fanduelapi.com/docs and https://fanduelapi.com/openapi.json.

Tests

python -m unittest discover -s tests            # offline, against a local fake server
FANDUEL_LIVE=1 python -m unittest discover -s tests   # also hits the keyless live endpoints

License

MIT

Metadata

Release files for fanduelapi 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fanduelapi 0.1.0
File Size Uploaded Provenance Actions
fanduelapi-0.1.0.tar.gz 8.3 kB With provenance Details for fanduelapi-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fanduelapi 0.1.0
File Interpreter ABI Platform Actions
fanduelapi-0.1.0-py3-none-any.whl Python 3 none any Details for fanduelapi-0.1.0-py3-none-any.whl

Total release size: 15.7 kB

Release files / fanduelapi-0.1.0.tar.gz

Download URL fanduelapi-0.1.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
854533ab67a36a79db30aebb31fee2f863baa50d30e681fde39bdccb7b945489
BLAKE2b-256 checksum
How to use checksums
a5ea5611469939fb681a5aa90501175b585aa7f3056401c854597bc2fe550c16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / fanduelapi-0.1.0-py3-none-any.whl

Download URL fanduelapi-0.1.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a9c51312cafd1b5b4ae8e46d9e9162c8473e1baf714b4cc82bf95ef3514efd6
BLAKE2b-256 checksum
How to use checksums
546c4c1e1fdd8c3c01ea55b4a3551783ac6335029f1752a74f4a0d804bffae80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for fanduelapi 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fanduelapi-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page