python-binance
Binance REST API python implementation
What it is and what it does
python-binance is an unofficial client library that wraps Binance's REST API v3, letting you automate trading, fetch market data, and manage account operations programmatically. It supports both synchronous and asynchronous workflows, with built-in handling for authentication (including RSA and EDDSA keys), timestamp generation, and response exceptions. The library covers spot trading, futures, margin trading, and portfolio margin, plus websocket streams for real-time price and order updates with automatic reconnection and multiplexing.
The package includes convenience features like historical kline fetching, deposit/withdrawal management, depth cache management, and proxy support. It provides threaded managers for websocket connections and depth caching, reducing boilerplate for common patterns. Version 1.0.20 or higher is recommended due to endpoint deprecations in earlier releases.
Use it for:
- Automate spot or futures trading strategies by placing orders, checking balances, and monitoring fills programmatically.
- Fetch historical candlestick (kline) data for backtesting or technical analysis across any date range.
- Subscribe to real-time market depth and price streams via websockets for live trading dashboards or alerts.
- Manage deposits and withdrawals, query transaction history, and handle account operations without the web UI.
- Build trading bots using async/await for concurrent order management and low-latency websocket CRUD operations.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Unofficial Python wrapper for the Binance exchange REST API v3, supporting spot trading, futures, margin trading, and real-time websocket streams with both synchronous and asynchronous interfaces.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It covers the full Binance API surface with both sync and async support, making it the standard choice for Python-based Binance automation. Install it if you need to programmatically trade or fetch data from Binance.
Install
python-binance on PyPI
pip
pip install python-binanceuv
uv add python-binancepoetry
poetry add python-binanceInstalling python-binance
Before you install
Low install friction with a pure-Python wheel distribution. Active maintenance with a recent release (67 days ago) and 7197 GitHub stars. Depends on six common libraries (requests, aiohttp, websockets, pycryptodome, dateparser) with no compiled dependencies.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install python-binance
from binance import Client
client = Client(api_key='your_key', api_secret='your_secret')
depth = client.get_order_book(symbol='BNBBTC')
prices = client.get_all_tickers()
Requires a Binance account and API key with appropriate permissions; testnet mode available via testnet=True parameter.
Verify before relying
- Whether the package maintains backward compatibility across Python 3.5–3.12 or if older versions are no longer tested.
- Current status of Vanilla Options endpoints (described as deprecated in the excerpt).
- Performance characteristics of orjson support and when it is automatically used.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — requests, six, dateparser, aiohttp, websockets, pycryptodome |
| Maintenance | actively maintained — 67 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 629,222/month — #5,668 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_binance-1.0.37-py2.py3-none-any.whl
Keywords: binance, exchange, rest, api, bitcoin, ethereum, btc, eth, neo
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
binance-connectorConnects Python applications to Binance's…
permissive · top 15,000 on PyPI
fyers-apiv3Official Python client library for the Fyers…
permissive · top 15,000 on PyPI
python-okxUnofficial Python wrapper for the OKX exchange…
permissive · top 15,000 on PyPI
shioajiShioaji is a trading API for Taiwan's financial…
unclear · top 15,000 on PyPI
python-kraken-sdkProvides REST and WebSocket clients for trading…
permissive · top 15,000 on PyPI
tastytradeAn asynchronous Python SDK for Tastytrade's…
permissive · top 15,000 on PyPI
schwab-pyUnofficial wrapper for the Charles Schwab API…
permissive · top 15,000 on PyPI
alpaca-pyAlpaca-py is the official Python SDK for…
permissive · top 5,000 on PyPI
freqtradeFreqtrade is a Python-based cryptocurrency…
copyleft · top 15,000 on PyPI
pybitpybit is the official Python connector for…
permissive · top 15,000 on PyPI