Download history data from binance and save to dataframe or csv file

Overview

Binance history data downloader

Download history data from binance and save to dataframe or csv file

Requirements

python 3+
python-binance
pandas
tqdm

Install

git install git+https://github.com/zenoftrading/binance_downloader.git

Usage

Minimal interface:

from binance.client import Client
from binance_downloader import binance_downloader as bd

api_key = 'your binance api key'
api_secret = 'your binance api secret'

client = Client(api_key, api_secret)

candles = bd.get(client)
print(candles)

Output:

downloading BTCUSDT 1h from 2021-08-05 14:55:59 to 2021-08-06 14:55:59
                               open            high             low           close         volume
dateTime                                                                                          
2021-08-05 15:00:00  39005.30000000  39370.00000000  38545.59000000  38750.01000000  5612.00309000
2021-08-05 16:00:00  38750.00000000  39779.00000000  38737.31000000  39739.72000000  5641.43756100
...
2021-08-06 13:00:00  40762.87000000  41025.00000000  40700.68000000  40924.07000000  2340.43658100
2021-08-06 14:00:00  40924.08000000  40973.42000000  40649.89000000  40768.81000000  1563.73017300

Get custom data:

from binance.client import Client
from binance_downloader import binance_downloader as bd
from datetime import datetime

api_key = 'your binance api key'
api_secret = 'your binance api secret'

client = Client(api_key, api_secret)

coin = 'ETHUSDT'
interval = '1m' # support '1m', '1h' or '1d'
start = datetime(2018, 1, 1)
end = datetime(2018, 1, 2)
candles = bd.get(client, coin=coin, interval=interval, start=start, end=end, to_csv=True)
print(candles)

Output:

downloading ETHUSDT 1m from 2018-01-01 00:00:00 to 2018-01-02 00:00:00
1441it [00:01, 780.52its]           
saved to ETHUSDT_1m.csv
                             open          high           low         close        volume
dateTime                                                                                 
2018-01-01 00:00:00  733.01000000  733.97000000  732.75000000  732.75000000   19.77247000
2018-01-01 00:01:00  733.34000000  734.52000000  732.51000000  732.51000000   26.05199000
...                           ...           ...           ...           ...           ...
2018-01-01 23:59:00  755.00000000  755.01000000  754.34000000  754.99000000   40.92658000
2018-01-02 00:00:00  754.99000000  757.76000000  754.34000000  757.76000000  108.80959000

[1441 rows x 5 columns]
You might also like...
Command-line program to download videos from YouTube.com and other video sites

youtube-dl - download videos from youtube.com or other video platforms

The free and open-source Download Manager written in pure Python
The free and open-source Download Manager written in pure Python

The free and open-source Download Manager written in pure Python

A Udemy downloader that can download DRM protected videos and non-DRM protected videos.
A Udemy downloader that can download DRM protected videos and non-DRM protected videos.

Udemy Downloader with DRM support NOTE This program is WIP, the code is provided as-is and i am not held resposible for any legal repercussions result

Scripts to download files and folders programmatically from Google Drive

Google Drive Downloader Scripts Every time I need to download a lot of files from Google Drive (e.g. a dataset), it's always incredibly frustrating an

Python script designed to search and fetch direct download links from nxbrew.com
Python script designed to search and fetch direct download links from nxbrew.com

SwitchGamesDownloader Only for windows nxbrew.com is a website, accessible only using a proxy, where the majority of games for the Nintendo Switch are

A toolkit to automatically crawl the paper list and download paper pdfs of ACL Ahthology.

ACL-Anthology-Crawler A toolkit to automatically crawl the paper list and download paper pdfs of ACL Anthology

Download Photo and Video from Wall of specific user or community

vkontakte-downloader Download Photo and Video from Wall of specific User or Community on https://vk.com Setup Clone the project git clone https://gith

Download all your URI Online Judge source codes and upload to GitHub with simple steps.
Download all your URI Online Judge source codes and upload to GitHub with simple steps.

URI-Code-Downloader Download all your URI Online Judge source codes and upload to GitHub with simple steps. Prerequisites Python 3.x Installing Downlo

Owner
null
Download and save Bing wallpapers and set as background for GNOME desktop

Save Bing wallpapers and set as background for GNOME desktop This script downloads the Bing wallpaper and sets it in the background of your gnome desk

manikamran 2 Nov 6, 2021
A web app for downloading Facebook comments as a csv file

Facebook Comment Downloader A small web app for downloading comments from a public facebook page post. Comment downloading from https://github.com/min

WSDOT 23 Jan 4, 2023
S3 file download with Python and access with VBA

S3 file download with Python and access with VBA This simple project is using the following stacks: Python AWS S3 VBA/Excel A Bitcoin API With this st

Julio Cesar Scheidt 0 Dec 7, 2021
A Celery application to collect data, download media and extract information from social media APIs

Project IBEX A Celery application to collect data, download media and extract information from social media APIs. Requirements You must have a Redis D

ibex 4 Dec 15, 2022
Download India Stocks Historical Data

Kite Helper - Download Stock Market Data ?? Website Simple Application to Download any stock market data in .csv format using Kite ??‍♂️ Running Serve

Pishang Ujeniya 12 Dec 6, 2022
👻🟡 Download all Snapchat video & photo memories from a data export.

Snapchat "Memories" Fetcher In compliance with the California Consumer Privacy Act of 2018 (“CCPA”), businesses which collect and store user data must

Todd Birchard 18 Dec 26, 2022
Download candlestick data fast & easy for analysis

crypto-candlesticks ?? The goal behind this project is to facilitate downloading cryptocurrency candlestick data fast & simple. Currently only the Bit

Pedro Torres 31 Dec 11, 2022
Download Web-10K data by querying Bing Image Search

gpv2-web10k This repository contains the script to download images from the Web-10K dataset. The script takes in a list of queries, queries Bing Image

AI2 8 Sep 6, 2022
FireDM is a python open source (Internet Download Manager) with multi-connections, high speed engine, it downloads general files and videos from youtube and tons of other streaming websites .

python open source (Internet Download Manager) with multi-connections, high speed engine, based on python, LibCurl, and youtube_dl https://github.com/firedm/FireDM

null 1.6k Apr 12, 2022