Skip to content

polymarket-pandas

PyPI Python Downloads License CI

Pandas-native Python client for the full Polymarket API surface — REST, WebSocket, Relayer, and Bridge — with automatic type coercion and DataFrame output.

Features

  • 102 public methods across 9 API mixins (Gamma, CLOB, Data, Rewards, Bridge, Relayer, CTF, XTracker)
  • Every endpoint returns a pd.DataFrame with automatic type coercion (datetimes, numerics, booleans)
  • Sync + Async HTTP clients — PolymarketPandas and AsyncPolymarketPandas
  • WebSocket streaming — real-time orderbook, prices, trades, sports, crypto feeds
  • pandera schemas for column documentation and optional runtime validation
  • TypedDicts for dict-returning endpoints with full IDE autocomplete
  • Order building & EIP-712 signingbuild_order, place_order, submit_orders (DataFrame batch)
  • On-chain CTF operations — merge, split, redeem positions via web3
  • Title parsers — extract bracket bounds, directional thresholds, and sports lines from market titles
  • Auto-pagination — offset-based and cursor-based _all() methods
  • Interactive Streamlit explorer with 11 pages and Plotly charts
  • MCP server with 74 tools for Claude Code / Claude Desktop

Installation

pip install polymarket-pandas

Optional extras:

pip install "polymarket-pandas[ctf]"       # on-chain merge/split/redeem
pip install "polymarket-pandas[explorer]"   # Streamlit dashboard
pip install "polymarket-pandas[mcp]"        # MCP server (74 tools)

Quick Start

from polymarket_pandas import PolymarketPandas

client = PolymarketPandas()

# Get active markets sorted by volume
markets = client.get_markets(closed=False, limit=100)
print(markets[["slug", "volume24hr", "endDate"]].head())

# Get the order book for a token
book = client.get_orderbook("15871154585880608648...")
print(book)

See the Getting Started guide for a complete walkthrough.

Interactive Notebooks

Try polymarket-pandas in your browser with no installation — powered by Binder:

Notebook Description Launch
Getting Started Client, markets, orderbook, price history Binder
Market Analysis Event structures, title parsers, tags, series Binder
Portfolio Tracking Leaderboard, trades, positions, top holders Binder
Rewards Liquidity reward configs and markets Binder
XTracker Post-counter markets (Elon, Trump, etc.) Binder