Data from prediction markets has become instrumental for financial modelling, systematic trading strategies, and instantaneous market forecasting tools. PolyGram alongside the Polymarket CLOB infrastructure furnish robust APIs enabling developers to construct applications atop the world's foremost prediction market platform.
Available APIs
Polymarket Gamma API (Market Data)
The Gamma REST API delivers event information, current pricing, and time-series analytics:
- Base URL: https://gamma-api.polymarket.com
- Endpoints: /events, /markets, /positions, /activity
- Authentication: Not needed for publicly accessible market information
- Rate limits: Approximately 100 calls per minute when using unauthenticated mode
Polymarket CLOB API (Order Book & Trading)
The CLOB API furnishes live order book snapshots alongside order placement capabilities:
- Base URL: https://clob.polymarket.com
- Endpoints: /book, /trades, /orders, /prices/history
- WebSocket: wss://ws-subscriptions-clob.polymarket.com for streaming data feeds
- Authentication: ECDSA cryptographic signatures mandatory for submitting trades
PolyGram API
PolyGram offers its proprietary API layer for authenticated trading workflows:
- Consult the complete reference at PolyGram API Docs
- HTTP endpoints supporting order execution, account holdings, and market discovery
- API key-based authorisation for automated trading operations
Common Developer Use Cases
- Algorithmic trading: Systematic position adjustment triggered by external data signals
- Research dashboards: Longitudinal probability analysis for political contests or macroeconomic indicators
- Market aggregators: Side-by-side pricing comparison across multiple forecast platforms
- Embedded widgets: Display current prediction market quotations within editorial or promotional content
- Alert systems: Trigger notifications whenever a market shifts past predetermined boundaries
Getting Started: Fetch Market Data
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?
- Absolutely — market data access (Gamma API) carries no cost subject to rate restrictions. Trade execution (CLOB API) demands a wallet with sufficient capital and ECDSA authorisation yet incurs no separate charges.
- Can I paper trade with the API before risking real USDC?
- Polymarket lacks a test environment for non-production use. Leverage Manifold Markets API for simulated trading, then migrate to Polymarket/PolyGram CLOB when prepared for genuine capital deployment.
- Are there Python or JavaScript SDKs available?
- Community contributors have built third-party Python and JavaScript wrappers for Polymarket. Browse GitHub repositories under "polymarket-py" and "polymarket-js" to find actively maintained implementations.