Forecasting applications, quantitative trading strategies, and financial research increasingly depend on prediction market data. The Polymarket CLOB and PolyGram infrastructure deliver robust APIs enabling developers to construct sophisticated applications atop the world's most active prediction market platform.
Available APIs
Polymarket Gamma API (Market Data)
Market metadata, real-time pricing, and historical records 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 for unauthenticated queries
Polymarket CLOB API (Order Book & Trading)
Real-time order book snapshots and trade execution are provided through the CLOB API:
- Base URL: https://clob.polymarket.com
- Endpoints: /book, /trades, /orders, /prices/history
- WebSocket: wss://ws-subscriptions-clob.polymarket.com delivers live streaming updates
- Authentication: Order placement demands ECDSA-signed authentication
PolyGram API
Authenticated trading workflows and portfolio management are handled via the PolyGram platform API:
- Comprehensive details available at PolyGram API Docs
- REST endpoints supporting trade execution, account holdings, and market discovery
- API key-based authentication for automated trading workflows
Common Developer Use Cases
- Algorithmic trading: Systematic position adjustment triggered by external data feeds
- Research dashboards: Long-term probability analysis for political or macroeconomic events
- Market aggregators: Cross-platform odds comparison and arbitrage identification
- Embedded widgets: Display current prediction market probabilities within news platforms or content sites
- Alert systems: Trigger notifications when market conditions breach defined parameters
Getting Started: Fetch Market Data
Here's a straightforward Python snippet to retrieve active 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 Gamma API carries no cost subject to rate restrictions. The CLOB API for order submission requires a wallet with sufficient USDC balance and ECDSA signing capability; no transaction surcharges apply beyond standard blockchain fees.
- Can I paper trade with the API before risking real USDC?
- Polymarket lacks a testnet or sandbox mode. Manifold Markets provides a paper trading API suitable for prototyping; developers can then migrate to live Polymarket or PolyGram CLOB infrastructure once ready for production.
- Are there Python or JavaScript SDKs available?
- Community contributors have published third-party Python and JavaScript libraries. Check GitHub repositories such as "polymarket-py" and "polymarket-js" to locate actively maintained implementations.