The Polymarket API is four REST services and a set of WebSocket feeds. Gamma gives you events and markets; CLOB gives you prices, order books and order placement; Data gives you positions and trade history; the Relayer lets you submit wallet transactions without holding POL for gas. Reading is open to anyone. Trading requires a Polygon wallet to sign an authentication message, which returns API credentials you then use to sign requests. This is the global exchange's API; the US app has no public trading API as of October 2026.
The pieces
| Service | Base URL | What it's for | Auth |
|---|---|---|---|
| Gamma | gamma-api.polymarket.com | Discover events and markets, metadata, slugs, token IDs | None |
| CLOB | clob.polymarket.com | Prices, order books, midpoints, placing and cancelling orders | None to read; L2 to trade |
| Data | data-api.polymarket.com | Positions, activity, market participation (cursor pagination) | None for public data |
| Relayer | relayer-v2.polymarket.com | Submit wallet transactions gaslessly | Wallet |
| WebSocket: market | ws-subscriptions-clob.polymarket.com/ws/market | Book, price and lifecycle updates | None |
| WebSocket: user | ws-subscriptions-clob.polymarket.com/ws/user | Your orders and fills | L2 |
| RTDS | ws-live-data.polymarket.com | Reference prices, comments, trade activity | None |
| Sports | sports-api.polymarket.com/ws | Live game status and scores | None |
Authentication, in order
- L1: your wallet signs an EIP-712
ClobAuthmessage proving control of the address. You send that signature to create (or derive, for an existing address and nonce) API credentials. - Credentials: you get an
apiKey, a base64secretand apassphrase. - L2: every private CLOB request carries a timestamp and an HMAC-SHA256 signature over the method, path and body, made with the secret.
- Orders: on top of L2, each order is itself signed by the wallet, because an order is an on-chain-settleable instruction.
The practical consequence: a bot needs a private key on the machine that runs it. Use a dedicated wallet with only the funds you're trading.
A minimal read-only workflow
- Gamma: list active events, pick a market, note its token IDs (one per outcome).
- CLOB: fetch the order book or midpoint for a token ID.
- WebSocket market channel: subscribe to the token to stream updates instead of polling.
None of that needs a key, which is why most Polymarket dashboards, Discord bots and odds trackers are built on Gamma plus the market WebSocket.
Before you build a trading bot
- Fees: takers pay a rate × P × (1 − P) that varies by category (0% on many markets, 4–7% on politics, sports, crypto); makers pay nothing. A bot that rests orders is structurally cheaper than one that crosses the spread. Details: Polymarket fees.
- Liquidity: thin books mean your own orders move the price. Check depth, not just the midpoint.
- Settlement rules: the market's resolution source is in the Gamma metadata; a bot that doesn't read it will eventually be surprised.
- Jurisdiction: the global exchange doesn't accept US users; the US app has no trading API. That's a legal line, not a technical one.
Kalshi's API, for comparison
Kalshi's API is a conventional REST/WebSocket service with RSA-signed requests, no wallet, dollar balances and official Python and TypeScript clients, and it's available to US users. If you're in the US and want to automate, that's the one: Kalshi API guide.
Source: docs.polymarket.com (Oct 2026). Endpoints and auth flow change; the docs govern.