PMWallets
中文

Polymarket WebSocket API: what the market and user channels give you

Polymarket's CLOB WebSocket streams order books and price changes for the markets you name, and your own orders and trades. It does not stream other people's trades. Here is what each channel is for, and what to use when you need a trader's fills.

The market channel

The public market channel streams, for the token IDs you subscribe to, order-book snapshots and changes, price changes, last trade prices and tick-size changes. No key is needed. It is what a bot uses to know the current best bid and ask before it places an order — and it says nothing about who traded.

js
// Polymarket's market channel: order book and price changes for the tokens you name
const ws = new WebSocket("wss://ws-subscriptions-clob.polymarket.com/ws/market");
ws.onopen = () => ws.send(JSON.stringify({ type: "market", assets_ids: ["<token id>"] }));
ws.onmessage = (m) => console.log(m.data);   // book snapshots, price changes, last trade prices

The user channel

The user channel is authenticated with your CLOB API credentials and streams updates about your own orders and trades: placements, fills, cancellations. It is how a trading bot learns what happened to the orders it sent. It covers your account only.

What neither channel does

Neither streams the fills of a wallet you do not own. To follow a trader as they trade, you need a source that watches every fill on chain and attributes it — your own Polygon log reader, or a push feed such as PMWallets, which delivers the fills of the entities you subscribe to over its own WebSocket or a signed webhook.

Using both together

A copy-trading bot typically holds two connections: a feed of the traders it follows, to decide what to do, and Polymarket's market data and order API, to check the book and place its own orders. The open-source PMWallets copy-trading bot does exactly that, checking the best ask against the trader's price and the book's depth before each order.

Questions

Does Polymarket have a WebSocket API?

Yes. The CLOB WebSocket has a public market channel (order books and prices per token) and an authenticated user channel (your own orders and trades).

Can the Polymarket WebSocket stream another wallet's trades?

No, not as of October 2026. The market channel does not say who traded and the user channel only covers your own account. Use a feed that attributes on-chain fills to traders.

Do I need an API key for the Polymarket market channel?

No. The market channel is public; the user channel needs your CLOB API credentials.

Related