Binance API Trading: How to Set Up Automated Trading Bots

Guide to Binance API trading. Create API keys, connect trading bots, and automate your trading strategy.

Binance API Trading: How to Set Up Automated Trading Bots

What Is API Trading?

API (Application Programming Interface) trading lets you connect external software — trading bots, custom scripts, or portfolio managers — to your Binance account.

Creating API Keys

  1. Go to AccountAPI Management
  2. Click Create API
  3. Choose API type:
    • System Generated: Standard API key
    • Self-Generated: For advanced users (Ed25519)
  4. Name your API key
  5. Complete security verification
  6. Save your API Key and Secret Key

Important: The Secret Key is shown only once. Save it securely.

API Key Security

Permissions

PermissionEnable?
ReadYes (always needed)
Spot TradingYes (if trading)
Futures TradingYes (if trading futures)
WithdrawalsNO (never enable for bots)

IP Restrictions

Always restrict API keys to specific IP addresses. This prevents unauthorized use even if the key is leaked.

BotTypeCost
3CommasCloud-based$14.50+/mo
PionexBuilt-in botsFree
HummingbotOpen sourceFree
FreqtradeOpen sourceFree
Custom PythonDIYFree

Basic Python Example

# Install: pip install python-binance
from binance.client import Client

client = Client(api_key, api_secret)

# Get BTC price
ticker = client.get_symbol_ticker(symbol="BTCUSDT")
print(f"BTC Price: {ticker['price']}")

# Place a limit buy order
order = client.create_order(
    symbol='BTCUSDT',
    side='BUY',
    type='LIMIT',
    quantity=0.001,
    price='95000',
    timeInForce='GTC'
)

Rate Limits

Binance enforces API rate limits:

  • 1200 requests per minute for order-related endpoints
  • 2400 weight per minute for general endpoints
  • Exceeding limits results in temporary IP ban

Tips

  1. Start with testnet — Binance has a futures testnet for testing
  2. Never enable withdrawal permission on bot API keys
  3. Always use IP restrictions
  4. Monitor bot performance — don’t set and forget
  5. Use WebSocket for real-time data instead of polling

Verify Before You Sign Up — Don't Get Scammed

Many sites advertise fake referral discounts that don't actually apply. Before signing up through any referral link, always verify the referral code and discount rate shown on the Binance registration page. Here's proof of our verified referral:

Verified Binance referral code XVZGVYXX — 20% trade rebate and up to 600 USD new user bonus
  • Referral Code: XVZGVYXX
  • Trade Rebate: Up to 20% on every trade (lifetime)
  • New User Bonus: Up to 600 USD

If the registration page does not show these benefits, do not proceed. Only sign up when you can confirm the referral code and discount are applied.