# Binance Market Data Scraper — Prices, Klines & Order Book (`hipersoft/binance-market-data-scraper`) Actor

Fetch Binance spot market data in bulk: 24h ticker stats (price, change %, high/low, volume), OHLC klines (candlesticks) for any interval, and order book depth (top bids/asks) for any symbol. Fast, clean and cheap.

- **URL**: https://apify.com/hipersoft/binance-market-data-scraper.md
- **Developed by:** [hiper soft](https://apify.com/hipersoft) (community)
- **Categories:** Other, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.0005 / symbol scraped

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Binance Market Data Scraper — Prices, Klines & Order Book

Pull **Binance spot market data** in bulk and export it as clean JSON, CSV or Excel. Get **24-hour ticker statistics** (price, change %, high, low, volume), **OHLC klines** (candlesticks) at any interval, and **order book depth** (top bids and asks) for any trading pair — **one tidy row per symbol or per candle**.

Perfect for **crypto trading bots, price dashboards, backtesting, portfolio trackers, alerting and automated watchlists**.

### What you get

- 🪙 **Every spot pair** — request specific symbols like `BTCUSDT` and `ETHUSDT`, or leave the list empty to snapshot all ~3,700 spot symbols at once (24h ticker).
- 📈 **Three datasets in one Actor** — 24h ticker stats, OHLC klines, and order book depth. Pick one with a single `dataType` field.
- 🕯️ **Candlesticks at any interval** — 1m, 5m, 15m, 1h, 4h, 1d, 1w and more, up to 1,000 candles per symbol.
- 📖 **Order book snapshots** — top bids and asks per side, with best bid, best ask and spread computed for you.
- ⚡ **Fast & clean** — flat records with numeric fields (not strings), ready for spreadsheets, databases or code.

### Example input

Top pairs, 24-hour statistics:

```json
{ "symbols": ["BTCUSDT", "ETHUSDT", "BNBUSDT"], "dataType": "ticker24hr" }
```

Every spot symbol's 24h stats in one run (leave `symbols` empty):

```json
{ "symbols": [], "dataType": "ticker24hr" }
```

Hourly candles for two pairs (last 200 each):

```json
{ "symbols": ["BTCUSDT", "ETHUSDT"], "dataType": "klines", "interval": "1h", "limit": 200 }
```

Order book depth, top 50 levels per side:

```json
{ "symbols": ["BTCUSDT"], "dataType": "depth", "limit": 50 }
```

### Output

#### 24h ticker (`ticker24hr`) — one row per symbol

```json
{
  "symbol": "BTCUSDT",
  "dataType": "ticker24hr",
  "price": 78671.31,
  "priceChange": 543.32,
  "priceChangePercent": 0.695,
  "high": 79400.0,
  "low": 77962.49,
  "volume": 7162.52209,
  "quoteVolume": 562647622.43,
  "count": 1792347,
  "openTime": 1788036551013,
  "closeTime": 1788122951013
}
```

#### Klines (`klines`) — one row per candle

```json
{
  "symbol": "BTCUSDT",
  "dataType": "klines",
  "interval": "1h",
  "openTime": 1788116400000,
  "open": 79036.68,
  "high": 79041.96,
  "low": 78721.98,
  "close": 78856.39,
  "volume": 232.19118,
  "closeTime": 1788119999999,
  "quoteAssetVolume": 18323014.75,
  "numberOfTrades": 73674
}
```

#### Order book depth (`depth`) — one row per symbol

```json
{
  "symbol": "BTCUSDT",
  "dataType": "depth",
  "bestBid": 78671.31,
  "bestAsk": 78671.32,
  "spread": 0.01,
  "bids": [{ "price": 78671.31, "quantity": 0.23938 }],
  "asks": [{ "price": 78671.32, "quantity": 1.871 }]
}
```

### Input fields

| Field | Description |
|-------|-------------|
| `symbols` | Trading pairs in Binance format (e.g. `BTCUSDT`, `ETHUSDT`). Empty = all spot symbols (24h ticker only; klines and depth need at least one symbol). |
| `dataType` | `ticker24hr` (24h stats), `klines` (OHLC candles), or `depth` (order book). Default `ticker24hr`. |
| `interval` | Candle interval for `klines`: `1m`, `5m`, `15m`, `1h`, `4h`, `1d`, `1w`, etc. Default `1h`. |
| `limit` | Rows per symbol: number of candles for `klines`, or order-book depth per side for `depth`. Ignored for `ticker24hr`. |

### FAQ

**Which symbols can I request?**
Any Binance spot trading pair, written as base + quote with no separator — `BTCUSDT`, `ETHUSDT`, `BNBBTC`, `SOLUSDT`, and so on. For a full 24h snapshot of every pair, leave `symbols` empty.

**What interval options are there for klines?**
`1m`, `3m`, `5m`, `15m`, `30m`, `1h`, `2h`, `4h`, `6h`, `8h`, `12h`, `1d`, `3d`, `1w` and `1M`. You can pull up to 1,000 of the most recent candles per symbol.

**How is order book depth returned?**
One row per symbol containing the top bids and asks (each a `price` + `quantity`), plus the best bid, best ask and the computed spread. Use `limit` to choose how many levels per side.

**What's the output format?**
Structured JSON — one clean record per symbol or per candle, with numeric fields. Export as JSON, CSV, Excel or via the API.

**Can I use this in n8n?**
Yes. Apify has an official [n8n community node](https://apify.com/integrations/n8n) — run this Actor from an n8n workflow and pipe the returned market data straight into your automation, database or spreadsheet. It also works with [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier) and [many more](https://apify.com/integrations).

**Can I integrate this with other tools?**
The Binance Market Data Scraper connects with almost any cloud service or web app via [integrations on the Apify platform](https://apify.com/integrations): [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier), [Slack](https://docs.apify.com/platform/integrations/slack), [Google Drive](https://docs.apify.com/platform/integrations/drive) and more, plus the [Apify API](https://docs.apify.com/api/v2), JavaScript/Python clients, webhooks and MCP.

### Notes

Market data is © Binance and the respective venues, and is provided for informational purposes — respect their terms and any redistribution restrictions. Original clean-room implementation.

# Actor input Schema

## `symbols` (type: `array`):

Trading pairs to fetch, in Binance format (base + quote, no separator), e.g. "BTCUSDT", "ETHUSDT", "BNBBTC". Leave empty to fetch every spot symbol (only supported for the 24h ticker data type; klines and order book depth require at least one symbol).

## `dataType` (type: `string`):

Which market dataset to return. "ticker24hr" = rolling 24-hour price statistics (one row per symbol). "klines" = OHLC candlesticks (one row per candle). "depth" = order book snapshot with the top bids and asks (one row per symbol).

## `interval` (type: `string`):

Candlestick interval, used only when Data type is "klines". One of: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M.

## `limit` (type: `integer`):

How many rows to return per symbol. For "klines" it is the number of most recent candles (1-1000). For "depth" it is the order book depth per side (valid values: 5, 10, 20, 50, 100, 500, 1000). Ignored for "ticker24hr".

## Actor input object example

```json
{
  "symbols": [
    "BTCUSDT",
    "ETHUSDT"
  ],
  "dataType": "ticker24hr",
  "interval": "1h",
  "limit": 500
}
```

# Actor output Schema

## `results` (type: `string`):

The results as dataset items.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/binance-market-data-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("hipersoft/binance-market-data-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{}' |
apify call hipersoft/binance-market-data-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hipersoft/binance-market-data-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/RpgFfW14Pjg4hFOuF/builds/Y2Z4QmM7miXU30GjQ/openapi.json
