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

@sharp-api/client

v0.2.8

Published

Official TypeScript/JavaScript client for the SharpAPI real-time sports betting odds API

Downloads

637

Readme

@sharpapi/client

Official TypeScript/JavaScript client for the SharpAPI real-time sports betting odds API.

Get pre-computed +EV opportunities, arbitrage detection, middles, and live odds from 20+ sportsbooks — with Pinnacle as the sharp reference.

Install

npm install @sharpapi/client

Quick Start

import { SharpAPI } from '@sharpapi/client'

const api = new SharpAPI('sk_live_...')

// Get odds
const { data: odds } = await api.odds.get({ league: 'nba' })

// Get +EV opportunities
const { data: ev } = await api.ev.get({ min_ev: 3 })

// Get arbitrage opportunities
const { data: arbs } = await api.arbitrage.get({ min_profit: 1 })

// Get middles
const { data: middles } = await api.middles.get({ league: 'nba' })

Resources

| Resource | Methods | Tier | |----------|---------|------| | api.sports | list(), get(id) | All | | api.leagues | list(params?), get(id) | All | | api.sportsbooks | list(), get(id) | All | | api.events | list(params?), get(id), markets(id) | All | | api.odds | get(params?), best(params?), comparison(params?), batch(ids) | All | | api.ev | get(params?) | Pro+ | | api.arbitrage | get(params?), csv(params?) | Hobby+ | | api.middles | get(params?) | Pro+ | | api.account | me(), usage() | All | | api.stream | odds(params?), opportunities(params?), all(params?), event(id), oddsWs(params?) | WebSocket add-on |

SSE Streaming

const stream = api.stream.odds({ league: 'nba' })

stream.on('initial', ({ data }) => {
  console.log('Snapshot:', data)
})

stream.on('update', ({ data }) => {
  console.log('Update:', data)
})

stream.connect()

// Later
stream.disconnect()

WebSocket Streaming

Real-time push (~100ms vs 1-2s for REST polling). SSE delivers comparable latency — pick WS for bidirectional control (subscribe/unsubscribe, filter updates) or SSE for simpler one-way streaming behind firewalls:

const stream = api.stream.oddsWs({
  sportsbook: ['draftkings', 'fanduel'],
  league: ['nba']
})

stream.on('connected', ({ message, tier }) => console.log(message))
stream.on('initial', ({ data }) => setAllOdds(data))
stream.on('odds_update', ({ data, source }) => updateOdds(source, data))
stream.on('ev:detected', ({ data }) => handleEV(data))
stream.on('error', ({ message }) => console.error(message))

stream.connect()

Node.js

For SSE streaming in Node.js, install the eventsource package:

npm install eventsource

WebSocket is available natively in Node.js 21+ or via the ws package.

Error Handling

try {
  const { data } = await api.ev.get()
} catch (err) {
  if (err.code === 'rate_limited') {
    // Back off and retry
  } else if (err.code === 'tier_restricted') {
    // Upgrade plan
  } else if (err.code === 'invalid_api_key') {
    // Check API key
  }
}

Links