Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gesine1541ro7/UNICORN-Binance-WebSocket-API

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UNICORN-Binance-WebSocket-API

Real-time Binance market data streaming console with WebSocket stream management, live ticker snapshots, and multi-exchange support.

UNICORN Binance WebSocket API Console

An interactive Python console for real-time market data streaming from Binance using the unicorn-binance-websocket-api library.

Features

  • Real-time streaming — Subscribe to trades, klines, tickers, and more via WebSocket
  • Multi-exchange support — Binance Spot, Margin, Futures (USD-M / Coin-M), US, TR, DEX
  • Stream management — Create, monitor, and stop multiple concurrent streams
  • Market snapshots — Fetch current 24h ticker data for any trading pair
  • Rich TUI — Beautiful terminal interface with formatted tables and panels
  • Configurable — API keys, SOCKS5 proxy, default markets and channels
  • Auto-reconnect — Fully managed WebSocket connections with automatic recovery

Requirements

  • Python 3.8+
  • Internet connection (for Binance API access)

Installation

pip install -r requirements.txt

Or install dependencies from within the console using the "Install Dependencies" option.

Quick Start

python main.py

The interactive menu provides the following options:

Option Description
1 Install Dependencies
2 Configure (exchange, API keys, proxy)
3 Start Stream
4 View Active Streams
5 Market Snapshot
6 About
0 Exit

Configuration

Settings are stored in config.json and can be modified through the console or by editing the file directly:

{
  "exchange": "binance.com",
  "api_key": "",
  "api_secret": "",
  "socks5_proxy": "",
  "default_markets": ["btcusdt", "ethusdt"],
  "default_channels": ["trade", "kline_1m"],
  "output_format": "raw"
}

Supported Exchanges

Exchange Identifier
Binance binance.com
Binance Testnet binance.com-testnet
Binance Margin binance.com-margin
Binance USD-M Futures binance.com-futures
Binance Coin-M Futures binance.com-coin_futures
Binance US binance.us
Binance DEX binance.org

Project Structure

.
├── main.py          # Entry point and TUI menu
├── streamer.py      # WebSocket stream manager
├── config.py        # Configuration management
├── market.py        # Market data models and formatters
├── utils/           # Environment utilities
├── config.json      # User settings
├── requirements.txt # Python dependencies
└── README.md

Disclaimer

This tool is provided for educational and informational purposes only. It does not constitute financial, investment, or trading advice. Use of real funds and API keys is entirely at your own risk.

License

MIT

Morty Proxy This is a proxified and sanitized view of the page, visit original site.