Home › Guides › Polymarket API, explained

Polymarket API, explained

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

ServiceBase URLWhat it's forAuth
Gammagamma-api.polymarket.comDiscover events and markets, metadata, slugs, token IDsNone
CLOBclob.polymarket.comPrices, order books, midpoints, placing and cancelling ordersNone to read; L2 to trade
Datadata-api.polymarket.comPositions, activity, market participation (cursor pagination)None for public data
Relayerrelayer-v2.polymarket.comSubmit wallet transactions gaslesslyWallet
WebSocket: marketws-subscriptions-clob.polymarket.com/ws/marketBook, price and lifecycle updatesNone
WebSocket: userws-subscriptions-clob.polymarket.com/ws/userYour orders and fillsL2
RTDSws-live-data.polymarket.comReference prices, comments, trade activityNone
Sportssports-api.polymarket.com/wsLive game status and scoresNone

Authentication, in order

  1. L1: your wallet signs an EIP-712 ClobAuth message proving control of the address. You send that signature to create (or derive, for an existing address and nonce) API credentials.
  2. Credentials: you get an apiKey, a base64 secret and a passphrase.
  3. L2: every private CLOB request carries a timestamp and an HMAC-SHA256 signature over the method, path and body, made with the secret.
  4. 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

  1. Gamma: list active events, pick a market, note its token IDs (one per outcome).
  2. CLOB: fetch the order book or midpoint for a token ID.
  3. 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.

Questions people ask

Is the Polymarket API free?

Yes. Reading markets, prices, order books and public activity needs no account or key. Trading needs a wallet and API credentials, which are also free; you pay only the trading fees and, without the relayer, Polygon gas.

Can I trade on Polymarket through the API?

On the global exchange, yes: orders are placed through the CLOB API with L2 authentication plus a wallet signature on each order. On Polymarket US (polymarket.us, the CFTC-regulated app) there's no public trading API as of October 2026.

Do I need a crypto wallet?

For trading, yes. Authentication starts with a signature from the private key that controls your Polygon address, and every order is signed by that wallet. Read-only use needs nothing.

Which languages have official clients?

Polymarket maintains official SDKs (Python and TypeScript are the main ones); community clients exist for Rust and others. Start with the official clients; the auth flow is fiddly to reimplement.