Polymarket splits its API by job. Gamma describes what exists: events, markets, questions, outcomes and dates. The CLOB (central limit order book) describes what is trading: bids, asks, prices, and the orders you send. Most integrations start with Gamma to find a market, then switch to the CLOB with that market's token IDs.

What the Polymarket API is

Two public HTTP services, each with its own base URL. Both serve JSON. The official Polymarket docs are the reference for parameters, response fields and limits; this guide covers the parts you need first.

ServiceBase URLUsed forAuth
Gamma APIgamma-api.polymarket.comEvents, markets, questions, outcomes, datesNone for reads
CLOB API, publicclob.polymarket.comOrder books, prices, midpointsNone for reads
CLOB API, tradingclob.polymarket.comPlacing and cancelling ordersWallet signature plus API credentials

The endpoints you will use first

Six endpoints cover discovery, pricing and order entry. Everything else in the docs builds on these.

EndpointServiceWhat it gives you
GET /eventsGammaEvents, each grouping one or more markets
GET /marketsGammaMarkets with question, identifiers, outcomes and prices
GET /bookCLOBThe order book for one outcome token
GET /priceCLOBThe best price for one token on one side
GET /midpointCLOBThe midpoint between best bid and best ask
POST /orderCLOBSubmits a signed order (authenticated)

Query parameters and field names change over time. Check the official docs before you hard-code either.

Read example: fetch active markets

This request asks Gamma for five markets that are open for trading. No key, no wallet, no signup.

curl -s 'https://gamma-api.polymarket.com/markets?active=true&closed=false&limit=5'

Keep the limit small while you explore. The response is a JSON array, one object per market. Most integrations need only a handful of its fields:

FieldWhat it holdsWhat you do with it
questionThe market's question textDisplay it and match it to your topic
conditionIdThe market's condition identifierKeep it as the stable ID for the market
clobTokenIdsOutcome token IDs, one per outcome, as a JSON-encoded stringPass a token ID to /book, /price or /midpoint
outcomes, outcomePricesOutcome labels and their last prices, as JSON-encoded stringsRead them in the same order as the token IDs
startDate, endDateWhen the market opened and when it is scheduled to endFilter by time left; store the time you fetched

Two details trip up first integrations. The list fields arrive as strings, so parse them before indexing. And the Gamma price is a snapshot; for a current bid, ask or midpoint, call the CLOB with the token ID, for example GET /midpoint?token_id=.... Inspect your own response rather than copying an identifier from an old example: markets open and close daily.

Authentication for orders

Reads are public because market data is public: anyone can see a book or a price. An order moves funds, so the CLOB needs proof that the request comes from the wallet that holds them.

The official docs describe two layers. First, the wallet's private key signs a message that creates or derives a set of API credentials (a key, a secret and a passphrase). Second, each trading request carries headers signed with those credentials, and each order is itself signed by the wallet before it is sent to POST /order. The official client libraries handle both signatures; the docs list the current libraries and the signature types for different wallet setups.

  • Reads: no key, no wallet, no credentials.
  • Orders: a funded wallet, API credentials derived from it, and a signed order.
  • Keys: keep the private key out of code, prompts and repositories. Load it from a secret store.

Access to trading also depends on Polymarket's terms and where you are. Our guide to whether Polymarket is legal covers the jurisdiction question.

Raw API vs NickAI Polymarket node

The raw API gives full control and full responsibility. NickAI wraps the same APIs in two workflow nodes, so the parts you would script become settings you can inspect.

TaskRaw APINickAI Polymarket nodes
DiscoveryCall Gamma /events or /markets, page through results, parse the JSON-encoded fieldsPolymarket Data node in Browse, Search or Lookup mode, with normalized markets and YES/NO token IDs
Price checks on a scheduleYour own cron job calls /price or /midpoint and stores each resultSnapshot, History or Depth mode on a built-in schedule
Order placementDerive credentials, sign each order, send it, handle rejectionsPolymarket Order node, signing through a Polymarket Wallet credential
GuardrailsThe checks you write and maintainConditional and Function nodes before the order node; inactive drafts
Code requiredYesNo

Use it without code

NickAI keeps reading and trading in separate nodes, so a monitor cannot place an order by accident.

The Polymarket Data node wraps both read APIs in six modes. Browse, Search and Lookup find markets through Gamma. Snapshot, History and Depth fetch live pricing, price history and order book depth through the CLOB. It needs no key and no wallet, and its output feeds an LLM, Function or Conditional node downstream.

The Polymarket Order node is the separate, authenticated action. It signs through a Polymarket Wallet credential; per the node docs, that agent key is limited to trading, so funds cannot leave the wallet without your signature. Orders are fill-or-kill market orders, and the node reports success only once the fill is confirmed.

You do not wire these by hand. Describe the job to Nick, for example: "Every morning, list the five most active politics markets with their midpoint, and email me a summary. No order node." Nick builds the workflow as a draft; inspect each node, run it once, then schedule it. The Polymarket integration page and the prediction market agent use case show more designs, and our Polymarket workflow walkthrough builds a read-only monitor step by step.

Comparing approaches first? See the prediction market automation tools roundup.

Try it for free now: getnick.ai