Fast, free, and self-hostable historical cryptocurrency OHLCV candlestick data downloader. Pick your source: Binance, OKX, Coinbase, Bitget or Gate public APIs. Available as an interactive Python CLI and a 100% serverless web application.
cryptofetch lets you download high-resolution OHLCV (Open, High, Low, Close, Volume) candlestick historical price data directly from public exchange APIs with:
- 5 exchanges: Binance (default), OKX, Coinbase, Bitget, Gate
- No API keys required
- Light on the exchanges: requests are paced to stay within each exchange's public rate limits (the web app calls them straight from your browser, so limits apply to your own IP)
- Completely free & open source
- Up to 15 timeframes (
1mto1M, depending on the exchange) - Hundreds of trading pairs per exchange
- One CSV format for every exchange, formatted for quantitative backtesting
- Instant CSV & ZIP exports
| Exchange | Symbol style | Intervals | Notes |
|---|---|---|---|
| Binance (default) | BTCUSDT |
all 15 | Binance Vision public API |
| OKX | BTC-USDT |
all except 8h |
UTC-aligned daily/weekly/monthly candles |
| Coinbase | BTC-USD |
1m 5m 15m 1h 6h 1d |
Mostly USD pairs; 300 candles per request |
| Bitget | BTCUSDT |
all except 2h 8h |
UTC-aligned daily/weekly/monthly candles |
| Gate | BTC_USDT |
1m 5m 15m 30m 1h 4h 8h 1d 1w |
Only the latest 10,000 candles per interval |
You can type just the coin (BTC) or any style (BTCUSDT, BTC-USDT, btc_usdt); cryptofetch converts it for the selected exchange. Prices and volumes differ slightly between exchanges because each reports its own market. Columns an exchange does not provide (for example trade counts) are left empty.
Live Web App: cryptofetch.vercel.app
A modern, high-performance web interface designed for fast and intuitive historical cryptocurrency data extraction.
- 100% Serverless: Client-side direct streaming from the exchange's public API straight to browser memory.
- Exchange picker: Switch between Binance, OKX, Coinbase, Bitget and Gate; unsupported intervals are greyed out for the chosen exchange.
- Single & Multi-Crypto Modes: Download a single asset or batch-fetch multiple coins at once.
- ZIP Bundling: When downloading multiple intervals or pairs, assets are automatically packed into a clean
.ziparchive via JSZip. - Dynamic Theming: Obsidian dark & crisp white light modes with smooth view-transitions.
- Zero Scroll Layout: Clean 2-column interface designed to fit seamlessly on modern desktop screens.
cd cryptofetch-web
# Install dependencies
npm install
# Start local development server
npm run devOpen http://localhost:3000 in your browser.
# Deploy straight from the cryptofetch-web folder
vercelInteractive command-line tool with color-coded prompts and live progress tracking.
pip install requests tqdmpython cryptofetch.py
# or pick the exchange up front: binance, okx, coinbase, bitget, gate
python cryptofetch.py --exchange okxFollow the interactive prompts: 0. Select the exchange (Enter for Binance)
- Enter cryptocurrency symbol (e.g.
BTCUSDT,ETHUSDT,SOLUSDT, or justBTC) - Select intervals (e.g.
1,4,6for 1m, 15m, 1h orall; the list shows what the exchange supports) - Enter start date (
YYYY-MM-DD) - Enter end date (
YYYY-MM-DD) - Specify output directory (defaults to
<symbol>/) - Confirm and download
╔═════════════════════════════════════════════════════════════╗
║ ║
║ ██████╗██████╗ ██╗ ██╗██████╗ ████████╗ ██████╗ ║
║ ██╔════╝██╔══██╗╚██╗ ██╔╝██╔══██╗╚══██╔══╝██╔═══██╗ ║
║ ██║ ██████╔╝ ╚████╔╝ ██████╔╝ ██║ ██║ ██║ ║
║ ██║ ██╔══██╗ ╚██╔╝ ██╔═══╝ ██║ ██║ ██║ ║
║ ╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝ ║
║ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ║
║ ║
║ ███████╗███████╗████████╗ ██████╗██╗ ██╗ ║
║ ██╔════╝██╔════╝╚══██╔══╝██╔════╝██║ ██║ ║
║ █████╗ █████╗ ██║ ██║ ███████║ ║
║ ██╔══╝ ██╔══╝ ██║ ██║ ██╔══██║ ║
║ ██║ ███████╗ ██║ ╚██████╗██║ ██║ ║
║ ╚═╝ ╚══════╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ║
║ ║
║ Historical Crypto Data Downloader ║
║ ║
║ [>] 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
[+] Saved 2,828,160 candles to sol/solusdt_1min_fetched_20260103_120000.csv
Supports the spot trading pairs of every supported exchange (USDT pairs on Binance, OKX, Bitget and Gate, mostly USD pairs on Coinbase), including:
- Bitcoin (
BTCUSDT) - Ethereum (
ETHUSDT) - Solana (
SOLUSDT) - BNB (
BNBUSDT) - XRP (
XRPUSDT) - Cardano (
ADAUSDT) - Dogecoin (
DOGEUSDT) - And hundreds more...
1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M
Each CSV dataset contains standard OHLCV backtest headers:
| Column | Description |
|---|---|
open_time_ms |
Candle open timestamp in milliseconds (Unix epoch) |
open |
Opening price |
high |
Highest price during the candle |
low |
Lowest price during the candle |
close |
Closing price |
volume |
Base asset trading volume |
close_time_ms |
Candle close timestamp in milliseconds (Unix epoch) |
quote_asset_volume |
Quote asset volume (USDT) |
number_of_trades |
Number of executed trades |
taker_buy_base_asset_volume |
Taker buy base asset volume |
taker_buy_quote_asset_volume |
Taker buy quote asset volume |
ignore |
Unused / reserved field (0) |
Directly sourced from the public market data APIs of Binance (Binance Vision), OKX, Coinbase Exchange, Bitget and Gate. No account or key is needed. Each exchange has its own terms of use for its API, so please check them before redistributing the data. Files from exchanges other than Binance are named with the exchange as a prefix (for example okx_btc-usdt_1h_...csv).
For pre-compiled historical Bitcoin datasets, see:
- X (Twitter): @varshithkarkera
- Portfolio: varshith.me
- Buy Me a Coffee: buymeacoffee.com/varshithkarkera
This dataset is provided as-is under the MIT License. The data is sourced from the public APIs of the exchanges listed above.