All posts
March 15, 20269 min readAPIDevelopersPolymarket

Polymarket API Explained: Building Trading Bots in 2026

Polymarket exposes two APIs that matter for building trading bots: the CLOB API for order placement and orderbook data, and the Gamma API for market metadata. Here's what each one does, where the gotchas are, and how to structure a bot around them.

CLOB API: orderbook and order placement

The CLOB (Central Limit Order Book) API is the primary interface for trading. It handles order placement, cancellation, fills, and orderbook snapshots. Orders are signed using an L2 API key derived from your wallet — you don't sign every order on-chain, which keeps latency and gas reasonable.

Key endpoints: GET /book (orderbook depth), POST /order (place), DELETE /order (cancel), GET /trades (your fills). The @polymarket/clob-client npm package wraps these with typed methods.

Gamma API: market metadata

Gamma is Polymarket's catalog service — it lists markets, categories, resolution dates, and outcome tokens. If you're building a scanner ("find all active politics markets with >$10k daily volume"), Gamma is what you query. It doesn't handle trading; it only describes what's tradeable.

Gamma data is near-real-time but occasionally lags the CLOB by a few seconds. For trading decisions, always cross-reference with the CLOB. Gamma's good enough for discovery and UI rendering.

On-chain events: the ground truth

For anything that needs to be verifiably real-time — like copy trading — the CLOB and Gamma APIs aren't enough. You want to subscribe to Polygon logs from Polymarket's CTF exchange contract directly. Every fill emits an event; you decode it, match it to a market via Gamma, and act.

This adds complexity (you need a Polygon RPC, log decoding, and reconciliation) but it's the only way to be sure you're not missing fills because of API rate limits or caching.

Rate limits and authentication

  • CLOB API: per-key rate limits; use L2 keys, not L1 signing, for hot paths
  • Gamma API: generous but not unlimited — cache aggressively
  • Polygon RPC: bring your own (Alchemy, QuickNode, or self-hosted) — public RPCs will throttle you

A minimal bot architecture

A solid architecture separates three loops: discovery (Gamma polling, fills a market cache), signal (subscribes to on-chain events or polls orderbooks), and execution (reads signals from a queue, places CLOB orders with retry/backoff). Keep them independent so one stall doesn't cascade.

Polybuild's own workers follow this pattern — copy-worker handles execution, discovery-worker builds the leaderboard, and a monitor-worker watches for drift.

Skip the build, use the platform

Polybuild exposes leaderboards, copy trading, and bot deployment without you touching the Polymarket API directly.

More from the blog