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
outcomeIdsstring[]YesArray of outcome token IDs to watch
limitnumberNoOptional depth limit for each streamed order book
paramsobjectNoOptional exchange-specific parameters

Response

Returns a Record<string, OrderBook> — one OrderBook per outcome, keyed by outcome ID. Each update arrives as a separate data event.
FieldTypeDescription
bidsOrderLevel[]Bid orders, sorted high to low
asksOrderLevel[]Ask orders, sorted low to high
timestampnumberUnix timestamp in milliseconds

Usage

import pmxt

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

ids = ["OUTCOME_ID_1", "OUTCOME_ID_2", "OUTCOME_ID_3"]
while True:
    books = exchange.watch_order_books(ids, limit=10)
    for outcome_id, book in books.items():
        bid = book.bids[0].price if book.bids else None
        ask = book.asks[0].price if book.asks else None
        print(f"{outcome_id[:20]}... bid={bid} ask={ask}")

Use cases

Watch all outcomes in a market

Fetch a market’s outcomes, then stream all their orderbooks:
import pmxt

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

# Get all outcomes for a market
market = poly.fetch_market(market_id="MARKET_ID")
ids = [o.outcome_id for o in market.outcomes]

# Stream all orderbooks
while True:
    books = poly.watch_order_books(ids)
    for outcome_id, book in books.items():
        mid = (book.bids[0].price + book.asks[0].price) / 2 if book.bids and book.asks else 0
        print(f"{outcome_id[:20]}... mid={mid:.1%}")