Forecasting applications, quantitative trading strategies, and financial research increasingly rely on prediction market data streams. PolyGram and the underlying Polymarket CLOB infrastructure make available robust 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, market valuations, and event catalogues:
- Base URL: https://gamma-api.polymarket.com
- Endpoints: /events, /markets, /positions, /activity
- Authentication: Public market data requires no credentials
- Rate limits: Approximately 100 requests per minute without authentication
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 market streams
- Authentication: Order placement demands ECDSA-signed message authentication
PolyGram API
PolyGram offers its proprietary API for verified trading workflows and account management:
- Comprehensive documentation accessible at PolyGram API Docs
- REST endpoints supporting order execution, account balances, and market discovery
- API key-based authentication for automated trading workflows
Common Developer Use Cases
- Algorithmic trading: Systematic position adjustments triggered by external data sources
- Research dashboards: Tracking forecast evolution across political or macroeconomic markets
- Market aggregators: Displaying odds comparisons between multiple prediction platforms
- Embedded widgets: Integrating live market odds into publisher websites and editorial platforms
- Alert systems: Triggering notifications when market movements exceed configured thresholds
Getting Started: Fetch Market Data
This Python snippet demonstrates retrieving current event listings:
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 (Gamma API) carries no cost subject to rate limits. Trading operations (CLOB API) require wallet funding and ECDSA authentication; no transaction surcharges apply beyond standard blockchain costs.
- Can I paper trade with the API before risking real USDC?
- Polymarket lacks a testnet or sandbox. Developers should explore Manifold Markets API for simulated trading, then deploy to Polymarket/PolyGram CLOB for production markets.
- Are there Python or JavaScript SDKs available?
- Community-maintained libraries exist for both languages. Consult GitHub repositories "polymarket-py" and "polymarket-js" to identify actively supported implementations.