skillfed

python-binance

Binance REST API python implementation

python-binance v1.0.37 629.2K downloads/30d#5,668 on PyPI7,197
Permissive license MIT Active released

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-binance

uv

uv add python-binance

poetry

poetry add python-binance

Installing 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

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

binance api python wrappercryptocurrency trading automationbinance spot futures tradingreal-time crypto market databinance websocket streamsasync binance clientcrypto exchange rest api
trading-apicryptocurrencywebsockets

More Python Modules packages