Skip to main content

Documentation Index

Fetch the complete documentation index at: https://pmxt-feat-series-api.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

WebSocket endpoint — This method uses WebSocket streaming, not HTTP. Connect to wss://api.pmxt.dev/ws?apiKey=YOUR_KEY (hosted) or ws://localhost:3847/ws (local server).
Supported venues: polymarket, kalshi, limitless, opinion.

Parameters

ParameterTypeRequiredDescription
outcomeIdstringYesThe outcome token ID to watch
limitnumberNoOptional depth limit for the streamed order book
paramsobjectNoOptional exchange-specific parameters

Response

Returns an OrderBook object each time the orderbook updates:
FieldTypeDescription
bidsOrderLevel[]Bid orders, sorted high to low
asksOrderLevel[]Ask orders, sorted low to high
timestampnumberUnix timestamp in milliseconds
Each OrderLevel has price (0–1 probability) and size (number of contracts).

Usage

import pmxt

exchange = pmxt.Polymarket(pmxt_api_key="YOUR_PMXT_API_KEY")

# Stream orderbook updates — each call returns the next snapshot
while True:
    book = exchange.watch_order_book("OUTCOME_ID", limit=10)
    if not book.bids or not book.asks:
        continue
    print(f"Best bid: {book.bids[0].price} ({book.bids[0].size} contracts)")
    print(f"Best ask: {book.asks[0].price} ({book.asks[0].size} contracts)")
    print(f"Spread: {book.asks[0].price - book.bids[0].price:.4f}")

Use cases

Monitor a specific market

Track the “Will Trump win 2028?” market on Polymarket:
import pmxt

poly = pmxt.Polymarket(pmxt_api_key="YOUR_PMXT_API_KEY")

# Use the outcome's token_id from fetchMarket
while True:
    book = poly.watch_order_book("48388283710620338...")
    bid = book.bids[0].price if book.bids else 0
    ask = book.asks[0].price if book.asks else 1
    print(f"YES price: {(bid + ask) / 2:.1%}")

Cross-venue spread detection

Watch the same market on two venues to detect arbitrage:
import pmxt
import asyncio

poly = pmxt.Polymarket(pmxt_api_key="YOUR_PMXT_API_KEY")
kalshi = pmxt.Kalshi(pmxt_api_key="YOUR_PMXT_API_KEY")

# Run both in parallel (simplified)
while True:
    poly_book = poly.watch_order_book("POLY_OUTCOME_ID")
    kalshi_book = kalshi.watch_order_book("KALSHI_OUTCOME_ID")
    if not poly_book.bids or not kalshi_book.asks:
        continue
    spread = poly_book.bids[0].price - kalshi_book.asks[0].price
    if spread > 0.02:
        print(f"Arbitrage opportunity: {spread:.4f}")