OKX real-time market data — spot, perpetual swaps, dated futures and options on one WebSocket feed, bought by the day
Every message OKX publishes across spot, perpetual swaps, dated futures and options — the full Level-2 order book, a separate top-of-book stream, every trade and the derivatives topics, nothing sampled — over a plain WebSocket in JSON or SBE, captured at the venue in Tokyo and delivered at our London, Frankfurt, Ashburn or Ohio endpoints over dedicated lines. You buy whole UTC calendar days for a single instrument or the whole market, self-serve, and connect with one API key.
Endpoints and one-way latency
OKX real-time market data at our London, Frankfurt, Ashburn or Ohio endpoints: the data is captured at the venue in Tokyo, you connect at the endpoint. The market listens on the same port wherever it is served, and access is bought per endpoint and market.
| Endpoint | Site | Line | Latency | Buy |
|---|---|---|---|---|
| London | LD4 / AWS London | OKX (Tokyo) → London, dedicated fiber | ~69.8 ms one-way | OKX → |
| Frankfurt | AWS eu-central-1 | OKX (Tokyo) → Frankfurt, dedicated fiber | ~68.2 ms one-way | OKX → |
| Ashburn | AWS us-east-1 | OKX (Tokyo) → Ashburn, dedicated fiber | ~67.7 ms one-way | OKX → |
| Ohio | AWS us-east-2 | OKX (Tokyo) → Ohio, dedicated fiber | ~64.1 ms one-way | OKX → |
OKX lines: ~69.8 ms Tokyo → London, ~68.2 ms Tokyo → Frankfurt, ~67.7 ms Tokyo → Ashburn and ~64.1 ms Tokyo → Ohio.
Latency is one-way line latency from the site where the venue is captured to our endpoint — the venue's own latency and the on-ramp to your client come on top.
What the feed carries
Every topic below is the same stream our own systems consume — the historical files in the shop are recordings of it, so a backtest maps 1:1 onto production.
| Topic | What you receive | OKX port 14008 · London, Frankfurt, Ashburn, Ohio |
|---|---|---|
| Order book | Full-depth snapshot on subscribe, then changed levels only; every event chained by prevEventId → eventId. | ✓ |
| Top of book | Best bid and ask as its own stream; optional coalescing for slow consumers. | ✓ |
| Trades | Every public trade: aggressor side, price, quantity, trade id, exchange timestamp. | ✓ |
| Mark price | The venue's mark price as it is republished. | ✓ |
| Index price | The underlying index price. | ✓ |
| Funding rate | Current rate, next settlement time and the venue's predicted next rate. | ✓ |
| Liquidations · opt-in | Liquidation orders as the venue publishes them: side, price, quantity, exchange timestamp — off by default, opt in per subscribe. | ✓ |
- Market-data streams only — a dedicated route, not general-purpose bandwidth
- Every instrument of the market: full order-book depth and every trade
- OKX adds a separate realtime top-of-book stream
- OKX adds mark price, index price, funding rate and liquidations
- On OKX the topics follow the instrument type: spot carries the order book, top of book and trades; derivatives add mark price, index price and liquidations, perpetual swaps also the funding rate
- WebSocket, JSON or SBE — the port selects the market, one API key per account
How access works
One day or thirty — paid days start at the next 00:00 UTC and the rest of the purchase day is included free, so access begins the moment the order clears. Longer runs cost less per day. Extend any time from your account, invoice on checkout.
A market day unlocks every instrument of that market; an instrument day unlocks exactly the instruments you pick. €39.20 per instrument-day or €79.20 per market-day (public-beta price, 20 % off the list price of €49 / €99 for every day bought during the beta); longer runs cost less per day: −10 % from 14 days, −25 % from 30, −50 % off the list price from 365. Single OKX instruments: spot and perpetual swaps — dated futures and options come with the whole market.
The key is created with your first purchase and shown in your account together with the endpoints. It authenticates the feed and the master-data export, and you can rotate it whenever you want. 3 parallel connections per key and endpoint included (one connection can subscribe to every instrument); +5 more for €10 per day, up to 28, added from your account.
WebSocket in JSON or SBE, the same protocol and subscribe flow as our documented market-data API: OKX (port 14008). Instrument master data is a free export from the shop.
PricePublic beta −20 %
€39.20 list price €49 / instrument · day · €79.20 list price €99 / market · day
Public beta: every day bought while the beta runs is 20 % below the list price (€49 / €99 per day). The feed and the protocol are our production platform; the self-serve path is new — tell us what you need.
Captured at the venue in Tokyo and delivered at our London, Frankfurt, Ashburn or Ohio endpoints over dedicated lines — that dedicated line is what the per-day price pays for. London, Frankfurt, Ashburn, Ohio and Tokyo are the self-serve locations today; more will follow, and enterprise subscriptions already cover further locations and venues. See the enterprise tiers for order entry, T+1 history and monthly API swaps.
Realtime market data for other venues
One API key, one protocol — each venue has its own page with its endpoints, line latency and price.
Questions about OKX realtime access
Where is OKX market data captured, and where do I connect?
Captured at the venue in Tokyo and delivered at our London, Frankfurt, Ashburn or Ohio endpoints over dedicated lines. London, Frankfurt, Ashburn and Ohio are the endpoints serving OKX today; more will follow, and enterprise subscriptions already cover further locations and venues — see the enterprise tiers.
How is the OKX latency measured?
OKX lines: ~69.8 ms Tokyo → London, ~68.2 ms Tokyo → Frankfurt, ~67.7 ms Tokyo → Ashburn and ~64.1 ms Tokyo → Ohio — one-way line latency from the site where the venue is captured to our endpoint — the venue's own latency and the on-ramp to your client come on top. The line is a dedicated route from the capture site to the endpoint, and enterprise subscriptions already cover further locations and venues — see the enterprise tiers.
Which OKX instruments can I buy one at a time?
Single OKX instruments: spot and perpetual swaps — dated futures and options come with the whole market. Dated contracts expire — the shortest-dated ones the next morning — so a paid run of single-instrument days could outlive its contract; a market day covers every OKX instrument listed that day, and you subscribe to the ones you trade.
What does OKX realtime access cost?
€39.20 per instrument-day or €79.20 per market-day (public-beta price, 20 % off the list price of €49 / €99 for every day bought during the beta). A market day covers every instrument of that market, an instrument day only the ones you select. Longer runs cost less per day: −10 % from 14 days, −25 % from 30, −50 % off the list price from 365 — €49.50 per market-day on a 365-day run. 3 parallel connections per key and endpoint included (one connection can subscribe to every instrument); +5 more for €10 per day, up to 28, added from your account. Realtime access is paid by card — credits apply to historical data only.
Which streams does the OKX feed serve, and how are events identified?
OKX serves order book, top of book, trades, mark price, index price, funding rate and liquidations. A topic a market does not carry never emits there. The order book arrives as a full-depth snapshot on subscribe, then every changed level; the best bid and ask also arrive as their own top-of-book stream. On OKX the topics follow the instrument type: spot carries the order book, top of book and trades; derivatives add mark price, index price and liquidations, perpetual swaps also the funding rate. Every order-book update carries an eventId and the prevEventId it follows. On OKX the order book and top of book follow the venue's own sequence (eventIdType ORDERED), while trade ids are opaque (UNORDERED): compare ids for equality only, in arrival order — never sort or subtract them. A prevEventId that does not equal the last eventId you saw means data was missed: unsubscribe, subscribe again and rebuild from the fresh snapshot.
When does OKX realtime access start and end?
Access runs over whole UTC calendar days. Paid days start at the next 00:00 UTC, and the remainder of the day you buy on is included free — there is no start date to pick. Your account lists every run and lets you extend it.
Can a coding agent implement the OKX connection for me?
Yes — hand it the machine-readable spec: login, subscribe, message types and reconnect rules in one markdown document. Give the agent the key through the CRYPTOSTRUCT_REALTIME_API_KEY environment variable, never inside the prompt.