Developers seeking to construct sophisticated applications around forecasting and quantitative analysis increasingly turn to prediction market data. PolyGram and the Polymarket CLOB infrastructure offer robust, developer-friendly APIs that unlock access to the world's most active prediction market ecosystem.
Available APIs
Polymarket Gamma API (Market Data)
The Gamma REST interface delivers event information, real-time pricing, and time-series records:
- Base URL: https://gamma-api.polymarket.com
- Endpoints: /events, /markets, /positions, /activity
- Authentication: Public market data requires no credentials
- Rate limits: Approximately 100 calls per minute for unauthenticated requests
Polymarket CLOB API (Order Book & Trading)
The CLOB interface supplies instantaneous order book snapshots and enables order placement:
- Base URL: https://clob.polymarket.com
- Endpoints: /book, /trades, /orders, /prices/history
- WebSocket: wss://ws-subscriptions-clob.polymarket.com for live streaming
- Authentication: ECDSA signatures mandatory when submitting orders
PolyGram API
PolyGram delivers its proprietary API layer for authenticated market operations:
- Comprehensive reference available at PolyGram API Docs
- HTTP endpoints supporting order execution, account holdings, and market discovery
- API key-based authentication for automated trading workflows
Common Developer Use Cases
- Algorithmic trading: Systematic position adjustments triggered by proprietary signals
- Research dashboards: Longitudinal tracking of implied probabilities across political or macroeconomic events
- Market aggregators: Side-by-side odds comparison across Polymarket, Kalshi, Betfair, Smarkets and other venues
- Embedded widgets: Integrate live odds displays within editorial, news, or information platforms
- Alert systems: Trigger notifications upon significant market movement or volatility
Getting Started: Fetch Market Data
Here is a straightforward Python snippet to retrieve current events:
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 retrieval (Gamma API) incurs no charge but respects rate restrictions. Submitting orders (CLOB API) requires a balance in USDC and ECDSA signing; no transaction surcharges apply.
- Can I paper trade with the API before risking real USDC?
- Polymarket lacks a testnet or sandbox. Manifold Markets provides a paper trading API for experimentation; migrate to Polymarket/PolyGram CLOB once ready for production capital.
- Are there Python or JavaScript SDKs available?
- Community contributors have released unsupported Python and JavaScript wrappers for Polymarket. Consult GitHub repositories "polymarket-py" and "polymarket-js" to find actively maintained versions.