Connect
Open a WebSocket connection to:Channels
Use lowercase symbols, and name the provider in every filter (see
Pin a Price Provider).
Authenticate for Gated Channels
Send your CLOB API credentials on the open connection before subscribing:Send Your Chainlink API Key
Subscriptions served by Chainlink, including TWAP, require your Chainlink API key in addition to CLOB API credentials.Request a Chainlink API Key using this form.
- TypeScript
- Python
- API
Use an authenticated SecureClient and pass your key as
providerApiKey with the Chainlink provider.chainlink_key_required also carries a numeric status of 4010. It is not a
close code: the connection stays open.
Subscribe
Send the channels and filters you want to follow. This request subscribes to the BTC reference price from Chainlink on a connection authenticated with your Chainlink API key:Pin a Price Provider
Crypto and equity prices can come from more than one vendor. Every payload names its producer insource. Choose one by adding provider to the filter:
provider accepts chainlink, pyth or binance. Binance serves
price.crypto only, with USDT spot closes under the canonical USD symbol. The
subscribed acknowledgement names the provider actually served. A pin the
server cannot serve for that symbol falls back to the symbol’s default
provider, and the acknowledgement names the fallback, so always read the
acknowledgement rather than assuming the pin held. The TWAP channels are
served by Chainlink only, so pin chainlink there.
Values other than chainlink, pyth or binance are rejected with a
bad_filter error.
provider is required on
price.crypto, price.equity, price.crypto.twap and price.equity.twap.
A subscription without provider
answers this error, and the connection stays open:
Read the Market Status
Equity markets close: exchanges keep session hours, and metals and forex pause daily and over the weekend. Onprice.equity and price.equity.twap,
each payload says whether the market of the instrument it prices is trading,
so you can show “closed at” a price instead of a price that silently stops
moving.
market_status is open, closed or unknown (the vendor reported that it
cannot determine the status). It is absent when the producer states nothing:
treat an absent status as not stated, never as open.
The status belongs to the provider’s series, because it describes the
instrument that provider prices. Chainlink’s equity products trade around the
clock, so a symbol served by Chainlink can read open on a weekend while the
same symbol pinned to pyth follows its exchange session and reads closed.
When the status changes without a new price, you receive a normal update that
repeats the last price with the new status and is_carried_forward: true:
timestamp and value with the update before it, so
never discard an update only because its timestamp repeats. While a series
is closed or unknown, its snapshot also carries the last price point even
when it is older than two minutes, and the snapshot’s ts is that point’s
time. Re-read market_status from the snapshot after every reconnect.
SDK 0.14.0 and later expose this field as payload.marketStatus in TypeScript
and payload.market_status in Python, on snapshots and live updates. See
Read the Market Status for
TypeScript, Python, and API examples.
Envelope
Data envelopes carry snapshots and live updates. Acknowledgements report the result of a request.rid when the request includes it.
chainlink_key_required and provider_required errors also carry a numeric
status, 4010 and 4011. Neither closes the connection.
Each new subscription receives an acknowledgement and one snapshot. Seed local state from the snapshot, then apply the latest price. Snapshots contain the preceding two minutes of prices, with an empty data array when no recent data is available. Repeating an existing channel and filter returns another acknowledgement without a new snapshot.
For data envelopes:
seqis consecutive per connection and per channel, including snapshots. It resets on reconnect.tsis the producer’s event time in Unix milliseconds.snapshot: trueidentifies the initial snapshot.dropped, when present, counts frames dropped on that channel since the last delivered frame because the client fell behind.sourcenames the vendor that produced the price (pyth,massiveorchainlink): on every point of a live update and once per snapshot batch. On single-provider channels it is constant; onprice.cryptoand the equity channels a symbol’s vendor can change between connections, so re-read it after every reconnect.market_status, on the equity channels, isopen,closedorunknown: on every live update and once per snapshot batch, absent when not stated. See Read the Market Status.
https://ws-live-v2.polymarket.com/asyncapi.json for the machine-readable contract.
Unsubscribe
Send the same channel and filter withop: "unsubscribe" to stop a subscription:
unsubscribed. Both subscribe and unsubscribe
accept a single channel and filter or a subscriptions array.
Supported Symbols
Crypto Prices
For the TWAP channels, use
window_seconds: 60. Other windows do not provide data.
Every price.crypto symbol is served by Chainlink, its default provider, and
by Binance. btcusd, ethusd, solusd, xrpusd, dogeusd and bnbusd are
also served by Pyth; on hypeusd and zecusd a pyth pin falls back to
Chainlink. price.crypto.twap is Chainlink only.
Equity Prices
price.equity supports these lowercase symbols:
dxy is the US Dollar Index.
Each equity symbol has a default provider, which serves any pin the symbol
does not support, including every binance pin:
Commodities serve under
cll (WTI crude oil futures) and hn (Henry Hub
natural gas futures) from Pyth, wti (WTI crude oil futures), brent (Brent
crude oil futures) and natgas (natural gas futures) from Chainlink, and
cc3m (the copper 3-month contract price in USD). Each futures symbol keeps
one symbol as its contract rolls. cll and hn move to the next contract at
the open of the current contract’s third-to-last trading session, the Active
Month the WTI and natural gas Up or Down markets resolve on. wti, brent
and natgas follow Chainlink’s own roll schedule. cc3m is a single
continuous contract.
Limits and Liveness
The server sends a WebSocket ping every 25 seconds. Standard clients answer
automatically. Two missed pongs close the connection with
4002.
You can also send { "op": "ping" } to check the connection at the application
level. The server responds with pong.
Close Codes and Reconnecting
Choose the retry behavior based on the close code:
If the connection is refused with HTTP
429 or 503, use Retry-After as the minimum
wait and add jitter. Browser clients see handshake failures as 1006 and should
use exponential backoff with full jitter.
After reconnecting, authenticate again for gated channels and resend your
subscriptions with their provider pins. Initialize from the new
snapshots and re-read source: a crypto or equity symbol can legitimately
arrive from a different vendor than before the reconnect. Sequence numbers
start over.