The Polymarket API is the programmatic interface to Polymarket's Central Limit Order Book, the CLOB — it's how you read live order books, place and cancel orders, and pull market metadata without touching the web UI. It's split across two services that work together: the CLOB API for trading and real-time order book data, and the Gamma API for market and event discovery.
If you're evaluating whether to build on it, the short version is: it's a real on-chain order book with settlement in USDC on Polygon, authentication is wallet-based rather than a simple API key, and the WebSocket feed needs the same defensive handling every exchange feed does. Here's what actually matters before you start building.
What the Polymarket API actually gives you
Two services, not one. The CLOB API handles order books, order placement, cancellation, and trade history — everything that touches your position. The Gamma API is a read-only layer for market and event metadata: titles, resolution dates, categories, and the token IDs each outcome trades under. Almost every serious integration uses both: Gamma to discover what's tradeable, CLOB to actually trade it.
Authentication: a signed wallet, not a username and password
Polymarket doesn't have accounts in the traditional sense. You trade from a non-custodial Ethereum wallet, and every authenticated CLOB request — placing an order, cancelling one, checking your positions — is signed using EIP-712 typed data, the same signing standard used across most of DeFi. You derive an API key and secret from your wallet once and use that pair for subsequent requests, but the wallet signature is what ultimately authorizes anything that touches funds. This is a different mental model from a typical retail brokerage API, and it's the first thing that trips up developers coming from a REST-and-API-key background.
The CLOB: two outcome tokens, not a coin flip
Every binary market has two outcome tokens — the on-chain representation of YES and NO — each with its own token ID and its own order book. The two books mirror each other: buying YES at 47 cents is economically the same trade as selling NO at 53 cents. Order types are the standard set — good-till-cancelled, fill-or-kill, and good-till-date — matched off-chain for speed, with settlement finalized on-chain.
Rate limits and the WebSocket feed
REST calls to the CLOB are rate-limited per endpoint, and like every exchange API, polling aggressively for near-real-time order book state is the wrong tool for the job — that's what the WebSocket feed exists for. It pushes order book and price-level updates as they happen. The same rule that applies to every trading WebSocket applies here: the connection needs its own keepalive and resubscribe logic after a reconnect, because a silently dropped socket and a genuinely quiet market look identical from the outside. A bot that can't tell the difference will happily trade on stale prices.
Gamma API: finding what's actually tradeable
Gamma is where you discover markets and events — search by category, filter by close date, pull the two token IDs a binary market trades under. It's also where a lot of the practical friction lives: Polymarket lists a large and constantly changing universe of markets, many with thin or zero liquidity, and Gamma's pagination and filtering determine how much of that universe you actually see. A client that only reads the first page of results, or sends an unsupported filter parameter, can silently fall back to a much smaller slice of the market universe with no error thrown.
Building a bot vs using a hosted agent
Building directly on the Polymarket API gets you full control over execution, but the wallet-signing flow, WebSocket reconnect handling, and outcome-token bookkeeping are all real engineering work before you've traded a single contract — and if your goal is arbitrage against another venue like Kalshi, you still have to solve the harder problem of matching Polymarket's markets to equivalent events elsewhere, which almost never share identical titles or resolution wording. See our guide to the Kalshi API for what that side of the pair looks like. A hosted platform like Arbitrage Agent handles both connections, AI matching with every pair validated, and net-edge calculation after fees, so you're evaluating opportunities instead of debugging a signature.
Common pitfalls when building on the Polymarket API
- Treating the wallet signature as optional: it works for read-only Gamma calls and fails silently, or with a confusing auth error, the moment you try to place an order.
- Assuming one order book per market: forgetting a binary market has two outcome tokens that should mirror each other leads to bugs that only show up when the two sides drift apart.
- Polling REST for book depth the WebSocket already pushes: this burns your rate limit and adds latency for no benefit.
- Ignoring thin liquidity: Polymarket's long tail of markets has genuine order books with very little depth, and an order sized against the top-of-book price alone can move the market against itself.
Should you build on the API directly?
If you're building a single-platform strategy specific to Polymarket and you're comfortable owning wallet signing, reconnect logic, and outcome-token bookkeeping, the API is solid and well-documented enough to build on directly. If your goal is cross-platform arbitrage against Kalshi, the API integration is the easy part — matching, spread calculation, and execution timing across two exchanges with completely different auth models is the hard part, and that's what a purpose-built agent already solves. Arbitrage Agent's Starter plan ($29/month) runs in dry-run mode so you can see real detected spreads before committing capital, or join the waitlist for early access.
Related articles
- The Kalshi API Explained: Endpoints, Rate Limits and Trading Automation (2026)
- Polymarket Trading Bot Guide 2026: Arbitrage vs Directional Bots
- Kalshi vs Polymarket: Fees, Liquidity & Which Is Better for Arbitrage (2026)
- Do You Need a VPS for Prediction Market Arbitrage? (2026)
- Polymarket Fees Explained: What You Actually Pay in 2026
Key terms: CLOB (Central Limit Order Book) · Non-Custodial · Binary Event Market