How to Scrape OKX Spot & Futures Market Data in 2026
A practical guide to bulk-exporting live OKX ticker data — spot, perpetual swaps, dated futures and options — last price, 24h change, volume and bid/ask, at scale.
OKX is one of the deepest crypto venues in the world, listing thousands of instruments across spot pairs, perpetual swaps, dated futures and options. If you’ve ever tried to assemble a complete market snapshot, you’ve discovered the awkward truth: the data is all available through OKX’s public REST API, but it arrives in four different response shapes, with numeric values encoded as strings, no computed 24h percent change, and one endpoint per instrument category. Stitching that into a single clean feed is more work than it looks. This guide walks through what OKX actually exposes, how its public market API behaves, and how to pull a normalized full-market snapshot in seconds.
What’s worth extracting
OKX’s public tickers endpoint surfaces a consistent core of market telemetry for every instrument once you normalize the four response shapes into one schema:
- Identity — instrument ID (e.g.
BTC-USDT,BTC-USDT-SWAP), instrument type (SPOT / SWAP / FUTURES / OPTION). - Pricing — last traded price (or mark price for derivatives), 24h open, 24h high, 24h low.
- Change — computed 24h percent change, derived from open and last.
- Volume — 24h base-currency volume and 24h quote-currency volume (USD-equivalent where applicable).
- Order book top — best bid and best ask.
- Timing — the exchange’s own timestamp for the snapshot, plus a scrape timestamp you stamp on every row.
The full normalized record is a flat row of roughly 15 fields. That flatness is the point: instead of nested JSON you have to reshape downstream, you get warehouse-ready rows you can load directly into a time-series table or a quant feature store.
Why this is an API job, not a browser job
Unlike consumer sites that fight bots with TLS fingerprinting and JavaScript challenges, OKX exposes market data through a documented public REST API. There’s no login, no CAPTCHA, no headless browser needed. The work isn’t getting past defenses — it’s the data engineering on top:
- Four endpoints, four shapes. SPOT, SWAP, FUTURES and OPTION tickers each return slightly different field sets. A SWAP ticker carries funding-relevant context that a SPOT pair doesn’t. Merging them into one schema requires per-type mapping.
- Strings, not numbers. OKX returns prices and volumes as strings (
"64213.5") to avoid float precision loss in transit. You have to parse every numeric field to a float before it’s usable. - No percent change. The API gives you 24h open and last, but not the percent move. You compute it yourself:
(last - open) / open * 100. - Category-level requests. The efficient call pattern is one request per instrument category (
instType=SPOT, etc.), not one request per symbol. That’s how a full-market run completes in seconds instead of minutes.
This is exactly the kind of normalization layer that’s tedious to build once and pointless to rebuild. A managed actor solves the four-shape merge, the float parsing and the change computation, then emits one flat row per instrument.
How the OKX market endpoint works
The core call is the public tickers endpoint, parameterized by instrument type:
GET https://www.okx.com/api/v5/market/tickers?instType=SPOT
GET https://www.okx.com/api/v5/market/tickers?instType=SWAP
GET https://www.okx.com/api/v5/market/tickers?instType=FUTURES
GET https://www.okx.com/api/v5/market/tickers?instType=OPTION
Each call returns the full set of instruments in that category in a single response. Four calls cover the entire OKX market. After fetching, the scraper merges the four arrays, parses the string fields, computes 24h change, optionally filters by minimum volume, sorts on a chosen metric, caps the result count, and emits per-instrument rows.
▶ Run the OKX Market Scraper — one run pulls every spot, swap, futures and option instrument into a single flat schema with parsed floats and computed 24h change. Schedule it for a continuously fresh feed.
Schema design for downstream use
When the output lands in your warehouse or trading system, you want it normalized for time-series querying. A clean per-instrument row:
{
"instId": "BTC-USDT-SWAP",
"instType": "SWAP",
"last": 64213.5,
"open24h": 62980.0,
"high24h": 64850.2,
"low24h": 62410.0,
"change24hPct": 1.96,
"volCcy24h": 18342.7,
"volUsd24h": 1177984210.5,
"bidPx": 64213.4,
"askPx": 64213.6,
"exchangeTs": "2026-05-20T11:59:58.300Z",
"scrapedAt": "2026-05-20T12:00:00Z"
}
A few schema choices worth making early:
- Keep
instTypeon every row. ABTC-USDTspot price and aBTC-USDT-SWAPmark price are different instruments. Without the type tag your joins will silently merge them. - Store both
exchangeTsandscrapedAt. The exchange timestamp tells you when the quote was valid; your scrape timestamp tells you when you captured it. For latency-sensitive analysis you need both. - Always persist
volUsd24h. Quote volume in USD-equivalent is your liquidity filter and your instrument-ranking key. It’s the field most downstream queries sort on. - Don’t drop options. Full BTC/ETH option chains are exactly what you need to fit an implied-volatility surface — capture them in the same run rather than a separate pipeline.
Typical use cases
What this market feed actually powers:
- Funding-rate and basis arbitrage — pull swaps, dated futures and spot in one run and compare the term structure to find basis trades.
- Cross-exchange arbitrage — combine the OKX feed with other exchange scrapers to spot price dislocations across venues.
- Options analytics — fetch the full option set to fit IV surfaces, monitor open interest and watch strike-level volume.
- Quant signal generation — rank instruments by liquidity, then select a tradable universe by 24h USD volume.
- Portfolio dashboards — blend spot and derivatives marks into a single unified valuation and PnL view.
- Crypto data products — resellers and API providers use a flat, export-ready OKX feed as upstream infrastructure.
The common thread is freshness and completeness. A stale snapshot is worthless for trading, and a partial one (spot only, no derivatives) misses the most interesting relationships. A full-market run on a 1–5 minute schedule is the unit of value.
Cost math for the managed approach
Running this as a managed actor on Apify is dominated by the per-run start cost, not per-result fees — full-market exports are emitted at no per-row charge under this actor’s pricing. A continuously fresh feed refreshing every five minutes is roughly 288 runs per day, or about 8,600 runs per month. Each run pulls thousands of instruments in seconds. The compute footprint is tiny because there’s no browser and no proxy — just four HTTP requests and an in-memory transform.
Compared to building and operating your own collector, you’re avoiding:
- Writing and maintaining the four-shape normalization layer
- Handling OKX API rate limits and retry/backoff across categories
- VPS or container hosting for a scheduled collector
- The cold-start week of discovering each instrument type’s field quirks
For a market feed, the real cost is correctness. A subtly wrong percent-change formula or a swap/spot ID collision corrupts every downstream model that consumes the feed.
Common pitfalls
A few things to know before you wire OKX market data into production, whether you build or buy:
- Mark price vs. last price for derivatives. For swaps and futures, the mark price (used for liquidations) can diverge from the last traded price. Be explicit about which one your row carries and why.
- Empty option fields. Illiquid option strikes can return null or zero for bid/ask and volume. Don’t treat a missing quote as a price of zero.
- Timestamp timezones. OKX timestamps are epoch milliseconds in UTC. Convert consistently or your time-series will have phantom gaps.
- Volume units.
volCcy24h(base) andvolUsd24h(quote) are different scales. Sorting on the wrong one ranks a low-priced altcoin above BTC. Pick deliberately. - Rate limits on tight schedules. The public endpoints are generous but not infinite. A five-minute cadence is comfortable; sub-minute polling across many runs needs care.
Wrapping up
OKX market data is open and well-documented — the hard part is the normalization, not the access. If you just need an occasional snapshot, the public API is easy enough to call directly. If you need a continuously fresh, fully-normalized full-market feed — spot, swaps, futures and options in one flat schema with computed change — running it as a managed actor saves you the data-engineering glue and keeps the feed correct.
▶ Open the OKX Market Scraper on Apify — full-market ticker snapshots across all instrument types in seconds. No proxy, no browser, schedulable. Start with Apify’s free monthly credit.
Related guides
App Store Data API Alternative: ASO Metadata Beyond iTunes
Apple's iTunes Search and Lookup API is rate-limited and thin. Here's an App Store data API alternative that returns full reviews, rankings, and keyword signals for ASO.
Binance Market Data Without API Keys: Spot Prices and Funding in 2026
How to pull Binance spot prices, order books and funding data without API keys — using the public REST surface, its weight limits and region blocks explained.
CoinGecko API Alternative: Exchange Data Without Rate-Limit Pain
A CoinGecko API alternative for exchange and market data — why the free Demo tier's ~30 calls/min and Pro-gated fields force you to the public pages instead.