API · Reference

Polymarket has two realtime systems, on two different hosts. The CLOB WebSocket streams the order book and your own order updates; the RTDS feed streams live price data (crypto, equities) and comments. Mixing the two up is the most common mistake — this page keeps them straight, with the exact endpoints, the heartbeat, and a correct reconnect.

The two hosts
  • CLOBwss://ws-subscriptions-clob.polymarket.com/ws/ · channels market (public) and user (auth).
  • RTDSwss://ws-live-data.polymarket.com · topics crypto_prices, crypto_prices_chainlink, equity_prices, comments.

CLOB market channel (no auth)

Subscribe to one or more token IDs and receive the order book and updates: an initial book snapshot, then price_change, tick_size_change and last_trade_price events. No credentials needed.

import asyncio, json, websockets

async def stream(token_ids):
    url = "wss://ws-subscriptions-clob.polymarket.com/ws/market"
    async with websockets.connect(url, ping_interval=10) as ws:
        await ws.send(json.dumps({"assets_ids": token_ids, "type": "market"}))
        async for msg in ws:
            evt = json.loads(msg)
            print(evt.get("event_type"), evt)

asyncio.run(stream([TOKEN_ID]))
import WebSocket from "ws";
const ws = new WebSocket("wss://ws-subscriptions-clob.polymarket.com/ws/market");
ws.on("open", () => ws.send(JSON.stringify({ assets_ids: [TOKEN_ID], type: "market" })));
ws.on("message", (d) => console.log(JSON.parse(d)));

CLOB user channel (auth)

The user channel reports your order lifecycle (placements, matches, cancels). It needs your API key/secret/passphrase and you subscribe by condition_id (market), not token ID. Connect to wss://ws-subscriptions-clob.polymarket.com/ws/user and include your auth in the subscribe payload.

RTDS price feeds

A separate host — wss://ws-live-data.polymarket.com — for live price data, not order books. Subscribe to a topic: crypto_prices (Binance), crypto_prices_chainlink (Chainlink oracle), equity_prices, or comments. Useful for the underlying signal in crypto/equity prediction-market bots.

Heartbeat & reconnect

  • Heartbeat — send a PING roughly every 10 seconds; the server replies PONG. Miss it and the connection drops.
  • Modify live — you can add/remove topics or assets on an open connection; you don't need to reconnect to change your subscription.
  • Reconnect correctly — after any drop, re-fetch the REST order-book snapshot (GET /book) before trusting incremental updates again. Streamed deltas you missed while disconnected are gone; the REST snapshot re-syncs your local book.
Don't confuse the hosts. Order books and your orders come from the CLOB host (ws-subscriptions-clob); crypto/equity prices and comments come from RTDS (ws-live-data). They are different services with different payloads.

Next: CLOB REST reference · Rate limits & backoff · Build: stream the book in a bot.