Project Description
Binance.py is a powerful Python3 Binance API wrapper designed to simplify interactions with Binance's trading platform. Built with asyncio and Python Decimals, this library offers a modern, efficient, and precise solution for developers.
Installation
Install the library effortlessly with pip:
# Linux/macOS
python3 -m pip install -U binance.py
# Windows
py -3 -m pip install -U binance.pyFor manual installation:
python setup.py sdist bdist_wheel
python -m pip install dist/binance.py-X.X.X-py3-none-any.whl👉 Explore advanced trading strategies to maximize your Binance API usage.
Why Choose Binance.py?
Navigating Binance's API can be daunting. Binance.py streamlines the process by:
- Adopting best practices automatically.
- Providing an asynchronous, modern interface.
- Saving development time with pre-built endpoints.
Key Features
- General Endpoints: Test connectivity and fetch exchange information.
- Market Data: Access real-time and historical market data.
- Account Management: Create and manage orders seamlessly.
- User Data Streams: Receive live updates on user activities.
- WebSocket Streams: Subscribe to real-time market updates.
- Async Support: Fully asynchronous for high-performance applications.
- Free & Unlimited: No hidden costs or usage restrictions.
Limitations
Binance.py does not support:
- Withdraw API.
- Margin trading API.
Need these features? Consider contributing to the project or exploring alternative libraries.
👉 Learn more about API best practices to enhance your trading bot's efficiency.
Getting Started
- Generate API Keys: Create a Binance API Key with appropriate permissions.
Import & Initialize:
import binance client = binance.Client(API_KEY, API_SECRET) await client.load()Place a Test Order:
order = await client.create_order( "ETHPAX", binance.Side.BUY.value, binance.OrderType.MARKET.value, quantity="1", test=True ) print(order) await client.close()
Check out the examples folder for more use cases.
License & Donations
Binance.py is open-source. Support the project via:
- ETH (ENS):
thomas.ethers.xyz - ETH (Legacy):
0x54c5a92c57A07f33500Ec9977797219D70D506C9 - BTC:
bc1qm9g2k3fznl2a9vghnpnwem87p03txl4y5lahyu
Community Projects
Martin Binance
A free trading system for Binance SPOT markets featuring an adaptive reverse grid strategy based on martingale principles.
FAQ
1. Is Binance.py suitable for high-frequency trading?
Yes! Its asynchronous design ensures low latency and high throughput, ideal for high-frequency trading scenarios.
2. Can I use Binance.py for algorithmic trading?
Absolutely. The library supports all major order types and real-time data streams, making it perfect for algo-trading.
3. How do I handle API rate limits?
Binance.py automatically manages rate limits by queuing requests and retrying when necessary.
4. Does Binance.py support futures trading?
No, it currently focuses on SPOT trading endpoints. Futures support may be added in future updates.
5. Where can I report bugs or request features?
Visit the GitHub repository to submit issues or pull requests.