python-binance

Category: Development & Coding | Uploader: sammchardysammchardy | Downloads: 0 | Version: v1.0(Latest)

Help developers use the python-binance library for trading on Binance. Use when code imports binance, references Client/AsyncClient, or asks about Binance API trading, market data, websockets, or account management. --- # python-binance SDK Unofficial Python SDK for the Binance cryptocurrency exchange. 797+ methods covering Spot, Margin, Futures, Options, Portfolio Margin, and WebSocket APIs. ## Setup ```python from binance import Client, AsyncClient # Sync client client = Client(api_key, api_secret) # Async client client = await AsyncClient.create(api_key, api_secret) # Testnet client = Client(api_key, api_secret, testnet=True) # Demo/paper trading client = Client(api_key, api_secret, demo=True) # RSA key auth client = Client(api_key, private_key=open("key.pem").read()) # Other TLD (Binance US, Japan, etc.) client = Client(api_key, api_secret, tld="us") ``` ## Critical Patterns 1. **All methods return plain Python dicts** — not custom objects. Access fields with `response["key"]`. 2. **`**params` kwargs** — most methods accept extra Binance API parameters as keyword arguments. 3. **Sync/async parity** — `Client` and `AsyncClient` have identical method names. Use `await` for async. 4. **Enums** — import from `binance.enums` or use string values directly (`"BUY"`, `"LIMIT"`, etc.). ## Method Naming Convention This is the most important pattern — it lets you infer method names: | Prefix | Domain | Example | |--------|--------|---------| | `get_*` / `create_*` / `cancel_*` | Spot | `get_order_book()`, `create_order()` | | `futures_*` | USD-M Futures | `futures_create_order()` | | `futures_coin_*` | Coin-M Futures | `futures_coin_create_order()` | | `margin_*` | Margin | `margin_borrow_repay()` | | `options_*` | Vanilla Options | `options_place_order()` | | `papi_*` | Portfolio Margin | `papi_create_um_order()` | | `ws_*` | WebSocket CRUD | `ws_create_order()` | | `order_*` | Order helpers | `order_limit_buy()` | | `stream_*` | User data stream | `stream_get_listen_key(

Changelog: Source: GitHub https://github.com/sammchardy/python-binance

Directory Structure

Current level: tree/master/.agents/skills/python-binance/

SKILL.md

Login to download/like/favorite ❤ 7.1K | ★ 0
Comments 0

Please login before commenting.

No comments yet. Be the first one!