npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

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

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 getoddsapi

0.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.292Z

Prices 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 test

Tests run offline with an injected fetcher.

GetOdds is an independent developer product, not affiliated with any sportsbook. Operated by Stunning Couches LLC. MIT licensed.