Developers
    Home/Polymarket API

    Polymarket API: Developer Guide with Endpoints and Examples

    Polymarket has three REST APIs and a set of WebSocket feeds. Gamma finds markets, the CLOB gives prices and order books and takes orders, and the Data API covers wallets: trades, positions, PnL and leaderboards. Reading data is free and needs no key; only trading needs authentication. This guide shows which endpoint answers which question, with requests you can paste into a terminal.

    Every endpoint below was called live on December 5, 2026; limits, auth and SDKs are from the official Polymarket docs.

    The Polymarket APIs at a glance

    APIUse it forAuth
    Gamma API
    gamma-api.polymarket.com
    Find events and markets: questions, outcomes, prices, volume, token IDs, fee scheduleNone
    CLOB API
    clob.polymarket.com
    Order books, prices, price history; placing and canceling ordersNone to read, L1 + L2 to trade
    Data API
    data-api.polymarket.com/v2
    Wallets: trades, positions, activity, PnL, leaderboards, holders, open interestNone
    WebSockets
    ws-subscriptions-clob.polymarket.com and others
    Live order books and prices, your own orders, sports scores, reference pricesNone, except the user channel

    The data model: an event groups one or more markets; each market is a yes/no question identified by its conditionId; each outcome has its own token ID. You find markets on Gamma, then use the token ID on the CLOB and the condition ID on the Data API.

    1. Find markets: Gamma API

    The busiest open markets right now, sorted by 24-hour volume:

    curl --compressed "https://gamma-api.polymarket.com/markets?active=true&closed=false&order=volume24hr&ascending=false&limit=10"
    • /events returns events with their markets nested; /markets returns markets one by one. Both take limit up to 100 per call.
    • Filter by topic with tag_slug on /events (for example tag_slug=nba), or fetch known markets with condition_ids= (repeat the parameter). /public-search?q=bitcoin searches events by text.
    • offset stops around 2,000: beyond it Gamma answers 422 and points to /markets/keyset, which pages with a cursor.
    • outcomes, outcomePrices and clobTokenIds are JSON strings inside the JSON: parse them a second time. Prices are in dollars per share (0.221 = 22.1%).
    • Send Accept-Encoding: gzip (curl --compressed): Gamma can refuse uncompressed requests.

    Each market also carries its fee settings: feesEnabled and feeSchedule (rate, exponent, takerOnly). The taker fee per share is rate x (price x (1 - price))^exponent. Rates checked on live markets the same day: 0.05 for sports, elections, finance, tech and the 5 and 15 minute Bitcoin Up/Down markets, 0.01 for other crypto markets, other politics, economics and culture, all with exponent 1. The profit calculator applies them for you.

    2. Prices and order books: CLOB API

    Use the outcome's token ID (from clobTokenIds). All of these are public GETs:

    TOKEN=<token id>
    curl "https://clob.polymarket.com/book?token_id=$TOKEN"            # bids and asks
    curl "https://clob.polymarket.com/price?token_id=$TOKEN&side=buy"  # {"price":"0.219"}
    curl "https://clob.polymarket.com/midpoint?token_id=$TOKEN"        # {"mid":"0.22"}
    curl "https://clob.polymarket.com/spread?token_id=$TOKEN"
    curl "https://clob.polymarket.com/last-trade-price?token_id=$TOKEN"
    curl "https://clob.polymarket.com/prices-history?market=$TOKEN&interval=1d&fidelity=60"
    • /prices-history returns {"history":[{"t":<unix>,"p":<price>}, ...]}: the base for any price chart or backtest.
    • /markets/<conditionId> gives the trading constraints: minimum_order_size, minimum_tick_size, whether the book accepts orders.
    • POST /books takes a JSON list of {"token_id": ...} objects and returns every book in one call.

    3. Wallets, trades and leaderboards: Data API v2

    Every Polymarket trade settles on Polygon, so any wallet's history is public. The Data API serves it without scraping the chain:

    API=https://data-api.polymarket.com/v2
    curl "$API/leaderboard?time_period=month&sort_by=PNL&category=sports&limit=10"
    curl "$API/trades?user=<wallet>&limit=500"
    curl "$API/positions?user=<wallet>&status=OPEN"
    curl "$API/activity?user=<wallet>"          # trades, redeems, merges...
    curl "$API/value?user=<wallet>"             # value of open positions
    curl "$API/user-pnl?user=<wallet>&interval=1w&fidelity=1d"
    curl "$API/holders?condition=<conditionId>&limit=20"
    curl "$API/oi?condition=<conditionId>"      # open interest
    • Every v2 response wraps the payload in data; lists add pagination. Page with cursor=<pagination.next_cursor> until it is null. There is no offset: v2 rejects it with a 400.
    • Fields are snake_case (proxy_wallet, condition_id). Filter by market with condition (up to 20 ids), not market.
    • Leaderboard: time_period = day, week, month or all; sort_by = PNL or VOLUME; limit up to 1,000; category such as sports, crypto or politics.
    • /v2/positions covers the whole life of a position with status = OPEN, REDEEMABLE, REDEEMABLE_LOST, MERGEABLE or CLOSED. Losing positions never redeemed stay in REDEEMABLE_LOST, not CLOSED: count them, or win rates come out too high.
    • The old v1 routes (/trades, /positions without /v2) answer 410 Gone since November 2, 2026.

    Example: the biggest holders of the busiest market

    Three public calls, no key, runs as is in Node 18+ or a browser console:

    const gamma = "https://gamma-api.polymarket.com";
    const data = "https://data-api.polymarket.com/v2";
    
    const [m] = await (await fetch(`${gamma}/markets?active=true&closed=false&order=volume24hr&ascending=false&limit=1`)).json();
    const [yes] = JSON.parse(m.outcomePrices);
    console.log(m.question, "YES at", yes);
    
    const { data: rows } = await (await fetch(`${data}/holders?condition=${m.conditionId}&limit=5`)).json();
    for (const side of rows) {
      for (const h of side.holders) console.log(h.outcome_index === 0 ? "YES" : "NO", h.name || h.proxy_wallet, Math.round(h.amount), "shares");
    }

    From a holder's wallet, /v2/trades?user= shows how they built the position. That is the core of a wallet tracker or a copy trading bot; we walk through the second half in 40 lines of JS on dev.to.

    4. Real-time data: WebSockets

    • wss://ws-subscriptions-clob.polymarket.com/ws/market: public order book, price and market lifecycle updates.
    • wss://ws-subscriptions-clob.polymarket.com/ws/user: your own orders and trades (authenticated).
    • wss://sports-api.polymarket.com/ws: live game status and scores.
    • wss://ws-live-v2.polymarket.com/ws (PolyBolt): crypto, equity and TWAP reference prices.

    Polling is fine for wallets and leaderboards; for order books and fast markets, subscribe instead of hitting /book in a loop.

    5. Trading: authentication and SDKs

    Placing orders needs two layers of authentication on the CLOB:

    • L1: your wallet signs an EIP-712 message (chain ID 137, Polygon). With that signature you create or derive API credentials at /auth/api-key or /auth/derive-api-key: an API key, a secret and a passphrase.
    • L2: each private request is signed with HMAC-SHA256 over timestamp + method + path + body using the secret, and sent with five headers: POLY_ADDRESS, POLY_SIGNATURE, POLY_TIMESTAMP, POLY_API_KEY, POLY_PASSPHRASE.
    • Each order is also signed by the wallet itself. Orders spend pUSD, Polymarket's collateral token.

    Unless your language has no SDK, use the official ones: @polymarket/client for TypeScript and polymarket-client for Python. They handle signing, pagination and both market versions, and the docs' quickstart places a first market order in a few lines. Older integrations on the legacy CLOB clients have a migration guide in the same docs.

    Rate limits

    Limits are per IP, on sliding windows. Over a limit, Cloudflare delays requests instead of rejecting them, so a slow response usually means you are being throttled.

    Gamma /markets300 per 10 s
    Gamma /events500 per 10 s
    Data API, all /v2 routes800 per 10 s
    Data API /v2/trades300 per 10 s
    CLOB /book, /price, /midpoint1,500 per 10 s each
    CLOB /prices-history1,000 per 10 s
    CLOB POST /order5,000 per 10 s burst, 120,000 per 10 min

    Excerpt; the full table is in Polymarket's rate limit docs. Order and cancel requests also have per-signer limits.

    What you can build (and what we built)

    Polycool's free tools run on these same public endpoints: the wallet checker (Data API positions and trades), the copy trading simulator (trades plus Gamma prices and fee schedules, in your browser), the whale tracker, the trader profiles and the sport pages with live odds. If you would rather copy traders than build a bot, Polycool does it on iOS, Android and Telegram at 1% per trade: see how copy trading works.

    Polymarket API FAQ

    Is the Polymarket API free?

    Yes. Reading markets, prices, order books, trades, positions and leaderboards needs no account and no API key. Limits are per IP address (for example 300 requests per 10 seconds on Gamma's /markets); over the limit, Cloudflare slows requests down rather than rejecting them.

    Do I need an API key for the Polymarket API?

    Only to trade or to read your own orders. You sign a message with your wallet (L1) to create API credentials, then sign each private request with them (L2, HMAC-SHA256). The official SDKs do both for you.

    Is there a Polymarket API for Python?

    Yes. Polymarket publishes a unified Python SDK (polymarket-client) and a TypeScript SDK (@polymarket/client). For read-only data, plain HTTP requests with any library work too: every example on this page is a simple GET.

    How do I get historical prices from the Polymarket API?

    Call the CLOB's /prices-history with the outcome's token ID as market, an interval (1h, 6h, 1d, 1w, 1m or max) and a fidelity in minutes. It returns a list of {t, p} points: timestamp and price.

    Why does my old Polymarket Data API call return 410?

    Data API v1 was retired on November 2, 2026. Routes like /trades, /positions and /activity now answer 410 Gone. Add the /v2 prefix, read the payload from data, page with pagination.next_cursor and expect snake_case fields.

    How do I find a trader's wallet and trades with the API?

    Get wallets from /v2/leaderboard (by PnL or volume, per period and category), then read each one's trades from /v2/trades?user=<wallet> and positions from /v2/positions?user=<wallet>. Every trade is public on-chain, which is what makes copy trading possible.

    Polycool is not affiliated with Polymarket. Endpoints and limits change: check the official docs before shipping.