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

predmarket-sdk

v1.1.0

Published

TypeScript SDK for the Prediction Market Data API — unified access to Polymarket & Kalshi markets, arbitrage detection, and strategy signals

Readme

prediction-market-sdk

npm version License: MIT

TypeScript SDK for the Prediction Market Data API — unified access to Polymarket & Kalshi markets, arbitrage detection, cross-platform matching, and strategy signals.

Since Dome (the previous prediction market aggregator) was acquired by Polymarket in early 2026, there is no unified API for both major prediction market platforms. This SDK fills that gap.

Install

npm install prediction-market-sdk

Quick Start

import { PredictionMarketClient } from "prediction-market-sdk";

const client = new PredictionMarketClient({
  apiKey: "your-rapidapi-key",
});

// Search markets
const markets = await client.listMarkets({
  category: "Sports",
  platform: "polymarket",
  limit: 10,
});

// Find arbitrage opportunities
const arbs = await client.getArbitrage({ minSpread: 0.02 });

// Cross-platform arbitrage (same event, different prices)
const crossArbs = await client.getCrossPlatformArbitrage({ arbOnly: true });

// Strategy signals from 759K+ forward-tested triggers
const strategies = await client.getTopStrategies({ minWinRate: 0.8 });

Get an API Key

  1. Go to Prediction Market Data on RapidAPI
  2. Subscribe to the free plan (50 requests/day)
  3. Copy your X-RapidAPI-Key from the dashboard

API Methods

Markets

listMarkets(params?)

List active prediction markets from Polymarket and Kalshi, sorted by 24h volume.

const markets = await client.listMarkets({
  platform: "polymarket",  // or "kalshi"
  category: "Politics",
  q: "Trump",              // search by question text
  minVolume: 10000,
  limit: 50,
  offset: 0,
});

getMarket(id)

Get a single market by Polymarket conditionId (0x...) or Kalshi ticker.

const market = await client.getMarket("0xe492ad95...");

listCategories()

List all categories with per-platform market counts.

const categories = await client.listCategories();
// [{ name: "Sports", polymarketCount: 824, kalshiCount: 612, totalCount: 1436 }, ...]

Arbitrage

getArbitrage(params?)

Find single-platform arbitrage opportunities where YES + NO < $1.

const arbs = await client.getArbitrage({
  platform: "kalshi",
  minSpread: 0.01,
  shares: 100,
  limit: 20,
});

getCrossPlatformArbitrage(params?)

Find the same market priced differently on Polymarket vs Kalshi. Uses NLP-powered matching with question type detection, entity extraction, and predicate analysis.

const crossArbs = await client.getCrossPlatformArbitrage({
  minMatchScore: 0.7, // 0-1 confidence threshold
  arbOnly: true,      // only profitable opportunities
  limit: 50,
});

for (const match of crossArbs.data) {
  console.log(`${match.polymarket.question} — ${match.matchScore * 100}% match`);
  console.log(`Buy YES on ${match.bestStrategy.buyYesOn} → ROI: ${match.bestStrategy.roi}%`);
}

calculateArbitrage(params)

Calculate exact profit for a YES/NO price pair with platform-specific fee breakdown.

const calc = await client.calculateArbitrage({
  yes: 0.45,
  no: 0.52,
  shares: 100,
  platform: "polymarket",
  feeType: "us",
});
// { netProfit: 1.93, roi: 1.99, isProfitable: true, fees: { taker: 0.01, settlement: 1, ... } }

Signals

getTopStrategies(params?)

Top-performing strategy combinations from a 24/7 forward-testing engine evaluating 864 combos against live Polymarket data ~8,640 times per day.

const strategies = await client.getTopStrategies({
  minWinRate: 0.8,
  minTriggers: 1000,
  limit: 10,
});
// [{ comboId: 24, winRate: 0.8268, totalNetProfit: 286140, totalTriggers: 759253, ... }]

getRecentTriggers(params?)

Recent trigger events — each represents a real market opportunity detected and evaluated.

const triggers = await client.getRecentTriggers({
  profitable: true,
  category: "Sports",
  limit: 20,
});

Data Coverage

| Platform | Markets | Type | |----------|---------|------| | Polymarket | ~1,400+ | Crypto-native, largest by volume | | Kalshi | ~3,400+ | CFTC-regulated US exchange |

Pricing

| Plan | Price | Requests | |------|-------|----------| | Basic | Free | 50/day | | Pro | $14.99/mo | 1,000/day | | Ultra | $49.99/mo | 10,000/day | | Mega | $149.99/mo | 100,000/mo |

Subscribe on RapidAPI →

License

MIT