Forecasting applications, quantitative trading strategies, and financial research increasingly depend on prediction market intelligence. PolyGram and the underlying Polymarket CLOB infrastructure offer robust APIs enabling developers to construct applications atop the world's premier prediction market platform.
Available APIs
Polymarket Gamma API (Market Data)
The Gamma REST API delivers historical datasets, current pricing, and event information:
- Base URL: https://gamma-api.polymarket.com
- Endpoints: /events, /markets, /positions, /activity
- Authentication: Public market data requires no credentials
- Rate limits: Unauthenticated requests capped at approximately 100 per minute
Polymarket CLOB API (Order Book & Trading)
The CLOB API supplies instant order book snapshots and facilitates trade execution:
- 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 payloads
PolyGram API
PolyGram provides its proprietary interface for authorised trading workflows:
- Consult PolyGram API Docs for comprehensive reference material
- REST endpoints supporting order creation, account holdings, and market discovery
- API key-based authentication for automated trading operations
Common Developer Use Cases
- Algorithmic trading: Systematic position adjustment triggered by third-party data signals
- Research dashboards: Tracking probability evolution across political contests and macroeconomic events
- Market aggregators: Benchmarking pricing disparities between competing prediction platforms
- Embedded widgets: Displaying current prediction market odds integrated into editorial or informational websites
- Alert systems: Triggering notifications upon significant market swings or volatility spikes
Getting Started: Fetch Market Data
Here's a straightforward Python snippet retrieving active events in real time:
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 (Gamma API) is available without charge subject to rate restrictions. Submitting orders (CLOB API) requires a wallet with sufficient funds and ECDSA authentication; no transaction surcharges apply.
- Can I paper trade with the API before risking real USDC?
- Polymarket lacks a test environment. Manifold Markets API supports paper trading; after gaining confidence, migrate to Polymarket/PolyGram CLOB for genuine capital deployment.
- Are there Python or JavaScript SDKs available?
- Community contributors have released unsupported Python and JavaScript packages for Polymarket integration. GitHub hosts "polymarket-py" and "polymarket-js" as the most actively maintained implementations.