← Polymarket Tool Guides

Polymarket API Endpoints: Gamma, CLOB and Data

Three hosts answer different questions. Gamma at https://gamma-api.polymarket.com discovers events and markets; CLOB at https://clob.polymarket.com serves public outcome-token books and separately authenticated order actions; Data API v2 at https://data-api.polymarket.com/v2 serves public positions, activity and rankings. These are provider-documented paths, not endpoints operated by Polytoolhub.

Choose by task and access boundary

For market discovery use public Gamma GET /markets/keyset?closed=false&limit=1. For a CTF outcome book use public CLOB GET /book?token_id={outcome token ID}. For a public trader ranking use Data GET /v2/leaderboard?time_period=day&limit=1. Wallet positions and activity are separate Data reads; CLOB account-order management requires authentication. No account credentials are needed for the three public requests described here.

Keep identifiers in their own columns

An event groups markets. Gamma id identifies the market metadata record; conditionId identifies the on-chain condition. In the sampled CTF market, outcomes and clobTokenIds were JSON-encoded arrays aligned by index. Parsing both linked the Yes label to its token. The returned CLOB book.market matched Gamma conditionId and book.asset_id matched that token. Keep these values separate from the numeric Gamma id; check the protocol version and available fields instead of assuming every market uses this CTF mapping.

A public market-to-book check

Polytoolhub requested one open market from https://gamma-api.polymarket.com/markets/keyset?closed=false&limit=1, then requested its selected outcome token from https://clob.polymarket.com/book. Both returned HTTP 200 without authentication. Gamma returned a markets array plus next_cursor; CLOB returned matching identifiers, bids, asks and a timestamp. This demonstrates one public CTF handoff, not authenticated trading or ongoing availability. Repeating it can return a different market, an empty result or an unavailable book; do not keep the sampled price as a current quote.

Trader ranking is not builder attribution

Data GET /v2/leaderboard?time_period=day&limit=1 returned HTTP 200 with one user_id ranking row and a data/pagination envelope, including has_more and next_cursor. This was only the first page. The separately documented /v2/builders/leaderboard ranks integrations using builder_code; it was not part of the live check. Preserve the selected metric, period and units rather than equating trader profit with builder-attributed volume.

Before you start

  • Decide whether the task is market discovery, one outcome's book, a public wallet's holdings/activity or a trader-versus-builder ranking.
  • For books obtain a token ID from the same Gamma market and check its book status; keep that market's Gamma id and conditionId separate.
  • For wallet reads use a public proxy-wallet address you are entitled to examine; never submit addresses, wallet secrets, signatures or keys to Polytoolhub. The cited public reads do not require an account.

Follow the steps

  1. Discover a market on Gamma

    Input: A market discovery task or a known Gamma market id; no wallet credentials.

    Action: Request Gamma GET /markets/keyset?closed=false&limit=1 and read the markets array. Check question, status and protocol-specific identifiers before choosing an outcome.

    Expected result: Observed: one market and a continuation cursor. Future responses may differ or be empty.

    Choose another tool from Polymarket APIs and Data Providers

    Check the result

    • Check the keyset object and markets array; do not treat it as a bare-array route.

    Limitations

    • An empty result or market without an enabled book is not evidence of a current tradable market.
  2. Select an outcome identifier

    Input: One Gamma market object with id, conditionId, outcomes and clobTokenIds.

    Action: Parse the JSON-encoded outcome-label and token-id arrays; match by index. Retain Gamma market id and on-chain conditionId separately from the selected token ID.

    Expected result: A documented mapping: Gamma market id for lookup, conditionId for Data condition filters and one outcome token ID for a CLOB book; not interchangeable identifiers.

    Choose another tool from Polymarket APIs and Data Providers

    Check the result

    • Check array lengths and label/token pairing; stop if a selected outcome lacks its token.

    Limitations

    • The checked mapping is for a CTF market. Stop if label/token arrays are missing, misaligned or unsuitable for the selected protocol.
  3. Distinguish a public book from private orders

    Input: The selected outcome token ID and a decision to read a book or the operator's own open orders.

    Action: Consult clob.polymarket.com public GET /book?token_id={token ID} for bids/asks, market, asset_id and timestamp; for private GET /data/orders read the official L2 HMAC request-signing requirements instead of sending a request.

    Expected result: Observed: a public book with matching market and asset_id. Private account operations remain untested.

    Choose another tool from Polymarket APIs and Data Providers

    Check the result

    • For a returned book, match asset_id to the token and market to conditionId; reading a book never proves a signed order worked.

    Limitations

    • A missing book can return an error. No credential was created or used; order submission needs an additional wallet signature and was not tested.
  4. Select a public Data API v2 read

    Input: A public proxy-wallet address for positions/activity, or a conditionId for market-scoped reads; no API key.

    Action: Consult data-api.polymarket.com GET /v2/positions?user={proxy wallet}&limit=1 for holdings or GET /v2/activity?user={proxy wallet} for actions. Use condition, not Gamma market id, for an on-chain market filter.

    Expected result: Documented expectation: a data array plus pagination.next_cursor for paged routes; position rows include condition_id and token_id, and an empty array is possible. No wallet data was queried.

    Choose another tool from Polymarket APIs and Data Providers

    Check the result

    • Compare condition_id to Gamma conditionId and token_id to the selected outcome, and follow next_cursor until null.

    Limitations

    • Public address data is not private order state or an attributed human identity. Positions default to OPEN, not all closed holdings.
  5. Separate trader and builder boards

    Input: A ranking question, time window and entity type (trader wallet or builder integration).

    Action: Compare Data GET /v2/leaderboard?time_period=day&limit=1 (trader PNL or VOLUME) with GET /v2/builders/leaderboard?time_period=day&limit=1 (builder-attributed volume and active users).

    Expected result: Observed on the trader route: one data row, has_more and next_cursor. The builder route remains documentation-only.

    Choose another tool from Polymarket APIs and Data Providers

    Check the result

    • Label wallet versus builder_code, requested window and PNL versus VOLUME, and use next_cursor rather than a page number.

    Limitations

    • Daily marked PnL and all-time realized PnL differ; volume is in shares, not USD or guaranteed profit. Rankings do not identify people or establish integrations.

Check the result

  • Name the exact host and path for your task and distinguish documented public GET from private credentialed CLOB actions.
  • Keep Gamma id, conditionId and a labeled outcome token ID distinct; compare CLOB book market to conditionId and asset_id to that token ID.
  • For paged Data v2 reads expect data plus pagination and follow next_cursor until null, but do not report these documented shapes as locally observed.
  • For rankings state whether the row is a trader user_id or a builder_code and name its window and metric.

Limitations

  • The live check covered one Gamma keyset page, its selected CTF book and one Data trader-ranking page. It did not test wallet accounting, all pages, private requests, signatures, orders or service latency.
  • Market identifiers, books and rankings change. A successful response is a point-in-time observation, not a guarantee of complete history or future availability.
  • Public Data API wallet activity is not private CLOB order state; CLOB order management has a separate authentication boundary, and order placement also requires a wallet signature.
  • Paged Data v2 reads use opaque cursors; pagination.offset is display metadata, not a request parameter. Check filters, defaults, limits and empty results per endpoint.

Continue with official documentation

Continue researching