| --- |
| 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`. |
|
|