01.Polymarket's Three Main APIs
Polymarket provides three distinct APIs, each serving a different purpose. Understanding which one to use is the first step.
- CLOB API (Central Limit Orderbook): real-time orderbook data, order placement, fills, and market prices. Use this for trading bots and live price feeds.
- Gamma API: market metadata, events, conditions, resolution data, and market discovery. Use this to list markets, get event details, and understand resolution criteria.
- Data API: historical trade data, portfolio positions, PnL, and user activity by wallet address. Use this for analytics and personal portfolio tracking.
02.Getting Started — No API Key Required
Most Polymarket API endpoints are public and require no authentication. You can start querying immediately.
- CLOB API base URL: https://clob.polymarket.com — no key needed for public market data.
- Gamma API base URL: https://gamma-api.polymarket.com — markets, events, and conditions are all public.
- Data API base URL: https://data-api.polymarket.com — trade history and positions are public.
- For order placement via CLOB, you need a signing key derived from your wallet.
03.Common Requests and What They Return
Here are the most useful endpoints for each API.
- GET /markets (Gamma) — returns all active markets with title, question, end date, and conditions.
- GET /book?token_id=X (CLOB) — returns the current orderbook (bids and asks) for a market token.
- GET /last-trade-price?token_id=X (CLOB) — returns the most recent trade price.
- GET /activity?user=0xWALLET (Data) — returns trade history for a wallet address.
- GET /positions?user=0xWALLET (Data) — returns current open positions and unrealized PnL.
04.SDKs and Wrappers
Using raw HTTP requests works, but SDKs and community wrappers reduce boilerplate and handle authentication and WebSocket reconnection for you.
- Official Python client: py-clob-client — handles CLOB API authentication, order signing, and REST requests.
- TypeScript clients: multiple community libraries wrap the CLOB and Gamma APIs for Node.js.
- Community wrappers: search PolyCatalog for SDKs tagged "python", "typescript", "clob-api", or "gamma-api".
05.Rate Limits and Best Practices
Polymarket APIs are public but not unlimited. Following best practices keeps your application reliable.
- Cache responses where possible — market metadata changes slowly; orderbooks change fast.
- Use WebSocket connections for real-time price data instead of polling the REST endpoints.
- Respect rate limits — aggressive polling can get your IP rate-limited.
- Store API responses locally for historical analysis to avoid re-fetching the same data.