# OKX Spot Prices Scraper (`parseforge/okx-spot-prices-scraper`) Actor

Scrape live spot market ticker data from OKX public API including last price, 24h volume, high/low, bid/ask for thousands of spot trading pairs. No API key required.

- **URL**: https://apify.com/parseforge/okx-spot-prices-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $30.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

![ParseForge Banner](https://raw.githubusercontent.com/ParseForge/apify-assets/main/parseforge-banner.png)

## 🟦 OKX Spot Prices Scraper

> 🚀 **Pull live OKX spot ticker data across hundreds of trading pairs in seconds.** Filter by quote currency, sort by quote volume or percent change, and export clean numeric fields ready for analysis. No API key, no registration, no manual CSV wrangling.

> 🕒 **Last updated:** 2026-05-12 · **📊 23 fields** per record · **800+ spot pairs** · **24h refresh windows** · **No login**

OKX Spot Prices Scraper queries the public OKX v5 REST API and returns live ticker snapshots for every active SPOT instrument. Each record carries the last price and last trade size, top-of-book bid and ask with sizes, computed spread in absolute units and basis points, 24-hour open, high, and low, start-of-day reference prices at UTC 00:00 and UTC 08:00 (used heavily across Asia-Pacific trading desks), 24-hour base volume, 24-hour quote-currency volume, 24-hour price change in absolute and percent terms, and the API response timestamp. Each pair is also split into clean `baseAsset` and `quoteAsset` fields from the `instId`.

Crypto traders use this for OKX-specific spread tracking and quote-currency liquidity ranking. Quant teams compare OKX prices to Binance and Bybit for arbitrage hunting. APAC desks pull the `sodUtc8` start-of-day reference for day-trading P&L attribution. Treasury teams pull end-of-day OKX marks for USDT and USDC reconciliation. Returned figures are cast to numbers from raw API strings, so you can pipe them straight into a warehouse without parsing.

| Target | OKX public v5 REST API (Market Tickers, SPOT instType) |
|--------|--------------------------------------------------------|
| Use Cases | Cross-venue arbitrage, APAC trading desks, treasury marks, market data pipelines |

---

### 📋 What the OKX Spot Prices Scraper does

- 🟦 **Every active SPOT instrument.** Last price, 24h high, low, open, and price change for every spot pair OKX is quoting.
- 📊 **Two volume views.** 24-hour base volume and 24-hour quote-currency volume in one record for both fee analysis and USD-equivalent ranking.
- 🟢 **Top-of-book quotes.** Best bid and ask with sizes, plus computed spread in absolute units and basis points.
- 🌏 **UTC and APAC start-of-day refs.** `sodUtc0` and `sodUtc8` reference prices give you both Western and Asia-Pacific session opens.
- 🔍 **Quote currency filter.** Narrow to USDT, USDC, BTC, ETH, EUR, TRY, or BRL pairs in one click, or leave empty for all.

Each record represents one spot pair with 23 fields covering pricing, liquidity, dual start-of-day refs, and the API response timestamp. Sort the results before truncating to focus on deepest markets, biggest movers, or any specific quote currency.

> 💡 **Why it matters:** OKX returns ticker data as raw strings inside a wrapper response. Parsing them, splitting `BTC-USDT` into base and quote, computing the spread, and casting everything to numbers takes work. This actor handles all of it server-side and pushes flat records to your dataset.

---

### 🎬 Full Demo

🚧 Coming soon: a 3-minute walkthrough showing how to go from sign-up to a downloaded dataset.

---

### ⚙️ Input

<table>
<thead>
<tr><th>Input</th><th>Type</th><th>Default</th><th>Behavior</th></tr>
</thead>
<tbody>
<tr><td><code>quoteCurrency</code></td><td>string (enum)</td><td><code>"USDT"</code></td><td>Filter pairs by quote currency. Options: USDT, USDC, BTC, ETH, EUR, TRY, BRL. Leave empty for all spot pairs.</td></tr>
<tr><td><code>sortBy</code></td><td>string (enum)</td><td><code>"volCcy24h"</code></td><td>Order before truncating. Options: volCcy24h (quote volume), vol24h (base volume), last (last price), instId (alphabetical).</td></tr>
<tr><td><code>maxItems</code></td><td>integer</td><td><code>10</code></td><td>Free users are limited to 10 items. Paid users can request up to 1,000,000.</td></tr>
</tbody>
</table>

**Example: top 50 USDT pairs by quote volume.**

```json
{
  "quoteCurrency": "USDT",
  "sortBy": "volCcy24h",
  "maxItems": 50
}
````

**Example: BTC pairs sorted alphabetically.**

```json
{
  "quoteCurrency": "BTC",
  "sortBy": "instId",
  "maxItems": 100
}
```

> ⚠️ **Good to Know:** OKX uses hyphen-separated `instId` codes like `BTC-USDT`. The actor splits this into clean `baseAsset` and `quoteAsset` fields. Start-of-day reference prices reset at 00:00 UTC and 08:00 UTC respectively.

***

### 📊 Output

Each record contains **23 fields** including price, dual volume metrics, top-of-book quotes, spread, and dual start-of-day refs. Download as CSV, Excel, JSON, or XML.

#### 🧾 Schema

| Field | Type | Example |
|---|---|---|
| 🏷️ `instId` | string | `"BTC-USDT"` |
| 🔗 `url` | string | `"https://www.okx.com/trade-spot/btc-usdt"` |
| 🏪 `instType` | string | `"SPOT"` |
| 💱 `baseAsset` | string | `"BTC"` |
| 💵 `quoteAsset` | string | `"USDT"` |
| 💰 `lastPrice` | number | `80281.4` |
| 🟢 `bidPrice` | number | `80281.3` |
| 🔴 `askPrice` | number | `80281.4` |
| ↔️ `spreadBps` | number | `0.0125` |
| 🌅 `open24h` | number | `81774.1` |
| 📈 `high24h` | number | `82134.9` |
| 📉 `low24h` | number | `80174.1` |
| 🕛 `sodUtc0` | number | `81741.4` |
| 🕗 `sodUtc8` | number | `80331` |
| 📦 `volume24h` | number | `8769.31902015` |
| 💵 `quoteVolume24h` | number | `709594250.18` |
| 📉 `priceChange24h` | number | `-1492.7` |
| 📊 `priceChangePercent24h` | number | `-1.8254` |
| 🕒 `timestamp` | string (ISO) | `"2026-05-12T16:29:34.706Z"` |
| ⏱️ `scrapedAt` | string (ISO) | `"2026-05-12T16:29:35.855Z"` |

#### 📦 Sample records

<details>
<summary><strong>💰 BTC-USDT - deepest pair, sub-bps spread</strong></summary>

```json
{
  "instId": "BTC-USDT",
  "url": "https://www.okx.com/trade-spot/btc-usdt",
  "instType": "SPOT",
  "baseAsset": "BTC",
  "quoteAsset": "USDT",
  "lastPrice": 80281.4,
  "lastSize": 0.00062156,
  "askPrice": 80281.4,
  "askSize": 3.49955399,
  "bidPrice": 80281.3,
  "bidSize": 1.62095792,
  "spreadAbs": 0.1,
  "spreadBps": 0.0125,
  "open24h": 81774.1,
  "high24h": 82134.9,
  "low24h": 80174.1,
  "sodUtc0": 81741.4,
  "sodUtc8": 80331,
  "volume24h": 8769.31902015,
  "quoteVolume24h": 709594250.1810724,
  "priceChange24h": -1492.7,
  "priceChangePercent24h": -1.8254,
  "timestamp": "2026-05-12T16:29:34.706Z",
  "scrapedAt": "2026-05-12T16:29:35.855Z"
}
```

</details>

<details>
<summary><strong>⛓️ ETH-USDT - large-cap alt with full intraday window</strong></summary>

```json
{
  "instId": "ETH-USDT",
  "url": "https://www.okx.com/trade-spot/eth-usdt",
  "instType": "SPOT",
  "baseAsset": "ETH",
  "quoteAsset": "USDT",
  "lastPrice": 2268.41,
  "lastSize": 0.003483,
  "askPrice": 2268.42,
  "askSize": 19.54636,
  "bidPrice": 2268.41,
  "bidSize": 26.309917,
  "spreadAbs": 0.01,
  "spreadBps": 0.0441,
  "open24h": 2337.02,
  "high24h": 2345.76,
  "low24h": 2256.76,
  "sodUtc0": 2339.89,
  "sodUtc8": 2262.03,
  "volume24h": 152885.195069,
  "quoteVolume24h": 350222685.16753584,
  "priceChange24h": -68.61,
  "priceChangePercent24h": -2.9358,
  "timestamp": "2026-05-12T16:29:34.007Z",
  "scrapedAt": "2026-05-12T16:29:35.855Z"
}
```

</details>

<details>
<summary><strong>🔆 SOL-USDT - wider 1-bps spread layer-1</strong></summary>

```json
{
  "instId": "SOL-USDT",
  "url": "https://www.okx.com/trade-spot/sol-usdt",
  "instType": "SPOT",
  "baseAsset": "SOL",
  "quoteAsset": "USDT",
  "lastPrice": 94.19,
  "lastSize": 4.46,
  "askPrice": 94.19,
  "askSize": 133.922189,
  "bidPrice": 94.18,
  "bidSize": 171.875992,
  "spreadAbs": 0.01,
  "spreadBps": 1.0617,
  "open24h": 97.44,
  "high24h": 98.38,
  "low24h": 93.62,
  "sodUtc0": 97.37,
  "sodUtc8": 93.87,
  "volume24h": 725595.606343,
  "quoteVolume24h": 69760215.56831712,
  "priceChange24h": -3.25,
  "priceChangePercent24h": -3.3354,
  "timestamp": "2026-05-12T16:29:33.706Z",
  "scrapedAt": "2026-05-12T16:29:35.856Z"
}
```

</details>

***

### ✨ Why choose this Actor

| | Capability |
|---|---|
| 🟦 | **Every active SPOT pair.** 800+ spot instruments returned in a single call. |
| 🌏 | **Dual start-of-day refs.** Both UTC 00:00 and UTC 08:00 anchor prices, the same pair APAC desks compare against. |
| 🧮 | **Computed spread metrics.** Absolute and basis-point spreads calculated against the last price for each pair. |
| 🔁 | **Live per run.** Every execution hits the OKX public v5 API directly, no cache. |
| 📦 | **Dual volume view.** Base volume (`volume24h`) and quote-currency volume (`quoteVolume24h`) both exposed without extra math. |
| 🔢 | **Strings cast to numbers.** Every price, volume, and size is parsed into a numeric type, ready for analytics. |
| 🚫 | **No login.** Works with public OKX market data. No API key, no signature header. |

> 📊 OKX consistently ranks in the top 3 cryptocurrency exchanges by spot volume globally and is one of the largest venues in Asia-Pacific.

***

### 📈 How it compares to alternatives

| Approach | Cost | Coverage | Refresh | Filters | Setup |
|---|---|---|---|---|---|
| **⭐ OKX Spot Prices Scraper** *(this Actor)* | $5 free credit, then pay-per-use | **800+** spot pairs, 23 fields | **Live per run** | quote currency, sort key, maxItems | ⚡ 2 min |
| Official public API | Free | Full, but nested response | Real-time | Build your own | 🐢 Hours of plumbing |
| Paid live data APIs | $99+/month | Real-time, tick-level | Streaming | Many | ⏳ Days |
| Manual browsing | Free (your time) | One pair at a time | Manual | None | 🕒 Slow |

Pick this actor when you want flat, named, numeric OKX spot ticker data without parsing the v5 response envelope.

***

### 🚀 How to use

1. 📝 **Sign up.** [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=vmoqkp) (takes 2 minutes).
2. 🌐 **Open the Actor.** Go to the OKX Spot Prices Scraper page on the Apify Store.
3. 🎯 **Set input.** Pick a quote currency (or leave empty for all), choose a sort key, and set `maxItems`.
4. 🚀 **Run it.** Click **Start** and let the Actor pull the live tickers.
5. 📥 **Download.** Grab your results in the **Dataset** tab as CSV, Excel, JSON, or XML.

> ⏱️ Total time from signup to downloaded dataset: **3-5 minutes.** No coding required.

***

### 💼 Business use cases

<table>
<tr>
<td width="50%" valign="top">

#### 📈 Cross-Venue Arbitrage

- Spread OKX last price against Binance and Bybit for arb signals
- Quote-volume ranking to size opportunities by liquidity
- Spread basis points for fee-aware order sizing
- Volume divergence detection across venues

</td>
<td width="50%" valign="top">

#### 🌏 APAC Trading Desks

- `sodUtc8` start-of-day reference for Asia-session P\&L
- Intraday performance vs UTC 00:00 anchor
- Quote-currency volume for fiat-pair flow tracking
- Cross-quote arbitrage (USDT vs USDC vs EUR)

</td>
</tr>
<tr>
<td width="50%" valign="top">

#### 📊 Treasury and Reporting

- End-of-day OKX marks for USDT and USDC reconciliation
- USD-equivalent valuations via quote volume
- Cross-asset portfolio mark-to-market
- Audit trails of external venue prices with timestamps

</td>
<td width="50%" valign="top">

#### 🛠️ App and Bot Development

- Price tickers for portfolio apps and Telegram bots
- Alert engines fired on percent-change thresholds
- Pair autocomplete with canonical OKX instId codes
- Liquidity scoreboards filtered by quote currency

</td>
</tr>
</table>

***

### 🌟 Beyond business use cases

Data like this powers more than commercial workflows. The same structured records support research, education, civic projects, and personal initiatives.

<table>
<tr>
<td width="50%">

#### 🎓 Research and academia

- Empirical datasets for papers, thesis work, and coursework
- Longitudinal studies tracking changes across snapshots
- Reproducible research with cited, versioned data pulls
- Classroom exercises on data analysis and ethical scraping

</td>
<td width="50%">

#### 🎨 Personal and creative

- Side projects, portfolio demos, and indie app launches
- Data visualizations, dashboards, and infographics
- Content research for bloggers, YouTubers, and podcasters
- Hobbyist collections and personal trackers

</td>
</tr>
<tr>
<td width="50%">

#### 🤝 Non-profit and civic

- Transparency reporting and accountability projects
- Advocacy campaigns backed by public-interest data
- Community-run databases for local issues
- Investigative journalism on public records

</td>
<td width="50%">

#### 🧪 Experimentation

- Prototype AI and machine-learning pipelines with real data
- Validate product-market hypotheses before engineering spend
- Train small domain-specific models on niche corpora
- Test dashboard concepts with live input

</td>
</tr>
</table>

***

### 🔌 Automating OKX Spot Prices Scraper

Control the scraper programmatically for scheduled runs and pipeline integrations:

- 🟢 **Node.js.** Install the `apify-client` NPM package.
- 🐍 **Python.** Use the `apify-client` PyPI package.
- 📚 See the [Apify API documentation](https://docs.apify.com/api/v2) for full details.

The [Apify Schedules feature](https://docs.apify.com/platform/schedules) lets you trigger this Actor on any cron interval. A 1-minute schedule feeds near-real-time arbitrage dashboards. A 5-minute schedule builds a rolling OKX spot ticker archive in your warehouse.

***

### ❓ Frequently Asked Questions

#### 🧩 How does it work?

The actor calls OKX's public v5 REST API endpoint `/api/v5/market/tickers?instType=SPOT`, which returns ticker data for every active spot instrument in one response. The actor splits each `instId` (e.g. `BTC-USDT`) into base and quote fields, casts strings to numbers, computes spread and percent change against the 24h open, and pushes flat records to your dataset.

#### 📏 How accurate is the data?

Prices are exactly what OKX returned at the moment of the API call. The `timestamp` field captures OKX's server timestamp for the ticker, and `scrapedAt` captures when the actor pushed the record. Two close-in-time runs may show small drift as the 24-hour rolling window slides.

#### 🔁 How fresh is the data?

Every run hits the live OKX v5 API. There is no cache. Ticker data on this endpoint updates on every trade, so the snapshot you get is essentially the latest tick at the moment of the call.

#### 🌏 What is the difference between `sodUtc0` and `sodUtc8`?

`sodUtc0` is the start-of-day reference price at UTC 00:00, the same anchor most Western markets use. `sodUtc8` is the start-of-day reference at UTC 08:00, used heavily by Hong Kong, Singapore, and Tokyo trading desks because it aligns with the local business day. Both are exposed in the same record for cross-region P\&L calculations.

#### 🚫 Can I include perpetuals or options?

This actor returns SPOT instruments only. For OKX perpetual swaps and futures use a dedicated derivatives scraper, or check the recommended Bybit Tickers Scraper below for similar derivatives data. Open the contact form for an OKX derivatives request.

#### ⚖️ Is this data legal to use?

OKX publishes spot ticker data through a public v5 REST endpoint without authentication. Market data redistribution rules vary by jurisdiction, so review OKX's API terms of use and your local regulations before redistributing the data commercially.

#### 💼 Can I use this data commercially?

Yes, within the limits of OKX's API terms of use. Internal analytics, dashboards, arbitrage screens, and oracle pipelines are common commercial applications. Direct resale of raw streams may require additional licensing from OKX.

#### 💳 Do I need a paid Apify plan to run this actor?

No. The free Apify plan ships with **$5 monthly credit**, enough for several runs. Free users are limited to 10 items per run for preview. [Upgrade here](https://console.apify.com/sign-up?fpr=vmoqkp) to lift the cap to 1,000,000 items.

#### 🚨 What happens if my run fails or returns no results?

Failed runs are not charged. OKX occasionally returns 429 or 503 codes; the actor retries with backoff respecting any `Retry-After` header. If the run still fails, check the log or open the [contact form](https://tally.so/r/BzdKgA).

#### 📤 How do I export the data?

Apify datasets export as CSV, JSON, JSONL, Excel, HTML, XML, or RSS with one click. You can also pull results via the [Apify API](https://docs.apify.com/api/v2) or stream them into BigQuery, S3, Snowflake, and other warehouses through built-in integrations.

#### 📅 Can I schedule the actor to run automatically?

Yes. Apify Schedules supports any cron expression. A 1-minute schedule feeds near-real-time arbitrage dashboards. Daily schedules produce a clean end-of-day OKX mark file. Outputs can fan out to webhooks, Slack, email, or cloud storage.

***

### 🔌 Integrate with any app

OKX Spot Prices Scraper connects to any cloud service via [Apify integrations](https://apify.com/integrations):

- [**Make**](https://docs.apify.com/platform/integrations/make) - Automate multi-step workflows
- [**Zapier**](https://docs.apify.com/platform/integrations/zapier) - Connect with 5,000+ apps
- [**Slack**](https://docs.apify.com/platform/integrations/slack) - Get run notifications and price alerts
- [**Airbyte**](https://docs.apify.com/platform/integrations/airbyte) - Pipe ticker data into your warehouse
- [**GitHub**](https://docs.apify.com/platform/integrations/github) - Trigger runs from commits
- [**Google Drive**](https://docs.apify.com/platform/integrations/drive) - Export datasets straight to Sheets

Use webhooks to fan out new OKX snapshots to your trading engine, alerting system, or downstream analytics jobs the second a run finishes.

***

### 🔗 Recommended Actors

- [**💰 Binance Crypto Prices Scraper**](https://apify.com/parseforge/binance-prices-scraper) - Live 24h tickers across thousands of Binance spot pairs
- [**🐙 Kraken Crypto Exchange Scraper**](https://apify.com/parseforge/kraken-exchange-scraper) - Kraken ticker data with VWAP and trade counts
- [**🟧 Bybit Tickers Scraper**](https://apify.com/parseforge/bybit-tickers-scraper) - Bybit spot, USDT-perpetual, and inverse derivatives
- [**💰 CoinGecko Cryptocurrency Scraper**](https://apify.com/parseforge/coingecko-scraper) - Cross-exchange aggregate prices, market cap, and supply
- [**📊 CoinPaprika Tickers Scraper**](https://apify.com/parseforge/coinpaprika-tickers-scraper) - Multi-currency market caps with multi-timeframe percent change

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge) for more crypto and market-data scrapers.

***

**🆘 Need Help?** [**Open our contact form**](https://tally.so/r/BzdKgA) to request a new scraper, propose a custom data project, or report an issue.

***

> **⚠️ Disclaimer:** this Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by OKX (Aux Cayes FinTech Co. Ltd.). All trademarks mentioned are the property of their respective owners. Only publicly available data is collected.

# Actor input Schema

## `quoteCurrency` (type: `string`):

Filter pairs by quote currency (e.g. USDT, USDC, BTC). Leave empty for all spot pairs.

## `maxItems` (type: `integer`):

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## `sortBy` (type: `string`):

Sort results by this field

## Actor input object example

```json
{
  "quoteCurrency": "USDT",
  "maxItems": 10,
  "sortBy": "volCcy24h"
}
```

# Actor output Schema

## `overview` (type: `string`):

Overview of scraped data

## `fullData` (type: `string`):

Complete dataset

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "maxItems": 10,
    "sortBy": "volCcy24h"
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/okx-spot-prices-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "maxItems": 10,
    "sortBy": "volCcy24h",
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/okx-spot-prices-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "maxItems": 10,
  "sortBy": "volCcy24h"
}' |
apify call parseforge/okx-spot-prices-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=parseforge/okx-spot-prices-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "OKX Spot Prices Scraper",
        "description": "Scrape live spot market ticker data from OKX public API including last price, 24h volume, high/low, bid/ask for thousands of spot trading pairs. No API key required.",
        "version": "0.0",
        "x-build-id": "bwVdUZ4mtrsmsTdGx"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/parseforge~okx-spot-prices-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-parseforge-okx-spot-prices-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/parseforge~okx-spot-prices-scraper/runs": {
            "post": {
                "operationId": "runs-sync-parseforge-okx-spot-prices-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/parseforge~okx-spot-prices-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-parseforge-okx-spot-prices-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "quoteCurrency": {
                        "title": "Quote Currency Filter",
                        "enum": [
                            "",
                            "USDT",
                            "USDC",
                            "BTC",
                            "ETH",
                            "EUR",
                            "TRY",
                            "BRL"
                        ],
                        "type": "string",
                        "description": "Filter pairs by quote currency (e.g. USDT, USDC, BTC). Leave empty for all spot pairs.",
                        "default": "USDT"
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
                    },
                    "sortBy": {
                        "title": "Sort By",
                        "enum": [
                            "volCcy24h",
                            "vol24h",
                            "last",
                            "instId"
                        ],
                        "type": "string",
                        "description": "Sort results by this field",
                        "default": "volCcy24h"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
