Forecasting applications, quantitative trading strategies, and financial research increasingly depend on prediction market data streams. The largest prediction market ecosystem—anchored by Polymarket's CLOB infrastructure and PolyGram—makes comprehensive APIs available to developers seeking to construct sophisticated applications atop this foundation.
Available APIs
Polymarket Gamma API (Market Data)
Market metadata, real-time pricing, and time-series information are accessible via the Gamma REST API:
- Base URL: https://gamma-api.polymarket.com
- Endpoints: /events, /markets, /positions, /activity
- Authentication: Public market data requires no authentication
- Rate limits: Approximately 100 requests per minute when accessing without authentication
Polymarket CLOB API (Order Book & Trading)
Order book snapshots, trade execution history, and live order placement flow through the CLOB API:
- Base URL: https://clob.polymarket.com
- Endpoints: /book, /trades, /orders, /prices/history
- WebSocket: wss://ws-subscriptions-clob.polymarket.com delivers streaming market updates
- Authentication: Order placement demands ECDSA-signed message authentication
PolyGram API
PolyGram's proprietary interface supports authenticated trading workflows and account management:
- Comprehensive guidance available at PolyGram API Docs
- REST endpoints enable order placement, holdings inquiry, and market discovery
- Programmatic access secured through API key authentication
Common Developer Use Cases
- Algorithmic trading: Systematic position adjustments triggered by external data feeds
- Research dashboards: Temporal probability analysis for political or macroeconomic outcomes
- Market aggregators: Side-by-side odds comparison across multiple prediction venues
- Embedded widgets: Display current prediction market quotations within editorial or informational websites
- Alert systems: Automated notification when market movements exceed specified boundaries
Getting Started: Fetch Market Data
Here's a straightforward Python snippet retrieving current event listings:
import requests
response = requests.get(
"https://gamma-api.polymarket.com/events",
params={"limit": 10, "active": "true", "order": "volume24hr"}
)
events = response.json()
for event in events:
print(event["title"], event["volume"])
FAQ
- Is the Polymarket API free to use?
- Market data access (Gamma API) carries no cost, subject to rate-limit constraints. Submitting orders (CLOB API) requires a wallet with sufficient USDC balance and cryptographic signing, though no service charges apply.
- Can I paper trade with the API before risking real USDC?
- Polymarket offers no test or staging environment. Manifold Markets provides a paper-trading API suitable for prototyping; migrate to Polymarket/PolyGram CLOB once ready for production capital deployment.
- Are there Python or JavaScript SDKs available?
- Community contributors have released unofficial Python and JavaScript packages for Polymarket integration. GitHub repositories labelled "polymarket-py" and "polymarket-js" contain actively maintained implementations.