Binance Setup Guide
Time: 10 minutes | Difficulty: Easy | Market: Crypto Mode: Full automation | API: REST + WebSocket API | Docs: binance-docs.github.io/apidocs
This guide wires a Binance trading bot to the REST and WebSocket API using the botwir3 runtime. Configure API credentials, connect to any supported trading pair, and run automated crypto trading locally.
Before you start
Verify that automated operation is permitted under Binance's current terms of service before deploying. botwir3 provides tools for building structured automation. The user is responsible for compliance with the platform's terms and all applicable regulations.
⚠ Jurisdiction. Binance is not available in the United States. US-based users can access Binance.US, which has a separate and more limited API. This guide covers Binance (global). Verify availability in the applicable jurisdiction before proceeding.
Binance Terms of Use | Last verified: May 2026
What you need
- A Binance account with identity verification (KYC) complete
- The botwir3 runtime downloaded and unzipped
- A strategy config file from the builder
Step 1: Create API credentials
- Log in to binance.com
- Navigate to Account → API Management
- Click Create API and select System generated
- Complete the security verification
- Copy the API Key and Secret Key
- Under Restrictions, enable Enable Spot & Margin Trading
- Under IP access restrictions, select Restrict access to trusted IPs only and add the IP address of the machine running the bot
Permissions required: Enable Spot & Margin Trading (or Enable Futures, depending on the strategy). Permissions to disable: Enable Withdrawals, Enable Internal Transfer. These scopes are not required for trading and can be left disabled.
🔒 Security. IP whitelisting is required for Binance API keys with trading permissions. Add only the IP address of the machine running the bot. Binance locks new API keys for 48 hours on new accounts.
Step 2: Configure the adapter
Create adapter.json in the bot directory:
{
"adapter": "binance",
"credentials": {
"api_key": "paste-api-key-here",
"api_secret": "paste-api-secret-here"
},
"trading_pair": "BTCUSDT",
"environment": "live",
"rate_limit_ms": 100
}
Common trading pairs: BTCUSDT, ETHUSDT, SOLUSDT, BNBUSDT.
API keys are stored in a local config file on the machine running the bot. They are not transmitted to botwir3 or any third party. botwir3 never sees, stores, or has access to platform credentials.
Step 3: Test the connection
botwir3 test --adapter binance
Expected output:
[botwir3] Adapter: binance
[botwir3] Connection: OK
[botwir3] Permissions: SPOT_TRADING
[botwir3] Rate limit: weight-based (1200 weight/minute)
Step 4: Start the bot
botwir3 start --config my-strategy.json
The runtime loads the strategy, computes the spec hash, connects to Binance via the local API credentials, and begins evaluating signals. The gate function compares proposed actions against the configured spec. The user is responsible for monitoring the bot and verifying execution outcomes.
Rate limits and considerations
| Endpoint | Limit | Notes |
|---|---|---|
| REST API | 1200 weight/minute | Each endpoint has a weight cost. Order placement is 1 weight. |
| WebSocket | 5 messages/second | Per connection. 1024 streams per connection. |
| Order placement (spot) | 10 orders/second | Per trading pair. 200,000 orders/day. |
| Order placement (futures) | 10 orders/second | Per symbol. Rate limits vary by tier. |
ℹ Weight-based rate limits. Binance uses a weight system rather than simple request counts. A market data call may cost 5-40 weight depending on the endpoint. Order placement costs 1 weight. Monitor weight usage via the
X-MBX-USED-WEIGHTresponse header.
Common Binance bot configurations include grid trading across a price range on BTCUSDT, DCA strategies on high-cap pairs, and momentum or mean reversion on altcoin/USDT pairs. The native bot suite (Grid, DCA) is a hosted alternative — botwir3 provides the local, air-gapped version with configurable discipline features. All actions and decisions are recorded in the local ledger.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
CONNECTION_REFUSED | API key invalid, expired, or IP not whitelisted | Verify API key and add the machine's IP to the whitelist in API Management |
RATE_LIMITED | Weight limit exceeded | Increase rate_limit_ms in adapter config. Check weight usage per endpoint. |
PERMISSION_DENIED | Trading permission not enabled on API key | Enable "Enable Spot & Margin Trading" in API Management |
INSUFFICIENT_FUNDS | Account balance cannot cover the proposed trade | Reduce position sizing in strategy config |
MANDATE_INTEGRITY_VIOLATION | Config file modified while bot is running | Stop the bot, verify config, restart |
Related guides
- Coinbase Advanced Setup Guide — crypto, US-based exchange
- Kraken Setup Guide — crypto, US-friendly with FIX protocol
- Bybit Setup Guide — crypto, derivatives-focused (not US/UK)
One bot. $129. No subscription. No $749/mo platform. → Build for Binance