OKX Scraper avatar

OKX Scraper

Pricing

from $1.00 / 1,000 records

Go to Apify Store
OKX Scraper

OKX Scraper

Extract live OKX spot prices for any instrument with no key, secret or passphrase: last, best bid and ask with their sizes, 24h high, low, base and quote volume, and the exchange timestamp. Export data, run via API, schedule and monitor runs, or integrate with other tools.

Pricing

from $1.00 / 1,000 records

Rating

5.0

(1)

Developer

Public Money

Public Money

Maintained by Apify

Actor stats

1

Bookmarked

4

Total users

3

Monthly active users

21 hours ago

Last modified

Categories

Share

OKX signs its private endpoints with a key, a secret and a passphrase, which is a lot of setup for a price. This Actor reads the public spot ticker for any instrument and returns one structured record: last price, best bid and ask with their sizes, 24h high, low, base and quote volume, and OKX's own timestamp for the tick.

What it does

  • Returns one record per requested instrument, in order. An instrument OKX does not list comes back with status: "failed" and a reason.
  • Carries bid and ask sizes next to the prices, so a spread comes with the depth behind it.
  • Keeps both names: requested is what you asked for (BTC/USDT) and symbol is OKX's own instrument id (BTC-USDT).
  • Reports volume in both the base and the quote asset, so you do not have to guess which unit a dashboard needs.
  • Needs no API key, secret or passphrase. Nothing to register, nothing to rotate.
  • Stamps every record with validFrom, OKX's own exchange time for that tick.

Use cases

You need toHow this Actor does it
Price a portfolio every minutePass every instrument you hold and schedule the run
Watch the spread on a pairSubtract bid from ask on each run and alert on a widening book
Check depth before tradingRead bidSize and askSize next to the spread
Compare venues for the same pairRun this next to the Binance, Bybit, Kraken or Coinbase Actor and diff value at validFrom
Feed a trading agentCall the Actor over MCP and let the model ask for the instrument it needs
Build your own candlesSchedule the run and let the dataset accumulate one row per instrument per run

Quick start

  1. Click Try for free.
  2. Add your instruments, one per line, as BASE/QUOTE: BTC/USDT, ETH/USDT, SOL/USDT. OKX writes them with a hyphen internally and the Actor converts for you.
  3. Click Start. Rows appear within seconds.
  4. Export as JSON, CSV, Excel or XML, or read the dataset over the API.

Input

FieldTypeDefaultWhat it controls
pairsarrayBTC/USDT, ETH/USDTTrading pairs to read, written BASE/QUOTE. Slashes are optional and case does not matter.
maxItemsinteger0Caps how many instruments are read. 0 reads them all
{
"pairs": [
"BTC/USDT",
"ETH/USDT",
"SOL/USDT"
],
"maxItems": 0
}

Output

One dataset item per instrument. Fields OKX does not publish are dropped rather than returned as null.

Field groupFields
Identitystatus, requested, symbol, currency, url
Pricevalue, bid, ask
24 hour windowhigh24h, low24h, baseVolume24h
TimingvalidFrom, scrapedAt
Book depthbidSize, askSize, quoteVolume24h
{
"status": "ok",
"requested": "BTC/USDT",
"symbol": "BTC-USDT",
"currency": "USDT",
"value": 104229.9,
"bid": 104229.8,
"ask": 104229.9,
"bidSize": 3.104,
"askSize": 0.884,
"high24h": 106540.0,
"low24h": 103112.45,
"baseVolume24h": 7311.02,
"quoteVolume24h": 763118440.55,
"validFrom": "2026-09-04T20:00:01.000Z"
}

Integrations

Run it over the API and get the rows back in one call:

curl -X POST "https://api.apify.com/v2/acts/publicmoney~okx-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"pairs": ["BTC/USDT", "ETH/USDT", "SOL/USDT"], "maxItems": 0}'

From Python:

from apify_client import ApifyClient
client = ApifyClient("YOUR_TOKEN")
run = client.actor("publicmoney/okx-scraper").call(run_input={"pairs": ["BTC/USDT", "ETH/USDT", "SOL/USDT"], "maxItems": 0})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item["symbol"], item["value"], item["validFrom"])

Give an AI agent the Actor over MCP:

{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com/?actors=publicmoney/okx-scraper"
}
}
}

Schedules run it on any cron, webhooks fire when a run finishes, and platform integrations push the dataset to Google Sheets, Slack, Airtable, Zapier or your own endpoint.

Cost

Pay per event, so you pay for records rather than compute time.

EventFree tierTop volume tier
Record with data$0.002$0.0007
Actor start$0.00005 per GBSame

A record that returned no data is published as a failure row and is never charged. Six volume tiers apply, so the per-record price falls with monthly volume.

Troubleshooting

IssueSolution
One pair returns failed, the rest are fineThat pair is not listed on this exchange, or the quote asset is wrong. Check it on the exchange first.
symbol does not match what I sentBy design. requested is your input and symbol is OKX's instrument id, so BTC/USDT becomes BTC-USDT.
Volume looks wrong next to another exchangebaseVolume24h is in the base asset and quoteVolume24h is in the quote asset. Compare like with like.
I want a futures or options instrumentThis Actor covers the spot market. Perpetuals and options are not read.
value looks behind another exchangeRead validFrom. It is the exchange's own timestamp for that tick, so two venues legitimately differ. Prices are spot, not aggregated.

FAQ

Does the OKX API need an API key?

Private endpoints need a key, a secret and a passphrase, and each request is signed. The public spot ticker needs none of that, which is what this Actor reads.

Is this the real-time OKX price?

It is the last trade OKX published at validFrom, read live on each run. It is not a stream, so for tick-by-tick data use a websocket. For a price every minute or every hour, schedule the Actor.

Does it return OKX candles or historical prices?

No. Each record is the current ticker. To build a series, schedule the Actor and let the dataset accumulate one row per pair per run, each stamped with validFrom.

Why is the instrument written with a hyphen in the output?

That is OKX's own format. You send BTC/USDT and requested keeps it, while symbol carries OKX's BTC-USDT so the record joins back to their docs.

Can it read OKX perpetuals?

No, spot only. For perpetual funding rates use the Binance Actor in this fleet.

Do I need a OKX API key?

No. You need an Apify token to call the Actor over the API. No OKX credential is involved anywhere.

Can I get this data in Python?

Yes, with the apify-client package as shown above. It returns parsed JSON, so there is no HTML or response handling on your side.

Can I get the data into Excel or Google Sheets?

Yes. Export the dataset as XLSX or CSV, or connect the Google Sheets integration so each run appends to a sheet.

Can an AI agent call this Actor?

Yes. Add it to an MCP client with the config above and the model can request what it needs on its own. Every record is flat JSON with named fields, so no post-processing is needed.

This Actor reads public OKX data that needs no login and collects no personal data. Scraping public data is generally lawful, and how you store, redistribute or act on market data is governed by your own agreements and local rules. Take your own legal advice for your use case.

Changelog

  • 0.0.2 Added bid and ask sizes and quote-asset volume.
  • 0.0.1 First release. Spot ticker for any listed instrument.

Feedback

Found a field OKX publishes that this Actor misses, or an input it rejects? Open an issue on the Issues tab with the input and what you expected. A daily test runs every Actor in the fleet against live sources, so parser fixes ship fast.