Skip to content

pmxt-dev/pmxt

Repository files navigation

pmxt Tweet

The ccxt for prediction markets. A unified API for accessing prediction market data across multiple exchanges.

plot

Polymarket      Kalshi      Manifold Markets      Metaculus      PredictIt

Discord

Why pmxt?

Different prediction market platforms have different APIs, data formats, and conventions. pmxt provides a single, consistent interface to work with all of them.

Quickstart

Get the current price for any market in seconds.

Python

import pmxt

api = pmxt.Polymarket()
markets = api.get_markets_by_slug('who-will-trump-nominate-as-fed-chair')

warsh = next((m for m in markets if m.outcomes[0].label == 'Kevin Warsh'), None) 

print(warsh.outcomes[0].price) # price of 'Yes' outcome

Note: For TypeScript usage, see pmxtjs documentation.

Installation

Python

pip install pmxt

Node.js

npm install pmxtjs

Supported Exchanges

  • Polymarket
  • Kalshi

Trading

pmxt supports trading functionality (placing and cancelling orders).

Setup

To trade, you must provide your private credentials.

  • Polymarket: Requires your Polygon Private Key. View Setup Guide
  • Kalshi: Requires API Key & Private Key.

Trading Example

import pmxt from 'pmxtjs';

const exchange = new pmxt.Polymarket({
    privateKey: process.env.POLYMARKET_PRIVATE_KEY
});

// Check Balance
const balance = await exchange.fetchBalance();
console.log('Balance:', balance);

// Place an Order
const order = await exchange.createOrder({
    marketId: 'market-123',
    outcomeId: 'token-id-456',
    side: 'buy',
    type: 'limit',
    price: 0.50,
    amount: 100
});
console.log('Order:', order);

Documentation

See the API Reference for detailed documentation and more examples.

Examples

Check out the directory for more use cases:

TypeScript Python

Stargazers repo roster for @qoery-com/pmxt