Skip to content

About

Official JavaScript / TypeScript client for underdogapi.com: Underdog data API.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Underdog API for JavaScript and TypeScript: underdog-api

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.

Install

npm install underdog-api
export UNDERDOG_API_KEY=ud_...   # free key, no card: https://underdogapi.com/sign-up

Keep the key on a server or in an edge function; do not ship it to a browser.

Try it without a key

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 shape

The current board

import { 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);

Everything that moved, page by page

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);
}

Past boards and graded results (paid plans)

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)); }

Notes

Tests

npm test                    # offline, fake fetch
UNDERDOG_LIVE=1 npm test    # also calls the keyless demo

About

Official JavaScript / TypeScript client for underdogapi.com: Underdog data API.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages