The Underdog API Python client for Underdog Fantasy pick'em data. pip install underdog-api and read current Underdog lines with separate Higher and Lower payouts, every recorded line move, past boards and graded results.
Website | Docs | Free API key | Pricing | All SDKs
Also for underdogapi.com: JavaScript: npm install underdog-api | MCP server: npx -y underdog-api-mcp
Python client for Underdog API: Underdog Fantasy pick'em lines with separate Higher and Lower payout multipliers, every recorded line move since 6 Nov 2026, the board at any past instant, and graded results. Standard library only; Python 3.9+.
Underdog API is an independent data service operated by Stunning Couches LLC. It is not affiliated with, endorsed by or operated by Underdog Fantasy.
pip install underdog-api
export UNDERDOG_API_KEY=ud_... # free key, no card: https://underdogapi.com/sign-upfrom underdog_api import Client
demo = Client(api_key=None).demo("projections", league="NBA", limit=1)
print(demo["data"][0]["player"]["name"], demo["data"][0]["selections"]) # fictional rows, live shapefrom underdog_api import Client
ud = Client() # reads UNDERDOG_API_KEY
board = ud.projections(league="NBA", view="compact", limit=20)
for line in board["data"]:
print(line)
print(board["meta"]["observed_at"])for change in ud.pages("/api/v1/changes", league="NFL", event_type="line.moved", limit=200):
print(change["observed_at"], change["player_name"], change["stat"], change["previous_line"], "->", change["line"])past = ud.board(as_of="2026-11-14T23:00:00Z", league="NHL", limit=100)
graded = ud.results(league="NBA", date="2026-11-13", limit=200)On the free key, graded results, hit rates, game logs, exports and the training set raise PlanLimitError with a
few labelled sample rows and the upgrade link; no credits are charged:
from underdog_api import PlanLimitError
try:
ud.results(league="NBA")
except PlanLimitError as e:
print(e.message, e.upgrade_url, e.sample[:2])import pandas as pd
rows = list(ud.pages("/api/v1/projections", league="NBA", view="compact", limit=200))
df = pd.json_normalize(rows)- Every method returns the parsed JSON body (
dataandmeta).ud.get(path, **params)reaches any documented path. - Per-minute 429s and 5xx answers are retried with backoff; the monthly credit 429 is raised at once.
- Credits: one per started 100 rows on simple reads;
ud.credit_costs()returns the policy with no key. - Reference: https://underdogapi.com/docs?utm_source=github&utm_medium=readme&utm_campaign=underdogapi-python · Plans: https://underdogapi.com/pricing?utm_source=github&utm_medium=readme&utm_campaign=underdogapi-python
python -m unittest discover -s tests # offline, fake transport
UNDERDOG_LIVE=1 python -m unittest discover -s tests # also calls the keyless demo