The Underdog Fantasy API client for Node.js, TypeScript, Deno, Bun and edge runtimes. npm install underdog-api and read Underdog pick'em lines, line moves and graded results with typed responses.
Website | Docs | Free API key | Pricing | All SDKs
Also for underdogapi.com: Python: pip install underdog-api | MCP server: npx -y underdog-api-mcp
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.
No dependencies; uses the platform fetch (Node 18+, Deno, Bun, edge runtimes). Types included.
Underdog API is an independent data service operated by Stunning Couches LLC. It is not affiliated with, endorsed by or operated by Underdog Fantasy.
npm install underdog-api
export UNDERDOG_API_KEY=ud_... # free key, no card: https://underdogapi.com/sign-upKeep the key on a server or in an edge function; do not ship it to a browser.
import { Underdog } from 'underdog-api';
const demo = await new Underdog({ apiKey: '' }).demo('projections', { league: 'NBA', limit: 1 });
console.log(demo.data[0]); // fictional rows in the live shapeimport { Underdog } from 'underdog-api';
const ud = new Underdog(); // reads UNDERDOG_API_KEY
const { data, meta } = await ud.projections({ league: 'NBA', view: 'compact', limit: 20 });
console.log(data.length, 'lines, observed', meta.observed_at);for await (const c of ud.pages('/api/v1/changes', { league: 'NFL', event_type: 'line.moved', limit: 200 })) {
console.log(c.observed_at, c.player_name, c.stat, c.previous_line, '->', c.line);
}const past = await ud.board('2026-11-14T23:00:00Z', { league: 'NHL', limit: 100 });
const graded = await 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 throw PlanLimitError with a
few labelled sample rows and the upgrade link; no credits are charged:
import { PlanLimitError } from 'underdog-api';
try { await ud.results({ league: 'NBA' }); }
catch (e) { if (e instanceof PlanLimitError) console.log(e.message, e.upgradeUrl, e.sample.slice(0, 2)); }- Every method resolves to the parsed body (
dataandmeta);ud.get(path, params)reaches any documented path. - Per-minute 429s and 5xx answers are retried with backoff; the monthly credit 429 throws at once.
- Live line events:
GET /api/v1/stream(server-sent events). Reference: https://underdogapi.com/docs?utm_source=github&utm_medium=readme&utm_campaign=underdogapi-js
npm test # offline, fake fetch
UNDERDOG_LIVE=1 npm test # also calls the keyless demo