unicorn-binance-websocket-api  by oliver-zehentleitner

Python SDK for real-time Binance WebSocket data and trading

Created 7 years ago
735 stars

Top 47.2% on SourcePulse

GitHubView on GitHub
Project Summary

Summary This Python SDK provides a robust, high-performance interface to Binance's WebSocket APIs, enabling real-time data streaming and account management. It simplifies direct WebSocket integration with automatic reconnection and asynchronous handling. Ideal for traders, analysts, and developers needing reliable, low-latency access across Binance spot, margin, futures, and testnet environments.

How It Works

The library utilizes Python's asyncio for concurrent stream processing, with each stream managed in a separate thread. It offers flexible data consumption via buffer polling, callbacks, or asyncio queues. Key performance gains are achieved through Cython and PyPy wheels, compiled C extensions. The system ensures fully managed WebSocket connections with 100% auto-reconnect and resilience against Binance maintenance windows.

Quick Start & Requirements

Highlighted Details

  • Performance: Leverages Cython/PyPy wheels for significant execution speed improvements.
  • Robustness: Features 100% auto-reconnect and handles Binance maintenance windows.
  • Full API Access: Supports sending orders and cancellations directly via WebSocket.
  • Exchange Support: Covers Binance spot, margin, futures, options, US, TR, and testnets.
  • Data Handling: Flexible output formats, stream buffers, and real-time stream status signals.

Maintenance & Community

This open-source project welcomes contributions. Community discussions are available via Telegram (https://t.me/unicorndevs). Update notifications can be received through GitHub actions or the is_update_available() function.

Licensing & Compatibility

The specific license is not explicitly stated, though it is an open-source project. The library is tested and compatible across Linux, macOS, and Windows on various architectures (x86, arm32, arm64), with no memory leaks reported for Python 3.9-3.14.

Limitations & Caveats

Conda support is noted as pending migration to conda-forge. The README warns against using the library to circumvent Binance's geographical restrictions. Development versions are explicitly marked as unstable.

Health Check
Last Commit

23 hours ago

Responsiveness

Inactive

Pull Requests (30d)
12
Issues (30d)
2
Star History
0 stars in the last 30 days

Explore Similar Projects

Starred by Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), Maxime Beauchemin Maxime Beauchemin(Author of Apache Airflow, Superset; Founder of Preset), and
3 more.

bytewax by bytewax

0%
2k
Python framework for stateful stream processing
Created 4 years ago
Updated 2 months ago
Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Georgios Konstantopoulos Georgios Konstantopoulos(CTO, General Partner at Paradigm), and
3 more.

risingwave by risingwavelabs

0.0%
9k
Stream processing and serving for AI agents and real-time data applications
Created 4 years ago
Updated 8 hours ago
Feedback? Help us improve.