File size: 2,763 Bytes
77434ce f059345 77434ce f059345 77434ce f059345 77434ce f059345 77434ce f059345 77434ce f059345 77434ce f059345 77434ce f059345 77434ce f059345 77434ce f059345 77434ce f059345 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | ---
license: mit
task_categories:
- time-series-forecasting
language:
- en
tags:
- crypto
- finance
- 1s-klines
- binance
pretty_name: 1-Second Crypto OHLCV Data (Binance)
size_categories:
- 1B<n<10B
---
# 1-Second Crypto OHLCV Data (Binance)
Historical 1-second kline (OHLCV) data for 6 major cryptocurrencies
downloaded from [Binance Vision](https://data.binance.vision/).
Updated daily — never more than 24h behind.
## Assets
| Symbol | Start | Updated |
|----------|------------|------------|
| BTCUSDT | 2019-01 | daily |
| ETHUSDT | 2019-01 | daily |
| BNBUSDT | 2019-01 | daily |
| XRPUSDT | 2019-01 | daily |
| DOGEUSDT | 2019-07 | daily |
| SOLUSDT | 2020-10 | daily |
## File Structure
```
data/{SYMBOL}_1s.parquet ← full history, one file per asset
scripts/daily_update.py ← run to append latest daily data
```
## Schema
| Column | Type | Description |
|--------------|---------|-------------------------------|
| open_time_s | int64 | Unix timestamp in **seconds** |
| open | float64 | 1-second open price |
| high | float64 | 1-second high price |
| low | float64 | 1-second low price |
| close | float64 | 1-second close price |
| volume | float64 | Base asset volume |
## Usage
```python
import pandas as pd
# Load one asset (full history, ~200M rows for BTC)
df = pd.read_parquet(
"hf://datasets/commanderzee/1s-crypto-data/data/BTCUSDT_1s.parquet"
)
# Load all assets
SYMBOLS = ["BTCUSDT","ETHUSDT","BNBUSDT","XRPUSDT","DOGEUSDT","SOLUSDT"]
frames = {
sym: pd.read_parquet(
f"hf://datasets/commanderzee/1s-crypto-data/data/{sym}_1s.parquet"
)
for sym in SYMBOLS
}
```
## Daily Auto-Update
The `scripts/daily_update.py` checks the latest timestamp in each asset's
Parquet, downloads any missing days from Binance Vision's
[daily 1s endpoint](https://data.binance.vision/?prefix=data/spot/daily/klines/),
appends new rows, and re-uploads.
```bash
# Run manually (requires HF_TOKEN with write access):
HF_TOKEN=<your_token> python scripts/daily_update.py
# Dry-run (shows what would be fetched, no upload):
HF_TOKEN=<your_token> python scripts/daily_update.py --dry-run
# Update specific symbols only:
HF_TOKEN=<your_token> python scripts/daily_update.py --symbols BTCUSDT ETHUSDT
```
Binance publishes daily files roughly 2–4h after UTC midnight.
## Source
All data from [Binance Vision](https://data.binance.vision/) public archives.
Timestamps normalised to Unix seconds (integer division from raw ms/μs timestamps).
Duplicate bars removed; rows sorted ascending by `open_time_s`.
|