A Python library to efficiently and concurrently download historical data files from Binance. Supports all asset types (spot, USDT-M, COIN-M, options) and all data frequencies.
pip install git+https://github.com/aoki-h-jp/binance-bulk-downloader
from binance_bulk_downloader.downloader import BinanceBulkDownloader
downloader = BinanceBulkDownloader()
downloader.run_download()
from binance_bulk_downloader.downloader import BinanceBulkDownloader
downloader = BinanceBulkDownloader(data_frequency='1h', asset='spot')
downloader.run_download()
from binance_bulk_downloader.downloader import BinanceBulkDownloader
downloader = BinanceBulkDownloader(data_type='aggTrades')
downloader.run_download()
Please see /example directory.
python -m example.download_klines
python -m pytest
✅: Implemented and tested. ❌: Not available on Binance.
data_type | spot | um | cm | options |
---|---|---|---|---|
aggTrades | ✅ | ✅ | ✅ | ❌ |
bookDepth | ❌ | ✅ | ✅ | ❌ |
bookTicker | ❌ | ✅ | ✅ | ❌ |
fundingRate | ❌ | ✅ | ✅ | ❌ |
indexPriceKlines | ❌ | ✅ | ✅ | ❌ |
klines | ✅ | ✅ | ✅ | ❌ |
liquidationSnapshot | ❌ | ✅ | ✅ | ❌ |
markPriceKlines | ❌ | ✅ | ✅ | ❌ |
metrics | ❌ | ✅ | ✅ | ❌ |
premiumIndexKlines | ❌ | ✅ | ✅ | ❌ |
trades | ✅ | ✅ | ✅ | ❌ |
BVOLIndex | ❌ | ❌ | ❌ | ✅ |
EOHSummary | ❌ | ❌ | ❌ | ✅ |
data_frequency | spot | um | cm | options |
---|---|---|---|---|
1s | ✅ | ❌ | ❌ | ❌ |
1m | ✅ | ✅ | ✅ | ❌ |
3m | ✅ | ✅ | ✅ | ❌ |
5m | ✅ | ✅ | ✅ | ❌ |
15m | ✅ | ✅ | ✅ | ❌ |
30m | ✅ | ✅ | ✅ | ❌ |
1h | ✅ | ✅ | ✅ | ❌ |
2h | ✅ | ✅ | ✅ | ❌ |
4h | ✅ | ✅ | ✅ | ❌ |
6h | ✅ | ✅ | ✅ | ❌ |
8h | ✅ | ✅ | ✅ | ❌ |
12h | ✅ | ✅ | ✅ | ❌ |
1d | ✅ | ✅ | ✅ | ❌ |
3d | ✅ | ✅ | ✅ | ❌ |
1w | ✅ | ✅ | ✅ | ❌ |
1mo | ✅ | ✅ | ✅ | ❌ |
Please create an issue on this repository!
This project is for educational purposes only. You should not construe any such information or other material as legal, tax, investment, financial, or other advice. Nothing contained here constitutes a solicitation, recommendation, endorsement, or offer by me or any third party service provider to buy or sell any securities or other financial instruments in this or in any other jurisdiction in which such solicitation or offer would be unlawful under the securities laws of such jurisdiction.
Under no circumstances will I be held responsible or liable in any way for any claims, damages, losses, expenses, costs, or liabilities whatsoever, including, without limitation, any direct or indirect damages for loss of profits.