# Binance Market Data Scraper — Ticker & Klines (`devilscrapes/binance-market-data-scraper`) Actor

Pull public Binance spot-market data — 24hr ticker stats and OHLCV candlesticks (klines) — for a list of trading-pair symbols in one run. We handle the retries, rate-limit backoff, and proxy routing so the data lands. Keyless, no API key or account needed. Built on the public Binance REST API.

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

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

<div align="center">
  <img src=".actor/icon.svg" width="160" alt="Devil Scrapes mark" />

## Binance Market Data Scraper — Ticker & Klines

**💰 $4.00 / 1 000 ticker rows · $1.50 / 1 000 kline rows**  ·  pay only for results  ·  no credit card to try

*We do the dirty work so your dataset stays clean.* 😈

Pull public Binance spot-market data — 24hr ticker stats and OHLCV candlesticks (klines) — for a list of trading-pair symbols in one run. We handle the retries, rate-limit backoff, and proxy routing so the data lands. Keyless, no API key or account needed. Built on the public Binance REST API.

</div>

***

### 🎯 What this scrapes

Binance publishes spot-market data on a documented, keyless REST API — no account, no signature, no API key. This Actor takes a list of trading pairs (e.g. `BTCUSDT`, `ETHUSDT`), pulls 24hr ticker stats and/or OHLCV candlesticks for each, and writes one typed row per ticker snapshot and one per candle. Leave the symbol list empty and it falls back to a bounded top-movers mode — the most active pairs by 24h quote volume, up to your cap. We absorb rate limits and transient errors with backoff so the run finishes clean.

### 🔥 Features

- 🔁 **Retries with exponential backoff** on `408 / 429 / 503` and network errors — up to 5 attempts, `Retry-After` honoured.
- 🚫 **Fail-loud on a rate-limit ban** — a `418`/`451` response stops the run immediately instead of digging the hole deeper.
- 🌐 **Apify Proxy routing** on every request — a fresh exit IP if Binance ever throttles a shared range.
- 🧩 **Fault isolation per symbol** — one bad or delisted pair is skipped and logged, the rest of your run still lands.
- 🧊 **Clean, typed dataset rows** — Pydantic-validated, ISO-8601 timestamps, `rowType`-discriminated ticker/kline shapes.
- 💰 **Two-tier Pay-Per-Event pricing** — richer ticker rows and bulk kline rows are priced separately, never blended.

### 💡 Use cases

- **Quant/algo research** — pull OHLCV klines for a symbol universe, feed straight into a backtest pipeline.
- **Crypto dashboards** — schedule a run for your watchlist, pipe ticker snapshots to a spreadsheet or BI tool.
- **Portfolio pipelines** — one typed row per coin, no hand-rolled Binance client to maintain.
- **Top-movers monitoring** — leave `symbols` empty to snapshot the most active pairs by 24h quote volume.

### ⚙️ How to use it

1. Click **Try for free** at the top of the page.
2. Fill in the input form — most fields have sensible defaults.
3. Click **Start**. Output streams into the run's dataset.
4. Export from **Storage → Dataset** as JSON, CSV, or Excel — or fetch via the Apify API.

For no-code workflows: install the [Apify node for n8n](https://n8n.io/integrations/apify/) or the [Apify module for Make](https://www.make.com/en/integrations/apify), connect your Apify token, and point it at `DevilScrapes/binance-market-data-scraper`.

### 📥 Input

| Field | Type | Required | Default | Notes |
|---|---|:--:|---|---|
| `symbols` | `array` | no | `["BTCUSDT", "ETHUSDT", "SOLUSDT"]` | Binance spot symbols, max 50. Empty triggers bounded top-movers mode. |
| `maxSymbols` | `integer` | no | `20` | Row cap when `symbols` is empty — top N pairs by 24h quote volume. |
| `dataTypes` | `array` | no | `["ticker", "klines"]` | Which data to pull per symbol: `ticker`, `klines`, or both. |
| `interval` | `string` | no | `"1h"` | Candlestick interval (klines only): `1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w`. |
| `klinesLimit` | `integer` | no | `100` | Candles per symbol (Binance's own max is 1000). |
| `startTime` | `integer` | no | `—` | Optional ms-epoch kline window start. |
| `endTime` | `integer` | no | `—` | Optional ms-epoch kline window end. |
| `proxyConfiguration` | `object` | no | `{"useApifyProxy": true}` | We route every request through Apify Proxy and rotate exit IPs on any block. |

#### Example input

```json
{
  "symbols": ["BTCUSDT", "ETHUSDT", "BNBUSDT", "SOLUSDT", "XRPUSDT"],
  "dataTypes": ["ticker", "klines"],
  "interval": "1h",
  "klinesLimit": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

### 📤 Output

Two flat row shapes in one dataset, told apart by `rowType` — never one row with a nested klines list, so PPE bills each candle as its own result.

| Field | Type | Notes |
|---|---|---|
| `rowType` | `string` | Discriminator: `ticker` or `kline`. |
| `symbol` | `string` | Binance trading-pair symbol, e.g. `BTCUSDT`. |
| `priceChange` | `number \| null` | Ticker only — 24h absolute price change. |
| `priceChangePercent` | `number \| null` | Ticker only — 24h percent price change. |
| `lastPrice` | `number \| null` | Ticker only — last traded price. |
| `openPrice` / `highPrice` / `lowPrice` | `number \| null` | Ticker only — 24h open/high/low. |
| `volume` | `number \| null` | Ticker/kline — base-asset volume. |
| `quoteVolume` | `number \| null` | Ticker only — quote-asset volume. |
| `tradeCount` | `integer \| null` | Ticker only — number of trades in the 24h window. |
| `interval` | `string \| null` | Kline only — candlestick interval, e.g. `1h`. |
| `open` / `high` / `low` / `close` | `number \| null` | Kline only — candle OHLC. |
| `numberOfTrades` | `integer \| null` | Kline only — number of trades in the candle. |
| `openTime` / `closeTime` | `string \| null` | ISO-8601 UTC — period/candle open/close time. |
| `scrapedAt` | `string` | ISO-8601 UTC timestamp when this row was recorded. |

#### Example output

```json
{
  "rowType": "ticker",
  "symbol": "BTCUSDT",
  "priceChange": 1234.50,
  "priceChangePercent": 2.15,
  "lastPrice": 58900.10,
  "openPrice": 57665.60,
  "highPrice": 59100.00,
  "lowPrice": 57200.00,
  "volume": 18234.55,
  "quoteVolume": 1062345678.90,
  "openTime": "2026-09-09T00:00:00Z",
  "closeTime": "2026-09-10T00:00:00Z",
  "tradeCount": 1284933,
  "scrapedAt": "2026-09-10T12:00:00Z"
}
```

```json
{
  "rowType": "kline",
  "symbol": "BTCUSDT",
  "interval": "1h",
  "openTime": "2026-09-10T11:00:00Z",
  "open": 58700.00,
  "high": 58950.00,
  "low": 58650.00,
  "close": 58900.10,
  "volume": 312.45,
  "closeTime": "2026-09-10T11:59:59Z",
  "numberOfTrades": 5421,
  "scrapedAt": "2026-09-10T12:00:00Z"
}
```

### 💰 Pricing

Pay-Per-Event — two result rates, because one `/klines` call can return up to 1000 candles and pricing them at the ticker rate would make a single call cost roughly $4:

| Event | USD | What it is |
|---|---:|---|
| `actor-start` | $0.20 | One-off warm-up charge per run |
| `ticker-result` | $0.004 | Per ticker row written (≈ $4.00 / 1 000) |
| `kline-result` | $0.0015 | Per kline (candle) row written (≈ $1.50 / 1 000) |

No subscription, no minimum, no card to start — Apify gives every new account $5 of free credit.

### 🚧 Limitations

- Spot market only — no futures, margin, or options data.
- No authenticated endpoints — balances, orders, and account data are out of scope by design.
- `/ticker/price` and `/exchangeInfo` are not implemented in this version.
- No technical indicators (RSI, MACD, etc.) — raw OHLCV only; compute indicators downstream.

### ❓ FAQ

**Do I need a Binance account or API key?**

No. Every endpoint this Actor calls is public, keyless spot-market data — no account, no signature, no rate-limit tier to buy into.

**Does this support futures, margin, or options?**

No — spot market only in this version. Futures/margin/options are a separate product surface on Binance's side.

**Can I get historical data further back than the klines limit?**

Set `startTime`/`endTime` to page through history — `klinesLimit` caps each call at up to 1000 candles per request.

**What happens if I request klines with no symbols?**

Klines requires at least one symbol — the Actor validates this before charging you anything. Ticker alone can run with an empty symbol list (top-movers mode).

**Why are ticker and kline rows priced differently?**

A single klines request can return up to 1000 candles. Pricing them at the ticker rate would make one call cost roughly $4 — the lower kline rate keeps bulk OHLCV affordable.

### 💬 Your feedback

Spotted a bug, hit a weird edge case, or need a new field? Open an issue on the Actor's **Issues** tab in Apify Console — we ship fixes weekly and we read every report.

***

<div align="center">

Built by **[Devil Scrapes](https://apify.com/DevilScrapes)** 😈 — a small fleet of
opinionated public-data Actors. Honest pricing, real engineering, zero fine print.

</div>

# Actor input Schema

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

Binance spot symbols, e.g. <code>BTCUSDT</code>, <code>ETHUSDT</code>. Max 50. Leave empty to fetch the top movers by 24h quote volume instead (bounded by <code>maxSymbols</code>) — klines requires at least one symbol.

## `maxSymbols` (type: `integer`):

Row cap when ‘symbols’ is left empty — top N pairs by 24h quote volume.

## `dataTypes` (type: `array`):

Which Binance data to pull per symbol.

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

Candlestick interval (klines only).

## `klinesLimit` (type: `integer`):

Number of candles fetched per symbol (Binance's own max is 1000).

## `startTime` (type: `integer`):

Optional. Restricts klines to candles opening at or after this millisecond-epoch timestamp.

## `endTime` (type: `integer`):

Optional. Restricts klines to candles opening at or before this millisecond-epoch timestamp.

## `proxyConfiguration` (type: `object`):

Apify Proxy routing. We default to a residential exit in a region Binance always serves — leave this on unless you have your own proxy group to route through.

## Actor input object example

```json
{
  "symbols": [
    "BTCUSDT",
    "ETHUSDT",
    "BNBUSDT",
    "SOLUSDT",
    "XRPUSDT"
  ],
  "maxSymbols": 20,
  "dataTypes": [
    "ticker",
    "klines"
  ],
  "interval": "1h",
  "klinesLimit": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All dataset items as JSON.

## `datasetItemsCsv` (type: `string`):

Same data exported to CSV.

## `datasetView` (type: `string`):

Open the run dataset in the Console.

# 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 = {
    "symbols": [
        "BTCUSDT",
        "ETHUSDT",
        "BNBUSDT",
        "SOLUSDT",
        "XRPUSDT"
    ],
    "maxSymbols": 20,
    "dataTypes": [
        "ticker",
        "klines"
    ],
    "interval": "1h",
    "klinesLimit": 100,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/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 = {
    "symbols": [
        "BTCUSDT",
        "ETHUSDT",
        "BNBUSDT",
        "SOLUSDT",
        "XRPUSDT",
    ],
    "maxSymbols": 20,
    "dataTypes": [
        "ticker",
        "klines",
    ],
    "interval": "1h",
    "klinesLimit": 100,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("devilscrapes/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 '{
  "symbols": [
    "BTCUSDT",
    "ETHUSDT",
    "BNBUSDT",
    "SOLUSDT",
    "XRPUSDT"
  ],
  "maxSymbols": 20,
  "dataTypes": [
    "ticker",
    "klines"
  ],
  "interval": "1h",
  "klinesLimit": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call devilscrapes/binance-market-data-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devilscrapes/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/pyRRimYw7u2Ed2ggN/builds/PPnO4it2sidPIloVz/openapi.json
