getoddsapi
v0.6.0
Published
Node client for the GetOdds sports odds API: FanDuel, BetRivers, bet365, Novig and Pinnacle prices plus PrizePicks and Underdog lines
Maintainers
Readme
getodds (Node)
Node client for the GetOdds sports odds API: FanDuel, BetRivers, bet365, Novig and Pinnacle prices plus PrizePicks and Underdog pick'em lines, with capture times on every row. No dependencies, Node 22+, ESM, TypeScript types included.
npm install getoddsapi0.6.0 changes: odds(), events() and sports() now call the multi-book The Odds API v4 routes and return v4
event arrays; new eventOdds() and scores(). Pick'em sources are prizepicks (default), underdog and fanduel.
Removed (their routes now return 410): history, bookmakers, marketTypes, searchEvents, event, oddsMulti,
updatedOdds, droppingOdds, leagues, historicalEvents, searchHistoricalEvents, oddsSummary,
oddsSummaryMulti, eventState, participants, participant, replay. sportsbook() now takes FanDuel native
resources only. The keyless boards now return FanDuel (New Jersey) prices.
Try it with no key
The public boards need no account and use no credits. They return FanDuel (New Jersey) prices, cached for up to five minutes.
import {publicBoard} from 'getoddsapi';
const board = await publicBoard('nba'); // nfl, nba, nhl, college-football, soccer-odds-api
for (const row of board.rows.slice(0, 2))
console.log(row.away, '@', row.home, row.market, row.side, row.american, row.observed_at);Output from a real run on 4 Dec 2026 (18:55 UTC):
Philadelphia 76ers @ Atlanta Hawks moneyline away -110 2026-12-04T18:47:19.292Z
Philadelphia 76ers @ Atlanta Hawks moneyline home -106 2026-12-04T18:47:19.292ZPrices move; your numbers will differ. From the shell: npx getoddsapi board --sport nfl.
With a free key
Create a free key at https://getoddsapi.com/sign-up (25 requests a month, 60 a minute, no card) and set
GETODDS_API_KEY in the server environment. Never put the key in browser code.
import {GetOdds, GetOddsError} from 'getoddsapi';
const client = new GetOdds(); // reads process.env.GETODDS_API_KEY
// Game lines at every book: GET /v4/sports/basketball_nba/odds?regions=us,us_ex,eu&markets=h2h,spreads,totals&oddsFormat=american
const games = await client.odds({sport: 'basketball_nba'}); // 'NBA' works too
const fdOnly = await client.odds({sport: 'NFL', bookmakers: ['fanduel'], markets: 'spreads'});
const props = await client.eventOdds({sport: 'NBA', eventId: games[0].id, markets: 'player_points'});
const lines = await client.markets({source: 'underdog', limit: 20}); // pick'em thresholds
const fd = await client.fanduelMarkets({league: 'NBA', limit: 5}); // FanDuel native markets
try {
await client.scores({sport: 'NHL', daysFrom: 1});
} catch (err) {
if (err instanceof GetOddsError) console.log(err.code, err.status, err.retryAfter); // e.g. HTTP_ERROR 429 60
}odds() defaults to regions: 'us,us_ex,eu', markets: 'h2h,spreads,totals' and oddsFormat: 'american', and
returns The Odds API v4 shape (events, each with bookmakers[].markets[].outcomes[]). sports() and events() use
no credits.
Each call makes one bounded request (20 s timeout, 2 MiB cap, redirects refused) and validates the response
contract. No automatic retries or pagination. Pass an AbortSignal as signal to cancel. A successful data
request uses one credit; failed reads use none.
Full reference: https://getoddsapi.com/docs, OpenAPI at https://getoddsapi.com/openapi.json. For agents, the
getodds-mcp package exposes the same data as MCP tools.
Tests
npm testTests run offline with an injected fetcher.
GetOdds is an independent developer product, not affiliated with any sportsbook. Operated by Stunning Couches LLC. MIT licensed.
