Pmxt
CCXT for prediction markets. A unified API for trading on Polymarket, Kalshi, and more.
Install / Use
/learn @pmxt-dev/PmxtREADME
pmxt

The ccxt for prediction markets. A unified API for accessing prediction market data across multiple exchanges.
<img width="3840" height="2160" alt="plot" src="https://github.com/user-attachments/assets/ed77d244-c95f-4fe0-a7a7-89af713c053f" /> <div align="center"> <table> <tr> <td rowspan="3"> <a href="https://www.producthunt.com/products/ccxt-for-prediction-markets?embed=true&utm_source=badge-featured&utm_medium=badge&utm_campaign=badge-ccxt-for-prediction-markets" target="_blank" rel="noopener noreferrer"><img alt="CCXT for Prediction Markets - A unified API for prediction market data across exchanges. | Product Hunt" width="250" height="54" src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1060549&theme=light&t=1768206672608"></a> </td> <td> <img src="https://img.shields.io/github/watchers/pmxt-dev/pmxt?style=social" alt="GitHub watchers"> </td> <td> <a href="https://github.com/pmxt-dev/pmxt"><img src="https://pmxt-dev.github.io/pmxt-stats/badges/total-downloads.svg" alt="Total Downloads"></a> </td> </tr> <tr> <td> <img src="https://img.shields.io/github/forks/pmxt-dev/pmxt?style=social" alt="GitHub forks"> </td> <td> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a> </td> </tr> <tr> <td> <a href="https://github.com/pmxt-dev/pmxt/stargazers"><img src="https://img.shields.io/github/stars/pmxt-dev/pmxt?refresh=1" alt="GitHub stars"></a> </td> <td> <a href="https://www.npmjs.com/package/pmxtjs"> <img src="https://img.shields.io/npm/v/pmxtjs?label=version" alt="version"> </a> </td> </tr> </table> </div> <p align="center"> <a href="https://discord.gg/Pyn252Pg95"> <img src="https://img.shields.io/discord/1461393765196501015?label=Discord&logo=discord&logoColor=white&style=for-the-badge&color=5865F2" alt="Discord"> </a> </p>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.
Supported Exchanges
<p align="center"> <a href="https://polymarket.com" style="color: inherit; text-decoration: none;"><img src="https://polymarket.com/favicon.ico" alt="Polymarket" width="24" height="24"> <b>Polymarket</b></a> <a href="https://kalshi.com" style="color: inherit; text-decoration: none;"><img src="https://kalshi.com/favicon.ico" alt="Kalshi" width="24" height="24"> <b>Kalshi</b></a> <a href="https://limitless.exchange" style="color: inherit; text-decoration: none;"><img src="https://limitless.exchange/assets/images/logo.svg" alt="Limitless" width="24" height="24"> <b>Limitless</b></a> <a href="https://probable.markets" style="color: inherit; text-decoration: none;"><img src="https://developer.probable.markets/logo.svg" alt="Probable" width="100"></a> <!-- # The baozi website seems to just show 50:50 odds for everything. Something must be fundamentally broken on their end. --> <a href="https://myriad.markets" style="color: inherit; text-decoration: none;"><img src="https://myriad.markets/favicon.ico" alt="Myriad" width="24" height="24"> <b>Myriad</b></a> <a href="https://opinion.trade" style="color: inherit; text-decoration: none;"><img src="https://app.opinion.trade/assets/apple-splash-2048-2732.jpg" alt="Opinion" width="24" height="24"> <b>Opinion</b></a> </p>Installation
Ensure that Node.js is installed and the node command is available on your PATH.
Python
pip install pmxt
Node.js
npm install pmxtjs
Migrating from Dome API
If you're currently using Dome API, pmxt is a drop-in replacement with a unified interface for Polymarket and Kalshi.
Check out pmxt as a Dome API alternative for a detailed migration guide, API comparison, and automatic codemod tool (dome-to-pmxt) to help you transition your code.
# Automatically migrate your codebase
npx dome-to-pmxt ./src
Quickstart
Prediction markets are structured in a hierarchy to group related information.
- Event: The broad topic (e.g., "Who will Trump nominate as Fed Chair?")
- Market: A specific tradeable question (e.g., "Will Trump nominate Kevin Warsh as the next Fed Chair?")
- Outcome: The actual share you buy (e.g., "Yes" or "No")
Python
import pmxt
api = pmxt.Exchange()
# 1. Search for the broad Event
events = api.fetch_events(query='Who will Trump nominate as Fed Chair?')
fed_event = events[0]
# 2. Find the specific Market within that event
warsh = fed_event.markets.match('Kevin Warsh')
print(f"Price: {warsh.yes.price}")
TypeScript
import pmxt from 'pmxtjs';
const api = new pmxt.Exchange();
// 1. Search for the broad Event
const events = await api.fetchEvents({ query: 'Who will Trump nominate as Fed Chair?' });
const fedEvent = events[0];
// 2. Find the specific Market within that event
const warsh = fedEvent.markets.match('Kevin Warsh');
console.log(`Price: ${warsh.yes?.price}`);
Trading
pmxt supports unified trading across exchanges.
Setup
To trade, you must provide your private credentials during initialization.
Polymarket
exchange = pmxt.Polymarket(
private_key=os.getenv('POLYMARKET_PRIVATE_KEY'),
proxy_address=os.getenv('POLYMARKET_PROXY_ADDRESS'), # Optional: For proxy trading
signature_type='gnosis-safe' # Default
)
Kalshi
exchange = pmxt.Kalshi(
api_key=os.getenv('KALSHI_API_KEY'),
private_key=os.getenv('KALSHI_PRIVATE_KEY') # RSA Private Key
)
Limitless
exchange = pmxt.Limitless(
api_key=os.getenv('LIMITLESS_API_KEY'),
private_key=os.getenv('LIMITLESS_PRIVATE_KEY') # For order signing (EIP-712)
)
Trading Example (Python)
import pmxt
import os
# Initialize with credentials (e.g., Polymarket)
exchange = pmxt.Polymarket(
private_key=os.getenv('POLYMARKET_PRIVATE_KEY'),
proxy_address=os.getenv('POLYMARKET_PROXY_ADDRESS')
)
# 1. Check Balance
balance = exchange.fetch_balance()
print(f"Available balance: {balance[0].available}")
# 2. Fetch markets
markets = exchange.fetch_markets(query='Trump')
# 3. Place an Order (using outcome shorthand)
order = exchange.create_order(
outcome=markets[0].yes,
side='buy',
type='limit',
price=0.33,
amount=100
)
print(f"Order Status: {order.status}")
Documentation
See the API Reference for detailed documentation and more examples.
Examples
Check out the directory for more use cases:
