The data generated by prediction markets has become an essential resource for academic research, algorithmic trading strategies, and real-time decision-making systems. PolyGram and the underlying Polymarket CLOB infrastructure offer robust APIs that allow developers to integrate with the world's most active prediction market network.
Available APIs
Polymarket Gamma API (Market Data)
The Gamma REST API delivers event information, current pricing, and time-series data:
- Base URL: https://gamma-api.polymarket.com
- Endpoints: /events, /markets, /positions, /activity
- Authentication: Not required to access publicly available market information
- Rate limits: Approximately 100 calls per minute without authentication credentials
Polymarket CLOB API (Order Book & Trading)
The CLOB API grants access to live 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 streaming data
- Authentication: ECDSA cryptographic signatures required when submitting trades
PolyGram API
PolyGram offers a dedicated API layer for authenticated trading workflows:
- Complete reference available at PolyGram API Docs
- REST endpoints supporting order execution, account holdings, and market discovery
- API key-based authentication for automated trading applications
Common Developer Use Cases
- Algorithmic trading: Systematic position adjustments triggered by external data feeds
- Research dashboards: Time-series analysis of implied probabilities across political or macroeconomic outcomes
- Market aggregators: Side-by-side price comparison across multiple prediction platforms
- Embedded widgets: Display current prediction odds directly within news articles or blog content
- Alert systems: Trigger notifications when market conditions exceed predetermined boundaries
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 access through the Gamma API is provided at no cost, though subject to rate restrictions. Trading via the CLOB API requires a wallet with USDC funds and cryptographic signing but incurs no separate API charges.
- Can I paper trade with the API before risking real USDC?
- Polymarket does not maintain a test or staging environment. Consider using Manifold Markets API to practise without capital, then move to live Polymarket or PolyGram trading once confident.
- Are there Python or JavaScript SDKs available?
- Community members have published third-party Python and JavaScript libraries for Polymarket integration. Look up "polymarket-py" and "polymarket-js" on GitHub to find actively maintained versions.