# Binance Price Scraper (`crawlerbros/binance-price-scraper`) Actor

Scrape historical cryptocurrency price data (OHLCV candlestick data) from Binance. Get open, high, low, close prices and trading volume for any trading pair across multiple timeframes.

- **URL**: https://apify.com/crawlerbros/binance-price-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Automation, Integrations, Other
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 16 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.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

## Binance Price Scraper

Scrape historical cryptocurrency price data (OHLCV candlestick data) from Binance. Get open, high, low, close prices and trading volume for any trading pair across multiple timeframes.

### What does Binance Price Scraper do?

This actor downloads historical price data directly from Binance's public data archive. It supports all trading pairs available on Binance across Spot, USD-M Futures, and COIN-M Futures markets.

Use it to:

- Download historical Bitcoin, Ethereum, or any crypto price data
- Get OHLCV candle data at any timeframe from 1 second to 1 month
- Build datasets for crypto trading analysis and backtesting
- Track price movements across multiple trading pairs at once
- Access both Spot and Futures market data

### Input

| Field | Type | Description |
|-------|------|-------------|
| Trading Pair Symbols | Array of strings | Binance trading pair symbols in uppercase (e.g. `BTCUSDT`, `ETHUSDT`, `SOLUSDT`) |
| Candle Interval | String | Kline interval: `1s`, `1m`, `3m`, `5m`, `15m`, `30m`, `1h`, `2h`, `4h`, `6h`, `8h`, `12h`, `1d`, `3d`, `1w`, `1mo` |
| Start Date | String | Start date in `YYYY-MM-DD` format |
| End Date | String | End date in `YYYY-MM-DD` format (defaults to today) |
| Market Type | String | `spot`, `futures/um` (USD-M Futures), or `futures/cm` (COIN-M Futures) |
| Proxy | Object | Optional proxy configuration |

#### Input example

```json
{
    "symbols": ["BTCUSDT", "ETHUSDT"],
    "interval": "1d",
    "startDate": "2025-01-01",
    "endDate": "2025-03-31",
    "market": "spot"
}
````

### Output

Each record in the output dataset represents one candlestick with the following fields:

| Field | Type | Description |
|-------|------|-------------|
| symbol | String | Trading pair symbol (e.g. `BTCUSDT`) |
| openTime | String | Candle open time in ISO 8601 format |
| open | String | Opening price |
| high | String | Highest price during the candle |
| low | String | Lowest price during the candle |
| close | String | Closing price |
| volume | String | Trading volume in base asset |
| closeTime | String | Candle close time in ISO 8601 format |
| quoteAssetVolume | String | Trading volume in quote asset (e.g. USDT) |
| numberOfTrades | Integer | Number of trades during the candle |
| takerBuyBaseVolume | String | Taker buy volume in base asset |
| takerBuyQuoteVolume | String | Taker buy volume in quote asset |

#### Output example

```json
{
    "symbol": "BTCUSDT",
    "openTime": "2025-01-01T00:00:00Z",
    "open": "93500.01000000",
    "high": "94500.00000000",
    "low": "92800.00000000",
    "close": "94200.50000000",
    "volume": "12345.67800000",
    "closeTime": "2025-01-01T23:59:59Z",
    "quoteAssetVolume": "1156789012.34000000",
    "numberOfTrades": 987654,
    "takerBuyBaseVolume": "6543.21000000",
    "takerBuyQuoteVolume": "612345678.90000000"
}
```

### How much will it cost to scrape Binance prices?

This actor downloads data from Binance's free public data archive, so data access is free. You only pay for Apify platform compute time. A typical run downloading daily candles for one trading pair over a year completes in under a minute.

### Supported trading pairs

All trading pairs listed on Binance are supported, including but not limited to:

- **BTC pairs**: BTCUSDT, BTCBUSD, BTCETH
- **ETH pairs**: ETHUSDT, ETHBTC, ETHBUSD
- **Altcoins**: SOLUSDT, ADAUSDT, DOTUSDT, XRPUSDT, DOGEUSDT, AVAXUSDT, LINKUSDT, MATICUSDT
- **Futures**: All USD-M and COIN-M perpetual and delivery contracts

### FAQ

#### What timeframes are available?

Binance provides data at these intervals: 1 second, 1 minute, 3 minutes, 5 minutes, 15 minutes, 30 minutes, 1 hour, 2 hours, 4 hours, 6 hours, 8 hours, 12 hours, 1 day, 3 days, 1 week, and 1 month.

#### How far back does the data go?

Data availability depends on when the trading pair was listed on Binance. For major pairs like BTCUSDT, data goes back to 2017.

#### Is this real-time data?

No, this actor downloads historical data. Daily data is available the following day and monthly data is released on the first Monday of each month.

#### Can I use this for backtesting trading strategies?

Yes! The OHLCV data output is in a standard format that can be directly imported into most backtesting frameworks and analysis tools.

#### What is the difference between Spot and Futures data?

Spot data reflects prices on Binance's spot exchange (direct buying/selling). USD-M Futures data is from USDT-margined futures contracts, and COIN-M Futures is from coin-margined futures contracts.

# Actor input Schema

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

List of Binance trading pair symbols (e.g. BTCUSDT, ETHUSDT, SOLUSDT). Use uppercase format.

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

Kline/candlestick interval. Supported values: 1s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1mo.

## `startDate` (type: `string`):

Start date for historical data in YYYY-MM-DD format (e.g. 2024-01-01).

## `endDate` (type: `string`):

End date for historical data in YYYY-MM-DD format (e.g. 2025-03-31). Defaults to today if not specified.

## `market` (type: `string`):

Which Binance market to scrape data from.

## `proxy` (type: `object`):

Optional proxy settings. Not required for most regions.

## Actor input object example

```json
{
  "symbols": [
    "BTCUSDT"
  ],
  "interval": "1d",
  "startDate": "2025-01-01",
  "market": "spot"
}
```

# Actor output Schema

## `priceDataset` (type: `string`):

Dataset containing OHLCV candlestick data for the requested trading pairs and date range

# 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"
    ],
    "startDate": "2025-01-01"
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/binance-price-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"],
    "startDate": "2025-01-01",
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/binance-price-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 '{
  "symbols": [
    "BTCUSDT"
  ],
  "startDate": "2025-01-01"
}' |
apify call crawlerbros/binance-price-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Binance Price Scraper",
        "description": "Scrape historical cryptocurrency price data (OHLCV candlestick data) from Binance. Get open, high, low, close prices and trading volume for any trading pair across multiple timeframes.",
        "version": "1.0",
        "x-build-id": "8jARYnNboL91A0AaT"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crawlerbros~binance-price-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crawlerbros-binance-price-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/crawlerbros~binance-price-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crawlerbros-binance-price-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/crawlerbros~binance-price-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crawlerbros-binance-price-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",
                "required": [
                    "symbols",
                    "startDate"
                ],
                "properties": {
                    "symbols": {
                        "title": "Trading Pair Symbols",
                        "type": "array",
                        "description": "List of Binance trading pair symbols (e.g. BTCUSDT, ETHUSDT, SOLUSDT). Use uppercase format.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "interval": {
                        "title": "Candle Interval",
                        "enum": [
                            "1s",
                            "1m",
                            "3m",
                            "5m",
                            "15m",
                            "30m",
                            "1h",
                            "2h",
                            "4h",
                            "6h",
                            "8h",
                            "12h",
                            "1d",
                            "3d",
                            "1w",
                            "1mo"
                        ],
                        "type": "string",
                        "description": "Kline/candlestick interval. Supported values: 1s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1mo.",
                        "default": "1d"
                    },
                    "startDate": {
                        "title": "Start Date",
                        "type": "string",
                        "description": "Start date for historical data in YYYY-MM-DD format (e.g. 2024-01-01)."
                    },
                    "endDate": {
                        "title": "End Date",
                        "type": "string",
                        "description": "End date for historical data in YYYY-MM-DD format (e.g. 2025-03-31). Defaults to today if not specified."
                    },
                    "market": {
                        "title": "Market Type",
                        "enum": [
                            "spot",
                            "futures/um",
                            "futures/cm"
                        ],
                        "type": "string",
                        "description": "Which Binance market to scrape data from.",
                        "default": "spot"
                    },
                    "proxy": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Optional proxy settings. Not required for most regions."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
