futures market data
Public real-time market data for perpetual futures: order book, best quote, trades, candles, 24h ticker, mark price, funding.
Futures market data streams push live public data for every futures pair over WebSocket. They need no API key and carry no account data. For history and one-off snapshots (candles, order book, recent trades, funding, 24h statistics) use the Futures Market Data REST endpoints.
Host
wss://futures-marketdata-service.outpoll.comOrder book
/ws/book/depth
Order Book
Best bid / ask
/ws/book/best
Best Quote
Trades and last price
/ws/trades/last
Trades
Candles (OHLCV)
/ws/candles
Candles
24h ticker
/ws/ticker/24h
Ticker
Mark price
/ws/mark-price
Mark Price
Funding
/ws/funding
Funding
Each stream is a separate WebSocket connection. One connection can follow any number of pairs on its stream, up to the limits.
Authentication
No authentication required.
Connection Lifecycle
There is no separate confirmation frame for a subscription. A successful subscribe is silent; the first data frame for the pair is the confirmation. A rejected one produces an error frame.
All frames are JSON text frames, except the ping / pong keep-alive which is plain text.
Pair ID
Every stream addresses pairs by the integer pair ID (gid). Get the list of pairs and their IDs from Get Public Pairs.
Subscribe and Unsubscribe
All streams use the same request frame.
act
string
subscribe or unsubscribe
pi
integer
One pair ID
ps
array of integers
Several pair IDs; when present, pi is ignored
all
boolean
true = every pair on this stream, including pairs listed later. Supported on best quote, trades, ticker, mark price and funding
dp
integer
Order book only: number of levels per side
g
number
Order book only: price grouping step
iv
string
Candles only: candle interval
Subscribe to one pair:
Subscribe to several pairs:
Subscribe to every pair:
Unsubscribe uses the same shapes:
Subscribing again to a pair you already follow replaces its parameters (
dp,g,iv) and does not count against the limit.unsubscribewithall: trueremoves the all-pairs subscription only; pairs subscribed by ID stay.A pair subscribed both by ID and through
all: trueis delivered once.Unsubscribing from a pair you do not follow is ignored.
A frame with any other
actvalue is ignored.
Limits
Pair IDs in one subscribe frame (ps)
500
too_many_pairs — the whole frame is rejected
Distinct pairs per connection
500
subscription_limit — the pairs beyond the limit are rejected
Use all: true instead of listing pairs when you need the whole market.
Ping
Send the text ping (not JSON). The server answers with the text pong.
Send a ping every 20–30 seconds, and reconnect if no frame (data or pong) arrives for a while.
Errors
Errors arrive as a JSON frame on the same connection. The connection stays open.
er
string
Error code
msg
string
Human-readable description (may change — don't parse it)
parse_error
The frame is neither ping nor valid JSON of the request shape (for example a non-numeric pi)
invalid_pair
Pair ID is zero or negative
unknown_pair
No pair with this ID
too_many_pairs
More than 500 IDs in ps
subscription_limit
The connection already follows 500 pairs
invalid_group
Order book only: g has more than 8 decimal places or more than 18 integer digits
In a ps list, each rejected pair produces its own error frame; the valid pairs in the same frame are subscribed.
Number and Time Format
Prices, sizes and rates are JSON numbers with exact decimal values. Parse them as decimals, not floats (in Python:
json.loads(msg, parse_float=Decimal)).Very small values can be written in exponent notation, for example
9.8E-7.Price levels are
[price, size]arrays.Time is epoch milliseconds, UTC.
Field names are short keys; each stream page lists its fields.
Python Example
Was this helpful?

