About binance-api-usage
binance-api-usage is a skill for interacting with Binance through the python-binance wrapper. It covers market data, account operations, order execution, and WebSocket streams, with example scripts and key-handling guidance.
Key features
- 01Fetch prices, order books, and historical candles
- 02Check balances and manage account settings
- 03Place market, limit, and OCO orders
- 04Receive real-time data over WebSockets
- 05Use example scripts and key-handling guidance
Use cases
- 01Review Binance market prices and historical data
- 02Check balances and manage a portfolio
- 03Place orders or subscribe to live market updates
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ jkpark/ agent-skills --skill binance-api-usageAfter installing, type/binance-api-usagein Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
assets/.env.examplereferences/api_usage.mdscripts/async_sockets.pybasic_ops.pyhistorical_data.pyorder_examples.pyDetails
From the project READMEBinance API Usage Skill
This skill provides a structured way to interact with the Binance exchange using the python-binance Python wrapper.
Core Workflows
1. Market Data Retrieval
Fetch current prices, order books, or historical K-line (candle) data.
- Reference: See references/api_usage.md
- Example Script: scripts/historical_data.py
2. Account & Portfolio Management
Check balances and manage account settings.
- Example Script: scripts/basic_ops.py
3. Order Execution
Place Market, Limit, or OCO (One-Cancels-the-Other) orders.
- Reference: See references/api_usage.md
- Example Script: scripts/order_examples.py
4. Real-time Streaming (WebSockets)
Stream ticker updates, trade data, or account updates using asyncio.
- Example Script: scripts/async_sockets.py
Best Practices
-
Security: Always use environment variables (
BINANCE_API_KEY,BINANCE_API_SECRETorBINANCE_SECRET_KEY) instead of hardcoding keys. -
.env file (required): Place your API keys in a
.envfile at the project root. If.envdoes not exist, create it from the provided template:cp skills/binance-trader/assets/.env.example .env # then edit .env and fill in your keysScripts shipped with this skill will automatically look for
.envin the script directory, thetest/folder, and the project root. -
Error Handling: Wrap API calls in
try-exceptblocks to handleBinanceAPIException. -
Rate Limits: Be mindful of Binance's rate limits (weight-based).
-
Testnet: Use
testnet=Trueduring development to avoid losing real funds.
Resources
- Repository: sammchardy/python-binance
- Official Docs: python-binance.readthedocs.io