Overview of UNICORN Binance WebSocket API
masterThe UNICORN Binance WebSocket API is a high-performance Python package designed to interface with various Binance WebSocket endpoints. It provides a fully managed connection with 100% auto-reconnect capabilities and handles maintenance windows automatically.
Key features include:
- Broad Exchange Support: Supports Binance (com, US, TR), Binance Testnet, Margin, Isolated Margin, Futures (USD-M and COIN-M), European Options, and Portfolio Margin.
- High Performance: Delivered as a compiled C extension (part of the UBS stack) for maximum speed and no memory leaks across Python versions 3.9 to 3.14.
- Versatile Data Handling: Supports public streams (trade, kline, ticker, depth, etc.) and private
!userDatastreams usingapi_keyandapi_secret. - Concurrency: Streams are processed using
asyncioin separate threads, allowing you to consume data via callbacks orawaitwithout needing to manage complex asyncio logic yourself. - Request Support: Enables sending requests like
create_orderandcancel_open_ordersdirectly over the WebSocket API.