Skip to content

CryptoFetch is a powerful command-line tool that downloads historical cryptocurrency price data from Binance. It features a clean terminal interface with real-time progress tracking and supports all USDT trading pairs available on Binance.

Notifications You must be signed in to change notification settings

varshithkarkera/cryptofetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

CryptoFetch - Historical Cryptocurrency Data Downloader

Interactive CLI tool to fetch historical OHLCV data directly from Binance API for any cryptocurrency.

Overview

CryptoFetch is a powerful command-line tool that downloads historical cryptocurrency price data from Binance. It features a clean terminal interface with real-time progress tracking and supports all USDT trading pairs available on Binance.

Features

  • Clean Terminal Interface: Hacker-style color-coded output
  • Symbol Verification: Validates trading pairs before downloading
  • Multiple Timeframes: 15 intervals from 1m to 1M
  • Custom Date Ranges: Flexible start/end date selection
  • Real-time Progress: Live progress bars for each download
  • Auto-organization: Creates folders and names files automatically
  • All USDT Pairs: Supports 500+ cryptocurrencies on Binance

Prerequisites

pip install requests tqdm

Quick Start

python cryptofetch.py

Follow the prompts:

  1. Enter cryptocurrency symbol (e.g., BTCUSDT, ETHUSDT, SOLUSDT)
  2. Select timeframes (e.g., 1,4,6 for 1m, 15m, 1h or all for everything)
  3. Enter start date (YYYY-MM-DD format)
  4. Enter end date (YYYY-MM-DD format)
  5. Specify output directory (or press Enter for default)
  6. Confirm and download

Example Session

    ╔═════════════════════════════════════════════════════════════╗
    ║                                                             ║
    ║   ██████╗██████╗ ██╗   ██╗██████╗ ████████╗ ██████╗         ║ 
    ║  ██╔════╝██╔══██╗╚██╗ ██╔╝██╔══██╗╚══██╔══╝██╔═══██╗        ║
    ║  ██║     ██████╔╝ ╚████╔╝ ██████╔╝   ██║   ██║   ██║        ║
    ║  ██║     ██╔══██╗  ╚██╔╝  ██╔═══╝    ██║   ██║   ██║        ║
    ║  ╚██████╗██║  ██║   ██║   ██║        ██║   ╚██████╔╝        ║
    ║   ╚═════╝╚═╝  ╚═╝   ╚═╝   ╚═╝        ╚═╝    ╚═════╝         ║
    ║                                                             ║
    ║  ███████╗███████╗████████╗ ██████╗██╗  ██╗                  ║
    ║  ██╔════╝██╔════╝╚══██╔══╝██╔════╝██║  ██║                  ║
    ║  █████╗  █████╗     ██║   ██║     ███████║                  ║
    ║  ██╔══╝  ██╔══╝     ██║   ██║     ██╔══██║                  ║
    ║  ██║     ███████╗   ██║   ╚██████╗██║  ██║                  ║
    ║  ╚═╝     ╚══════╝   ╚═╝    ╚═════╝╚═╝  ╚═╝                  ║
    ║                                                             ║
    ║        Historical Crypto Data Downloader                    ║
    ║                                                             ║
    ║        [+] Made by: Varshith Karkera                        ║
    ║        [>] github.com/varshithkarkera                       ║
    ║                                                             ║
    ╚═════════════════════════════════════════════════════════════╝

[>] Enter cryptocurrency symbol (e.g., BTCUSDT, ETHUSDT, SOLUSDT):
>>> SOLUSDT

[>] Available intervals:
   1. 1m
   2. 3m
   3. 5m
   4. 15m
   5. 30m
   6. 1h
   7. 2h
   8. 4h
   9. 6h
  10. 8h
  11. 12h
  12. 1d
  13. 3d
  14. 1w
  15. 1M

[>] Select intervals (comma-separated, e.g., 1,4,6 or 'all'):
>>> 1,4,6

[>] Start date (YYYY-MM-DD):
>>> 2020-09-01

[>] End date (YYYY-MM-DD):
>>> 2026-01-03

[>] Output directory (default: sol/):
>>> 

=================================================================
[+] DOWNLOAD SUMMARY
=================================================================
  Symbol:      SOLUSDT
  Intervals:  1m, 15m, 1h
  Date Range: 2020-09-01 to 2026-01-03
  Output:     sol/
=================================================================

[?] Start download? (y/n):
>>> y

[+] Starting download...

[*] Fetching SOLUSDT 1m from 2020-09-01 to 2026-01-03
SOLUSDT 1m |████████████████████| 100.0%
[+] Saved 2,828,160 candles to sol/solusdt_1m.csv
...

Supported Cryptocurrencies

CryptoFetch supports all USDT trading pairs available on Binance, including:

  • Bitcoin (BTCUSDT)
  • Ethereum (ETHUSDT)
  • Solana (SOLUSDT)
  • BNB (BNBUSDT)
  • XRP (XRPUSDT)
  • Cardano (ADAUSDT)
  • Dogecoin (DOGEUSDT)
  • Polygon (MATICUSDT)
  • And 500+ more...

Available Timeframes

1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M

Data Format

Each CSV file contains the following columns:

Column Description
open_time_ms Candle open time in milliseconds (Unix timestamp)
open Opening price
high Highest price during the period
low Lowest price during the period
close Closing price
volume Trading volume (base asset)
close_time_ms Candle close time in milliseconds (Unix timestamp)
quote_asset_volume Trading volume (quote asset, e.g., USDT)
number_of_trades Number of trades during the period
taker_buy_base_asset_volume Taker buy volume (base asset)
taker_buy_quote_asset_volume Taker buy volume (quote asset)
ignore Unused field (always 0)

Data Source

Binance API


Bitcoin Historical Data

For Bitcoin historical data (2018-2024), check out this comprehensive Kaggle dataset:


License

This dataset is provided as-is under the MIT License. The data is sourced from Binance's public API.

Connect


Made by Varshith Karkera

About

CryptoFetch is a powerful command-line tool that downloads historical cryptocurrency price data from Binance. It features a clean terminal interface with real-time progress tracking and supports all USDT trading pairs available on Binance.

Topics

Resources

Stars

Watchers

Forks

Languages