Skip to main content

Fetch binance historical klines or trades easily.

Project description

https://img.shields.io/pypi/v/binance-history https://img.shields.io/codecov/c/github/xzmeng/binance-history https://img.shields.io/github/actions/workflow/status/xzmeng/binance-history/tests.yml?label=tests

Fetch binance public data easily.

Usage

>>> import binance_history as bh
>>> klines = bh.fetch_klines(
...     asset_type="spot",
...     symbol="BTCUSDT",
...     timeframe="1m",
...     start="2022-12-14",
...     end="2022-12-24",
...     tz="Asia/Shanghai"
... )
                               open      high       low     close     volume  quote_volume  trades                   close_datetime
open_datetime
2022-12-14 00:00:00+08:00  17753.54  17768.41  17752.78  17766.99  240.82918  4.277685e+06    5241 2022-12-14 00:00:59.999000+08:00
2022-12-14 00:01:00+08:00  17766.99  17786.40  17764.37  17781.81  311.47670  5.536668e+06    6278 2022-12-14 00:01:59.999000+08:00
2022-12-14 00:02:00+08:00  17781.81  17790.54  17771.44  17785.37  372.12992  6.616562e+06    6911 2022-12-14 00:02:59.999000+08:00
2022-12-14 00:03:00+08:00  17786.23  17800.18  17774.63  17777.35  401.52223  7.142210e+06    6926 2022-12-14 00:03:59.999000+08:00
2022-12-14 00:04:00+08:00  17777.35  17785.98  17769.15  17781.93  218.03837  3.876373e+06    5519 2022-12-14 00:04:59.999000+08:00
...                             ...       ...       ...       ...        ...           ...     ...                              ...
2022-12-23 23:56:00+08:00  16850.22  16850.22  16839.55  16842.59  146.38906  2.465894e+06    4229 2022-12-23 23:56:59.999000+08:00
2022-12-23 23:57:00+08:00  16842.59  16846.22  16839.00  16840.99   86.95440  1.464495e+06    3152 2022-12-23 23:57:59.999000+08:00
2022-12-23 23:58:00+08:00  16840.99  16843.61  16827.28  16830.27  208.41471  3.508642e+06    4918 2022-12-23 23:58:59.999000+08:00
2022-12-23 23:59:00+08:00  16830.27  16836.66  16824.41  16832.16  154.10833  2.593717e+06    4502 2022-12-23 23:59:59.999000+08:00
2022-12-24 00:00:00+08:00  16832.15  16833.62  16828.42  16830.52  119.28572  2.007721e+06    3725 2022-12-24 00:00:59.999000+08:00

[14401 rows x 8 columns]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

binance_history-0.1.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

binance_history-0.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file binance_history-0.1.1.tar.gz.

File metadata

  • Download URL: binance_history-0.1.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-1024-azure

File hashes

Hashes for binance_history-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b76303b8c7bc2366eb7fb7b74cd2d75c22938d3c95b48c72b3b5f3d200cb6f26
MD5 d2167c7198ba78426072c5aa38085fc7
BLAKE2b-256 4a855c730b377680cb5c9e8d4cbb0c2220a6248d21228fb3af454dff03b9ba7e

See more details on using hashes here.

File details

Details for the file binance_history-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: binance_history-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-1024-azure

File hashes

Hashes for binance_history-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 72b3288b793bb49f9cd2e9dd574dbb25f2d15864efbe4d2c40890a6102fc7d31
MD5 e26631cc96d2f408ef9ee6490ba24e2c
BLAKE2b-256 c036528c07a8e322b70c204add295957df3b46c9ed3aeda26cf647be6c818dac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page