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

pmxtjs

v2.18.1

Published

Unified prediction market data API - The ccxt for prediction markets

Readme

pmxtjs

A unified TypeScript/Node.js SDK for prediction markets - The ccxt for prediction markets.

Installation

npm install pmxtjs

Quick Start

import pmxt from 'pmxtjs';

// Initialize exchanges
const poly = new pmxt.Polymarket();
const kalshi = new pmxt.Kalshi();

// Search for markets
const markets = await poly.fetchMarkets({ query: 'Trump' });
console.log(markets[0].title);

// Get outcome details
const outcome = markets[0].outcomes[0];
console.log(`${outcome.label}: ${(outcome.price * 100).toFixed(1)}%`);

// Fetch historical data (use outcome.outcomeId!)
const candles = await poly.fetchOHLCV(outcome.outcomeId, {
    resolution: '1d',
    limit: 30
});

// Get current order book
const orderBook = await poly.fetchOrderBook(outcome.outcomeId);
const spread = orderBook.asks[0].price - orderBook.bids[0].price;
console.log(`Spread: ${(spread * 100).toFixed(2)}%`);

Core Methods

Market Data

  • fetchMarkets(params?) - Get active markets

    // Fetch recent markets
    await poly.fetchMarkets({ limit: 20, sort: 'volume' });
    
    // Search by text
    await poly.fetchMarkets({ query: 'Fed rates', limit: 10 });
    
    // Fetch by slug/ticker
    await poly.fetchMarkets({ slug: 'who-will-trump-nominate-as-fed-chair' });
  • fetchEvents(params?) - Get events (groups of related markets)

    await poly.fetchEvents({ query: 'Fed Chair', limit: 5 });
  • filterMarkets(markets, query) - Filter markets by keyword

    const events = await poly.fetchEvents({ query: 'Fed Chair' });
    const warsh = poly.filterMarkets(events[0].markets, 'Kevin Warsh')[0];

Deep-Dive Methods

  • fetchOHLCV(outcomeId, params) - Get historical price candles
  • fetchOrderBook(outcomeId) - Get current bids/asks
  • fetchTrades(outcomeId, params) - Get trade history

Helper Methods

  • getExecutionPrice(orderBook, side, amount) - Calculate volume-weighted average price
  • getExecutionPriceDetailed(orderBook, side, amount) - Get detailed execution info

Trading

Authentication

Polymarket:

const poly = new pmxt.Polymarket({
    privateKey: process.env.POLYMARKET_PRIVATE_KEY,
    proxyAddress: process.env.POLYMARKET_PROXY_ADDRESS, // Optional
    // signatureType: 'gnosis-safe' (default)
});

Kalshi:

const kalshi = new pmxt.Kalshi({
    apiKey: process.env.KALSHI_API_KEY,
    privateKey: process.env.KALSHI_PRIVATE_KEY
});

Limitless:

const limitless = new pmxt.Limitless({
    privateKey: process.env.LIMITLESS_PRIVATE_KEY
});

Trading Methods

  • createOrder(params) - Place a new order

    // Using outcome shorthand (recommended)
    await poly.createOrder({
        outcome: market.yes,
        side: 'buy',
        type: 'limit',
        amount: 10,
        price: 0.55
    });
  • cancelOrder(orderId) - Cancel an open order

  • fetchOrder(orderId) - Get order details

  • fetchOpenOrders(marketId?) - Get all open orders

Account Methods

  • fetchBalance() - Get account balance
  • fetchPositions() - Get current positions

Documentation

For complete API documentation and examples, see:

Important Notes

  • Use outcome.outcomeId, not market.marketId for deep-dive methods (fetchOHLCV, fetchOrderBook, fetchTrades)
  • Prices are 0.0 to 1.0 (multiply by 100 for percentages)
  • Timestamps are Unix milliseconds
  • Volumes are in USD

License

MIT