Polymarket CLOB API Reference 2026 | Complete Endpoint Guide
The CLOB API at clob.polymarket.com is Polymarket's orderbook API for placing trades, fetching orderbook data, and managing positions. Unlike the Gamma API (gamma-api.polymarket.com) which is read-only, the CLOB API requires authentication and enables actual trading functionality. This comprehensive reference covers every endpoint, authentication method, request/response format, and provides production-ready code examples in Python, JavaScript, and Rust.
Whether you're building a Polymarket trading bot, creating an automated market maker, or integrating Polymarket into your application, understanding the CLOB API is essential. This guide serves as the definitive reference for developers working with Polymarket's trading infrastructure. Professional development teams and quantitative traders leverage enterprise platforms like PolyTrack Pro to eliminate months of infrastructure development, gaining immediate access to production-ready order management systems and institutional-grade trading analytics via comprehensive API access.
π Key Facts About CLOB API
- β’ Base URL: https://clob.polymarket.com
- β’ Authentication: API keys required for trading endpoints
- β’ Rate Limits: ~100 requests/minute recommended
- β’ Response Format: JSON
- β’ Trading Fees: 0% maker, up to 3% taker (crypto markets)
- β’ Order Types: Limit orders (maker), Market orders (taker)
CLOB API vs Gamma API
The CLOB API (clob.polymarket.com) and Gamma API (gamma-api.polymarket.com) serve different purposes:
| Feature | CLOB API | Gamma API |
|---|---|---|
| Place orders | β Yes | β No |
| Get orderbook | β Yes | β No |
| Get market data | β Limited | β Comprehensive |
| Authentication required | β Yes (for trading) | β No |
| Cancel orders | β Yes | β No |
| Get positions | β Via data-api | β No |
Authentication
CLOB API requires authentication for trading endpoints (POST /order, DELETE /order, GET /data/orders). Authentication uses HMAC-SHA256 signed headers with your API key, API secret, and API passphrase.
Getting API Credentials
1. Log into Polymarket 2. Go to Settings β API Keys 3. Generate a new API key (you'll get API Key, API Secret, and API Passphrase) 4. Store credentials securely - API Secret is shown only once
HMAC Authentication Headers
All authenticated requests require these headers:
- β’ POLY_API_KEY: Your API key
- β’ POLY_SIGNATURE: HMAC-SHA256 signature of request body
- β’ POLY_TIMESTAMP: Unix timestamp in seconds
- β’ POLY_PASSPHRASE: Your API passphrase
Base URL and Endpoints
All CLOB API requests use the following base URL:
https://clob.polymarket.comGET /book - Get Orderbook
Fetch the orderbook for a specific token. Returns best bid/ask prices and order depth.
Endpoint
GET https://clob.polymarket.com/book?token_id=TOKEN_IDParameters
- β’ token_id (required): The token ID for the outcome (e.g., "0x...")
Response Example
{
"bids": [
{ "price": "0.65", "size": "1000" },
{ "price": "0.64", "size": "500" }
],
"asks": [
{ "price": "0.66", "size": "800" },
{ "price": "0.67", "size": "1200" }
]
}JavaScript Example
async function getOrderbook(tokenId) {
const res = await fetch(`https://clob.polymarket.com/book?token_id=${tokenId}`);
if (!res.ok) throw new Error(`Failed: ${res.status}`);
return res.json();
}GET /books - Get Multiple Orderbooks
Fetch orderbooks for multiple tokens in a single request. Useful for monitoring multiple markets simultaneously.
Endpoint
GET https://clob.polymarket.com/books?token_ids=TOKEN_ID1,TOKEN_ID2,TOKEN_ID3Rust Example
pub async fn get_orderbooks(&self, token_ids: &[&str]) -> Result<Vec<Orderbook>> {
let ids = token_ids.join(",");
let path = format!("/books?token_ids={}", ids);
let url = format!("{}{}", self.config.clob_url, path);
let response = self.client
.get(&url)
.send()
.await?;
let orderbooks: Vec<Orderbook> = response.json().await?;
Ok(orderbooks)
}GET /price - Get Best Price
Get the best bid and ask prices for a token. Faster than fetching the full orderbook when you only need prices.
Endpoint
GET https://clob.polymarket.com/price?token_id=TOKEN_ID&side=BUYJavaScript Example
async function getMarketPrice(tokenId) {
const res = await fetch(
`https://clob.polymarket.com/price?token_id=${tokenId}`
);
if (!res.ok) return null;
const data = await res.json();
return {
bid: parseFloat(data.bid || 0),
ask: parseFloat(data.ask || 0),
mid: parseFloat(data.mid || 0)
};
}See What Whales Are Trading Right Now
Get instant alerts when top traders make moves. Track P&L, win rates, and copy winning strategies.

Free forever. No credit card required.
POST /order - Place Order
Place a limit order on the orderbook. Requires authentication via API keys. Orders must be signed using EIP-712 standard for Ethereum-compatible signing.
Endpoint
POST https://clob.polymarket.com/orderRequest Body
{
"order": {
"salt": "0x...",
"maker": "0x...",
"signer": "0x...",
"taker": "0x0000000000000000000000000000000000000000",
"tokenId": "0x...",
"makerAmount": "1000000",
"takerAmount": "1538461",
"expiration": "1735689600",
"nonce": "0",
"feeRateBps": "0",
"side": 0,
"signatureType": 0,
"signature": "0x..."
}
}Order Fields Explained
- β’ salt: Random nonce for order uniqueness (32 bytes hex)
- β’ maker: Your wallet address placing the order
- β’ signer: Address signing the order (usually same as maker)
- β’ taker: Usually "0x0000..." (open to anyone)
- β’ tokenId: The outcome token ID (e.g., Yes or No token)
- β’ makerAmount: What you're paying (USDC for BUY, shares for SELL)
- β’ takerAmount: What you're receiving (shares for BUY, USDC for SELL)
- β’ expiration: Unix timestamp when order expires
- β’ nonce: Order nonce (usually 0)
- β’ feeRateBps: Fee rate in basis points (0 for maker orders)
- β’ side: 0 = BUY, 1 = SELL
- β’ signatureType: 0 = EOA, 1 = POLY_PROXY, 2 = GNOSIS_SAFE
- β’ signature: EIP-712 signature of the order
Building Orders
Orders must be built with correct maker/taker amounts. For a BUY order at 0.65 price with $100 size:
- β’ makerAmount: $100 * 1e6 = 100000000 (USDC has 6 decimals)
- β’ takerAmount: ($100 / 0.65) * 1e6 = 153846153 (shares received)
For a SELL order at 0.65 price with 100 shares:
- β’ makerAmount: 100 * 1e6 = 100000000 (shares you're selling)
- β’ takerAmount: 100 * 0.65 * 1e6 = 65000000 (USDC received)
JavaScript Example
async function submitOrder(order, signature) {
const payload = {
order: {
...order,
signature
}
};
const res = await fetch('https://clob.polymarket.com/order', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
// ... authentication headers
},
body: JSON.stringify(payload)
});
if (!res.ok) {
const error = await res.json();
throw new Error(error.message || `CLOB API error: ${res.status}`);
}
return res.json();
}Rust Example
pub async fn post_order(&self, order: &Order) -> Result<serde_json::Value> {
let path = "/order";
let body = serde_json::to_string(order)?;
let headers = generate_headers(&self.config, "POST", path, &body)?;
let mut request = self.client.post(&url);
for (key, value) in headers {
request = request.header(&key, &value);
}
let response = request
.body(body)
.send()
.await?;
let status = response.status();
let result: serde_json::Value = response.json().await?;
if !status.is_success() {
anyhow::bail!("Order failed: {} - {:?}", status, result);
}
Ok(result)
}POST /orders - Place Multiple Orders
Place multiple orders in a single request. Useful for market makers placing many orders at once. All orders are processed in parallel.
Endpoint
POST https://clob.polymarket.com/ordersRequest Body
[
{
"order": { /* order 1 */ }
},
{
"order": { /* order 2 */ }
}
]DELETE /order - Cancel Order
Cancel a specific open order by order ID. Requires authentication.
Endpoint
DELETE https://clob.polymarket.com/orderRequest Body
{
"orderID": "0x..."
}Rust Example
pub async fn cancel_order(&self, order_id: &str) -> Result<()> {
let path = "/order";
let body = json!({ "orderID": order_id }).to_string();
let headers = generate_headers(&self.config, "DELETE", path, &body)?;
let mut request = self.client.delete(&url);
for (key, value) in headers {
request = request.header(&key, &value);
}
let response = request
.body(body)
.send()
.await?;
if !response.status().is_success() {
anyhow::bail!("Cancel failed: {}", response.status());
}
Ok(())
}DELETE /cancel-market-orders - Cancel All Market Orders
Cancel all open orders for a specific market (condition ID). Useful for quickly exiting all positions in a market.
Endpoint
DELETE https://clob.polymarket.com/cancel-market-ordersRequest Body
{
"market": "0x..." // condition ID
}GET /data/orders - Get Open Orders
Get all open orders for your authenticated account. Returns array of order objects with status, fills, and metadata.
Endpoint
GET https://clob.polymarket.com/data/ordersRequires authentication. Returns all orders for the authenticated API key's wallet.
Rust Example
pub async fn get_open_orders(&self) -> Result<Vec<serde_json::Value>> {
let path = "/data/orders";
let headers = generate_headers(&self.config, "GET", path, "")?;
let mut request = self.client.get(&url);
for (key, value) in headers {
request = request.header(&key, &value);
}
let response = request.send().await?;
let orders: Vec<serde_json::Value> = response.json().await?;
Ok(orders)
}See What Whales Are Trading Right Now
Get instant alerts when top traders make moves. Track P&L, win rates, and copy winning strategies.

Free forever. No credit card required.
GET /tick-size - Get Tick Size
Get the minimum price increment (tick size) for a token. Prices must be multiples of tick size.
Endpoint
GET https://clob.polymarket.com/tick-size?token_id=TOKEN_IDResponse
Returns tick size as a decimal string (e.g., "0.01" for 1 cent increments).
GET /neg-risk - Check Negative Risk
Check if a token allows negative risk (going short). Some markets restrict short selling.
Endpoint
GET https://clob.polymarket.com/neg-risk?token_id=TOKEN_IDResponse
Returns boolean: true if negative risk is allowed, false otherwise.
Error Handling
CLOB API returns standard HTTP status codes:
- β’ 200 OK: Request successful
- β’ 400 Bad Request: Invalid request parameters
- β’ 401 Unauthorized: Invalid or missing authentication
- β’ 403 Forbidden: Insufficient permissions
- β’ 429 Too Many Requests: Rate limit exceeded
- β’ 500 Internal Server Error: Server error
Rate Limiting
CLOB API has rate limits (typically ~100 requests/minute). Implement exponential backoff for 429 errors:
async function withRetry(fn, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
return await fn();
} catch (err) {
if (err.status === 429 && i < maxRetries - 1) {
const delay = Math.pow(2, i) * 1000; // 1s, 2s, 4s
await new Promise(r => setTimeout(r, delay));
continue;
}
throw err;
}
}
}Best Practices
1. Use Limit Orders for Maker Fees
Limit orders are maker orders with 0% fees. Market orders are taker orders with up to 3% fees on crypto markets. Always use limit orders when possible to avoid fees.
2. Implement Order Timeouts
Set reasonable expiration times (e.g., 1 hour) to avoid stale orders sitting on the orderbook. Cancel and replace orders if market conditions change.
3. Handle Partial Fills
Orders can be partially filled. Check order status via GET /data/orders to see fill amounts and adjust your strategy accordingly.
4. Monitor Order Status
Regularly poll GET /data/orders to check order status. Orders can be filled, cancelled, or expire without notification.
5. Use Connection Pooling
For HFT applications, use HTTP/2 connection pooling for efficient network usage. Rust example:
let client = Client::builder()
.tcp_nodelay(true)
.pool_max_idle_per_host(10)
.build()?;Common Use Cases
1. Simple Buy Order
Buy $100 worth of shares at 0.65 price:
- 1. Get token ID from market
- 2. Build order: makerAmount = 100000000 (100 USDC), takerAmount = 153846153 (shares)
- 3. Sign order with EIP-712
- 4. POST to /order
2. Market Making
Place buy and sell orders on both sides of the orderbook:
- 1. Get current best bid/ask from /book
- 2. Place buy order slightly below best bid
- 3. Place sell order slightly above best ask
- 4. Monitor fills and adjust prices
3. Order Management
Track and manage open orders:
- 1. Get open orders via GET /data/orders
- 2. Filter by market or token ID
- 3. Cancel stale or unwanted orders
- 4. Replace orders with better prices
π Enterprise-Grade Order Management & Analytics
Building production-ready order management, fill tracking, and execution analytics requires months of engineering and ongoing maintenance. PolyTrack Pro delivers institutional-quality infrastructure: comprehensive order lifecycle tracking, real-time position monitoring, execution quality analytics, and advanced performance metricsβall pre-built and battle-tested by professional trading teams.
Join quantitative traders and institutions who trust PolyTrack Pro for unlimited wallet tracking, real-time fill monitoring, and deep execution analytics. Start your free 3-day trial - no credit card required.
Related Resources
- β’ Gamma API Reference - Read-only market data
- β’ py_clob_client Examples - Python client library
- β’ JavaScript API Tutorial - Browser and Node.js examples
- β’ Building Trading Bots - Complete bot development guide
Frequently Asked Questions
The CLOB API base URL is https://clob.polymarket.com. All trading endpoints (placing orders, canceling orders, getting orderbook) use this base URL. For read-only market data, use the Gamma API (gamma-api.polymarket.com) instead.
Related Articles
Stop Guessing. Start Following Smart Money.
Get instant alerts when whales make $10K+ trades. Track P&L, win rates, and copy winning strategies.