Forecasting applications, quantitative trading strategies, and financial research increasingly depend on prediction market datasets. PolyGram and the Polymarket CLOB infrastructure provide extensive APIs enabling developers to construct applications atop the world's most active prediction market platform.
Available APIs
Polymarket Gamma API (Market Data)
The Gamma REST API delivers historical information, current pricing, and event metadata:
- 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 when unauthenticated
Polymarket CLOB API (Order Book & Trading)
The CLOB API grants access to live order book information and order placement functionality:
- Base URL: https://clob.polymarket.com
- Endpoints: /book, /trades, /orders, /prices/history
- WebSocket: wss://ws-subscriptions-clob.polymarket.com for live streaming
- Authentication: Order placement demands ECDSA-signed requests
PolyGram API
PolyGram supplies its own interface for verified trading activity:
- Consult the complete reference at PolyGram API Docs
- REST endpoints supporting market discovery, trade execution, and account management
- API key-based authentication for automated trading workflows
Common Developer Use Cases
- Algorithmic trading: Autonomous position adjustment driven by external data sources
- Research dashboards: Tracking historical odds for sporting events, political contests, or macroeconomic outcomes
- Market aggregators: Consolidating odds from multiple prediction platforms for comparative analysis
- Embedded widgets: Display current prediction market odds within editorial content or third-party websites
- Alert systems: Trigger notifications when market movements breach specified parameters
Getting Started: Fetch Market Data
Here's a straightforward Python script 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 via the Gamma API carries no cost subject to rate restrictions. Submitting orders through the CLOB API requires a wallet with funds and ECDSA signing but incurs no separate charges.
- Can I paper trade with the API before risking real USDC?
- Polymarket lacks a test environment for paper trading. Explore Manifold Markets API for risk-free experimentation, then migrate to Polymarket/PolyGram CLOB once ready for production.
- Are there Python or JavaScript SDKs available?
- Community contributors have built unsupported Python and JavaScript packages for Polymarket integration. Check GitHub repositories for "polymarket-py" and "polymarket-js" to locate actively maintained implementations.