easy-binance
An Agent Skill for Binance Derivatives Trading
Let your AI agent trade, query, and stream Binance futures & options — via CLI or Python
Features
| Feature | Description |
|---|---|
| Multi-product | USDⓈ-M Futures, COIN-M Futures, Options, Portfolio Margin, Portfolio Margin Pro |
| CLI | Installable entrypoint — easy-binance --help |
| REST | Typed REST API calls via official SDKs |
| WebSocket API | Request/response over WebSocket connections |
| WebSocket Streams | Real-time market data subscriptions |
| Python Library | Use directly in your own scripts and projects |
| Dynamic Discovery | Auto-discover all available methods per product |
.env Support |
Credentials from .env (CWD) → env vars, with smart precedence |
Install
pip install easy-binance
Local development setup
uv venv .venv
uv pip install -e .[dev]
Credentials
Expected variable names:
BINANCE_API_KEY=...
BINANCE_API_SECRET=...
CLI Examples
List products
easy-binance products
List REST methods for USDⓈ-M Futures
easy-binance methods usds-futures rest
Describe a method
easy-binance describe usds-futures rest exchange_information
Call a public REST endpoint
easy-binance call usds-futures rest exchange_information
Call a WebSocket API endpoint
easy-binance call usds-futures websocket-api order_book --param symbol=BTCUSDT
Listen to a WebSocket stream
easy-binance listen usds-futures aggregate_trade_streams --param symbol=btcusdt --duration 5
Raw REST request via official SDK
easy-binance call usds-futures rest send_request \
--param endpoint=/fapi/v1/exchangeInfo \
--param method=GET
Python Examples
REST call
from easy_binance import EasyBinance
client = EasyBinance()
info = client.call("usds-futures", "rest", "exchange_information")
print(info["data"]["timezone"])
WebSocket API call
book = client.call(
"usds-futures",
"websocket-api",
"order_book",
params={"symbol": "BTCUSDT"},
)
print(book["data"])
Stream subscription
from easy_binance import EasyBinance
client = EasyBinance()
messages = client.listen(
"usds-futures",
"aggregate_trade_streams",
params={"symbol": "btcusdt"},
duration=3,
max_messages=2,
)
print(messages)
Use as Agent Skill
The skills/easy-binance/SKILL.md file is a skill manifest that teaches AI agents how to use this tool autonomously. It covers:
- Install & verification steps
- Credential resolution
- Product / API / method discovery workflow
- CLI and Python calling conventions
- Parameter encoding rules
- Safe operating defaults (bounded streams, describe-before-call)
- Failure handling & recovery
Supported agent platforms
| Platform | How to register |
|---|---|
| Claude Code | Place skills/easy-binance/ under your project root — Claude Code discovers it automatically |
| Other agents | Point the agent at SKILL.md as a system prompt or tool description |
Project Structure
easy-binance/
├── skills/easy-binance/
│ └── SKILL.md # Agent skill manifest
├── src/easy_binance/
│ ├── cli.py # Typer CLI entrypoint
│ ├── core.py # Unified facade logic
│ ├── config.py # Credential resolution & .env loading
│ ├── products.py # Product registry
│ ├── formatting.py # Rich output formatting
│ ├── utils.py # Shared helpers
│ └── errors.py # Custom exceptions
├── tests/
├── pyproject.toml
└── README.md
License
This project is licensed under the Apache License 2.0.
Metadata
Release files for easy-binance 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| easy_binance-0.1.0.tar.gz | 17.3 kB | Without provenance | Details for easy_binance-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| easy_binance-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for easy_binance-0.1.0-py3-none-any.whl |
Total release size: 35.1 kB
Release files / easy_binance-0.1.0.tar.gz
| Download URL | easy_binance-0.1.0.tar.gz |
|---|---|
| Size | 17.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8920ddffcb1e1b22398780e41e473f2beb17eeccdf43c8830533cdc25a42021
|
|
BLAKE2b-256 checksum How to use checksums |
67d7241c87f9142f4ca29a36c5aa412ddb3e973241dc673c994a7907aa09ac42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Release files / easy_binance-0.1.0-py3-none-any.whl
| Download URL | easy_binance-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c7655a1c8db48395415480543369e32bb19e90395c74d78256e04a298ba37e18
|
|
BLAKE2b-256 checksum How to use checksums |
381aee8bd2b7e9dfbb9e91d051efc03e7b0d9e6d49e8aba8102959bd5aaf78fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Security for easy-binance 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.