Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a Polymarket trading bot, use Gamma to discover markets, the CLOB API to read tradable prices and manage orders, and the Data API to inspect positions and activity. Add the market WebSocket for live book changes and the user WebSocket for account order and trade updates. Public market reads do not require credentials; private CLOB requests and order placement do.

Which Polymarket API should a trading bot use?

Polymarket exposes several interfaces rather than one all-purpose trading API. Choose each by the job it performs; the official API documentation lists these REST and streaming surfaces.

Surface What it is for When a bot uses it
Gamma API
https://gamma-api.polymarket.com
Event and market discovery, metadata Find a target and inspect its markets and outcome identifiers.
CLOB API
https://clob.polymarket.com
Prices, order books, order placement and management Observe tradable market state and submit or manage trades.
Data API
https://data-api.polymarket.com
Positions, activity and market participation Analyze account or market activity; its overview describes cursor pagination and a shared response envelope.
Relayer API
https://relayer-v2.polymarket.com
Wallet transaction submission Use the documented relayer flow to submit wallet transactions without requiring the account to hold POL for gas.
CLOB market WebSocket
wss://ws-subscriptions-clob.polymarket.com/ws/market
Public order-book, price and market-lifecycle updates Receive ongoing updates about market state.
CLOB user WebSocket
wss://ws-subscriptions-clob.polymarket.com/ws/user
Authenticated account order and trade updates Track order and trade events for an account.
RTDS
wss://ws-live-data.polymarket.com
Public reference prices, comments and trade activity Consume the documented live-data feeds.
Sports WebSocket
wss://sports-api.polymarket.com/ws
Public live-game status and scores Follow documented sports-game updates.

The API guide describes the capabilities of these surfaces, not latency guarantees, uptime figures or evidence that a particular strategy will make money.

How do market IDs fit together?

Polymarket’s market-data overview describes a hierarchy: an event can group one or more markets; a market is a tradable question with YES and NO outcomes; each outcome has its own token ID. These identifiers are related, but not interchangeable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Event slug: a human-readable way to locate an event in discovery examples.
  • Market condition ID: identifies the specific market condition.
  • Outcome token ID: identifies the YES or NO outcome used for price and order-book requests and order placement.

In practice, discover the event, inspect the specific market, choose the outcome, and carry that outcome’s token ID into the relevant CLOB request. Do not pass an event slug or condition ID where an outcome token ID is needed. Market metadata can include status, trading constraints, fees and other properties; read the fields relevant to the market instead of assuming all markets share the same settings.

How should a bot organize its workflow?

A useful implementation sequence is discover → select → observe → decide → submit → reconcile. The first five steps correspond to the documented API capabilities and quickstart; reconciliation is an engineering practice for keeping the bot’s internal state aligned with its orders and account.

  1. Discover: query Gamma for an event or market of interest.
  2. Select: inspect the market, confirm its relevant status and constraints, choose YES or NO, and retain that outcome’s token ID.
  3. Observe: read the applicable price or order-book data from the CLOB. Use a WebSocket if the bot needs ongoing updates rather than periodic reads.
  4. Decide: apply the bot’s own strategy and risk controls. The API documentation establishes interface capabilities, not strategy effectiveness.
  5. Submit: send the order through the CLOB using the required request authentication and order authorization.
  6. Reconcile: compare order and trade updates with the resulting fill, settlement and position state. Use account streams and/or position and activity reads as appropriate; do not rely solely on an order-submission response as the bot’s final account state.

How do public reads and private CLOB authentication differ?

Public market data can be read without credentials; Polymarket’s API guide demonstrates listing active markets from Gamma without authentication. Private CLOB access uses a two-layer credential flow, and placing an order adds a separate wallet authorization.

1. L1: prove control of a wallet

The wallet signs EIP-712 typed data to establish control of a Polygon address and create or derive CLOB API credentials. The documented example includes the signer address, a Unix timestamp, a nonce and a control-attestation message.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. L2: authenticate private API requests

Private CLOB requests use HMAC-SHA256, computed with the API credential secret. The API key identifies the credential, the secret signs the request, and the passphrase is sent as a request header.

3. Order placement: authorize the order too

Order placement uses L2 request authentication and a wallet signature authorizing the order. The API key does not replace that wallet signature. As an engineering safeguard, keep private keys and API secrets out of source control and logs.

Should you use an SDK or call the API directly?

The official guide presents the SDKs as a unified typed interface that handles common concerns such as pagination, errors and wallet setup. Direct integration can make sense when an SDK does not support your runtime, when you need precise control over signing, headers, retries or transport, or when a required endpoint or wire format is not exposed by the SDK. Neither approach is inherently faster or always safer on the information provided by the docs.

Choice Good fit when Trade-off to consider
Official SDK You want a typed client and its built-in handling of common concerns. Check that it supports your runtime and the endpoints and behavior your bot needs.
Direct API calls You need an unsupported runtime, endpoint coverage, or finer control of request details. Your application must handle the relevant signing, headers, retries, transport and response processing itself.

The current official quickstart provides TypeScript and Python client examples. Treat their method names and sequence as examples from the docs, and verify them against the current version you implement.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Polling or WebSocket: which should you choose?

Polling is a reasonable fit when periodic snapshots are enough. A WebSocket is the documented route when the bot needs ongoing book changes or account events. The API guide describes message purposes but does not publish latency guarantees, so choose based on the update pattern you need—not an assumed speed advantage.

Approach Use it for Practical consideration
REST polling Periodic market reads or account checks Choose an interval appropriate to the bot’s needs and handle repeated reads and failures.
Market WebSocket Continuous public price, book and lifecycle updates Subscribe to the market data the strategy needs and maintain a usable view as updates arrive.
User WebSocket Continuous order and trade updates for an authenticated account Use it for account events; it is not the public market-data stream.

What does the first-order quickstart demonstrate?

The TypeScript and Python examples in Polymarket’s quickstart show the broad path from a market slug to an order and then an account check:

  1. Set up a signer and wallet address with the client.
  2. Retrieve a market by slug and select the YES outcome’s token ID.
  3. Place a market buy for that outcome.
  4. Wait for asynchronous on-chain settlement, then query positions.

The quickstart says that unfilled market-order quantity is canceled rather than left open. It recommends having at least 10 pUSD available to follow that tutorial; this is tutorial setup guidance, not a general minimum balance or investment recommendation.

Why are matching and settlement separate?

A matched order and its final on-chain settlement are distinct moments in the quickstart flow: a match occurs, settlement follows asynchronously, and the example waits before checking the position. A bot should therefore reconcile the order and subsequent account state rather than assume that a matching response means the final position view is already settled. The detailed order lifecycle is not covered here, so consult the current Polymarket documentation for the implementation specifics.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What should you verify before deploying?

Endpoint behavior, SDK methods, authentication details, collateral labels and market-specific constraints can change. Check the current official documentation for the API and market you are connecting to, confirm the selected outcome token ID, and test the bot’s handling of failures and asynchronous order state before relying on its internal position view.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.