Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

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

Project description

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.


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.


pip install unicorn-binance-websocket-api

Note: UnicornFy is no longer part of this package! Please visit for further information.



Project, code and downloads:


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:


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.

Project details

Release history Release notifications

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
unicorn_binance_websocket_api-1.3.2-py3-none-any.whl (23.7 kB) Copy SHA256 hash SHA256 Wheel py3

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page