Binance.py: A Python3 Binance API Wrapper

·

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.py

For 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:

Key Features

Limitations

Binance.py does not support:

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

  1. Generate API Keys: Create a Binance API Key with appropriate permissions.
  2. Import & Initialize:

    import binance
    client = binance.Client(API_KEY, API_SECRET)
    await client.load()
  3. 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:

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.