Skip to content
A python API to use the Binance Websocket API in a easy, fast, flexible, robust and fully-featured way.
Branch: master
Clone or download
Latest commit baa3d94 May 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE Update bug_report.md May 18, 2019
tools implementation of #4 and #3 Apr 11, 2019
unicorn_binance_websocket_api Update unicorn_binance_websocket_api_manager.py May 18, 2019
.gitignore some text changes Apr 6, 2019
CHANGELOG.md release 1.2.8 May 18, 2019
LICENSE some text changes Apr 6, 2019
README.md Update README.md May 20, 2019
dev_test.py update examples May 6, 2019
dev_test_errors.py update examples May 6, 2019
dev_test_full.py update examples May 6, 2019
dev_test_full_non_stop.py update examples May 6, 2019
dev_trade_stream_ps.py Update dev_trade_stream_ps.py May 18, 2019
example_demo.py update examples May 6, 2019
example_kline_1m.py update examples May 6, 2019
example_multi_stream.py update examples May 6, 2019
example_stream_buffer.py update examples May 6, 2019
example_stream_management.py update examples May 6, 2019
example_stream_management_extended.py update examples May 6, 2019
example_ticker_and_miniticker.py stream_buffer and some small changes Apr 26, 2019
example_trade_stream.py update examples May 6, 2019
example_userdata_stream.py update example May 6, 2019
example_version_of_this_package.py Update example_version_of_this_package.py May 18, 2019
pypi_create_test_wheel.sh stream_buffer and some small changes Apr 26, 2019
pypi_create_wheel.sh Update pypi_create_wheel.sh Apr 29, 2019
pypi_install_packaging_tools.sh adding pypi_install_packaging_tools.sh Apr 12, 2019
pypi_remove_files.sh fixing mssing "-r" Apr 28, 2019
pypi_upload_wheel.sh implementation of #10 and fixed reconnect bugs Apr 28, 2019
requirements.txt testing new solution for windows color support Apr 8, 2019
setup.py release 1.2.8 May 18, 2019
test_setup.py update setup.py May 6, 2019
unicorn_binance_websocket_api.py unicorn_fy bug, splitting unicorn_fy and websocket into 2 projects Apr 30, 2019
unicorn_binance_websocket_api_process_streams.py update header text May 3, 2019
unicorn_binance_websocket_api_process_streams_without_output.py update header text May 3, 2019
unicorn_fy.py update examples May 6, 2019

README.md

GitHub release GitHub code size in bytes PyPI - Python Version code coverage 100% PyPI - Status PyPI - yes PyPI - Wheel GitHub

UNICORN Binance WebSocket API

A python API to use the Binance Websocket API in a easy, fast, flexible, robust and fully-featured way.

demo_gif

The python module UNICORN Binance WebSocket API provides an API to the Binance Websocket API, which supports the streaming of public streams like trade, kline, ticker and depth, but also the private userData stream which need to be used with a valid api_key and api_secret from the Binance Exchange.

The module requires python 3.5.3 or above, as it depends on pythons latest asyncio features for asynchronous/concurrent processing. The current dependencies are listed here.

Be aware that the Binance websocket API just offers to receive data. If you would like to set orders, withdraws and so on, you have to use the Binance Rest API in combination.

Why to use the UNICORN Binance WebSocket API?

  • 100% auto-reconnect.
  • Streams are processing asynchronous/concurrent (python asyncio) and each stream is started in a separate thread.
  • No use of the twisted module, so you can use this lib in a daemonized application (compatible with python-daemon).
  • If you can not store your data in cause of a temporary technical issue, you can kick back the data to the stream_buffer which stores the receives in the RAM till you are able to process the data in the normal way again.
  • Helpful management features like get_binance_api_status(), get_stream_info(), get_stream_list(), get_stream_statistic(), is_websocket_uri_length_valid(), replace_stream(), wait_till_stream_has_started() and many more, explore them here.

Installation

pip install unicorn-binance-websocket-api

https://pypi.org/project/unicorn-binance-websocket-api/

Note: UnicornFy is no longer part of this package! Please visit https://github.com/unicorn-data-analysis/unicorn_fy for further information.

Howto:

https://www.unicorn-data.com/blog/article-details/howto-unicorn-binance-websocket-api.html

Documentation:

https://www.unicorn-data.com/unicorn-binance-websocket-api.html

Project, code and downloads:

https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api

Wiki

https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/wiki

How to report bugs or suggest improvements?

First try the latest release via download or with pip install unicorn-binance-websocket-api --upgrade. If the issue still exists, provide the error trace, OS and python version and explain how to reproduce the error. A demo script is appreciated.

Please open a new issue: https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/issues

Contributing

UNICORN Binance WebSocket API is an open source project which welcomes contributions which can be anything from simple documentation fixes to new features. To contribute, fork the project on GitHub and send a pull request.

You can’t perform that action at this time.