
Navigating Binance’s extensive API documentation can feel like a deep dive into an ocean of technical parameters, endpoints, and authentication rules. You came here to build, integrate, and deploy, not to waste hours bouncing between tabs. This piece has been designed as your practical, detailed, and richly descriptive cheat sheet. If you’re working on building portfolio trackers, crypto tax platforms, or any crypto-focused application that connects with Binance, this is where you want to be. This guide saves your time by bringing together the most common Binance API commands in one accessible place, structured for ease and clarity.
Introduction to the Binance API Cheat Sheet
This Binance API cheat sheet gives you easy access to the most commonly used API commands of the crypto exchange.
Binance offers two primary sets of APIs: the REST API and the WebSocket API. REST is stateless, request-response based, and commonly used for retrieving account information, placing orders, or querying historical trades. WebSocket is ideal when you want live data streams for price changes, trades, or depth updates.
To access private user data or perform trades, you need to authenticate using an API key and a signature. Public endpoints, however, can be accessed without authentication. In your development process, remember that handling private keys and seed phrases securely remains non-negotiable, and you must never expose them in frontend code.
Section 1: Base URLs and Connectivity
Binance has different base endpoints depending on the environment and type of request. You’ll use these URLs frequently in your API calls, so it’s helpful to anchor them early in your development.
Common Base URLs
Mainnet REST:
https://api.binance.com
Testnet REST:
https://testnet.binance.vision
WebSocket Base:
wss://stream.binance.com:9443
Testnet WebSocket:
wss://testnet.binance.vision
Always make sure your environment variables are configured to switch between test and production endpoints as needed.
Section 2: Market Data Endpoints
You’ll likely use market data endpoints frequently to retrieve live or historical price information, volume, and order book depth. These endpoints are public and do not require authentication.
Ping the Server
GET /api/v3/ping
Confirms connectivity to Binance servers.
Server Time
GET /api/v3/time
Returns server time in milliseconds. Sync your time to avoid signature errors.
Exchange Info
GET /api/v3/exchangeInfo
Provides trading rules, symbol information, rate limits, and filters for all pairs.
Order Book (Depth)
GET /api/v3/depth
Query parameters:
- symbol: trading pair (e.g., BTCUSDT)
- limit: depth size (default 100, max 5000)
Example:
GET /api/v3/depth?symbol=BTCUSDT&limit=100
Recent Trades
GET /api/v3/trades?symbol=BTCUSDT&limit=50
Returns the most recent trades on a symbol.
Section 3: Kline/Candlestick Data
You’ll want historical price data for charting, or trend analysis. The endpoint for this purpose returns candlestick data with open, high, low, close (OHLC) values.
Klines
GET /api/v3/klines
Query parameters:
- symbol: pair (e.g., ETHUSDT)
- interval: e.g., 1m, 5m, 1h, 1d
- startTime, endTime: UNIX timestamps
- limit: number of data points (max 1000)
Example:
GET /api/v3/klines?symbol=ETHUSDT&interval=1h&limit=100
Section 4: Account and Wallet Endpoints (Signed)
Once you’re pulling balance and trade data for authenticated users, you’ll need to sign requests with an HMAC SHA256 signature. Here’s where the real building starts, especially if you’re focused on the top features to look for in a crypto balance api.
Account Information
GET /api/v3/account
Requires: timestamp and signature.
Returns balances, account-level permissions, and trade commissions.
Current Open Orders
GET /api/v3/openOrders?symbol=BTCUSDT
Returns all open orders for a given symbol.
All Orders (Historical)
GET /api/v3/allOrders?symbol=BTCUSDT
Optional parameters:
- orderId
- startTime, endTime
- limit
This is key for showing filled, canceled, and expired trades.
Section 5: Placing and Managing Orders
If you are building interfaces for trading automation, bots, or algorithmic tools, here are the primary order endpoints. All of these require signed authentication.
Create a New Order
POST /api/v3/order
Body parameters:
- symbol
- side: BUY or SELL
- type: LIMIT, MARKET, etc.
- quantity
- price (required for LIMIT)
- timeInForce: GTC, IOC, FOK
- timestamp and signature
Example:
json
{
"symbol": "BTCUSDT",
"side": "BUY",
"type": "LIMIT",
"quantity": 0.001,
"price": 30000,
"timeInForce": "GTC"
}
Check Order Status
GET /api/v3/order
Required query parameters:
- symbol
- orderId
- timestamp
- signature
Cancel Order
DELETE /api/v3/order
Required query parameters:
- symbol
- orderId
- timestamp
- signature
Section 6: User Data Streams (Listen Keys)
To keep real-time synchronization between Binance and your application, you will need a listen key. This lets you subscribe to updates on trades, orders, and balances.
Create Listen Key
POST /api/v3/userDataStream
Returns a listenKey to be used in WebSocket connections.
Keep Alive Listen Key
PUT /api/v3/userDataStream
Refresh your key every 30 minutes to avoid disconnection.
Section 7: WebSocket Streams
WebSocket endpoints are the cornerstone for real-time applications. These allow you to push live data into interfaces without polling the REST API.
Aggregate Trade Streams
wss://stream.binance.com:9443/ws/btcusdt@aggTrade
Streams real-time aggregate trades for the BTC/USDT pair.
Mini Ticker Stream
wss://stream.binance.com:9443/ws/!miniTicker@arr
Provides rolling price and volume data for all symbols.
User Data Stream
wss://stream.binance.com:9443/ws/<listenKey>
Replace <listenKey> with the one obtained from the REST API. This stream pushes updates for account changes, balances, and orders.
Section 8: Withdrawals and Deposits
For compliance, most Binance APIs don’t allow programmatic withdrawals on retail accounts. Still, developers can use endpoints to monitor deposit addresses and withdrawal history. This is helpful when you’re managing inflows and outflows on an application layer.
Deposit Address
GET /sapi/v1/capital/deposit/address
Query parameters:
- coin: e.g., BTC
- network (optional)
Deposit History
GET /sapi/v1/capital/deposit/hisrec
Returns a detailed log of past deposits.
Withdrawal History
GET /sapi/v1/capital/withdraw/history
Monitors past withdrawals. You’ll find this helpful when exporting transaction reports for accounting or when using different methods for your crypto taxation workflows.
Section 9: Fiat Endpoints and Savings Products
Although most Binance API usage centers around spot and margin trading, many developers also explore the use of fiat payments or interest-bearing savings options.
Fiat Payment History
GET /sapi/v1/fiat/orders
Filter by transactionType=0 (buy) or transactionType=1 (sell)
Flexible Savings Products
GET /sapi/v1/lending/daily/product/list
Provides available flexible savings products for user subscriptions.
Section 10: Error Codes and Rate Limits
If something breaks, the problem is usually one of three things: invalid timestamp, signature mismatch, or rate limits exceeded. Binance enforces strict rate limits, especially on private endpoints.
Check Exchange Info for Limits
GET /api/v3/exchangeInfo
Here you will find rate limits for weight, requests per minute, and order frequency.
Common error codes to watch:
- -2015: Invalid API-key, IP, or permissions.
- -1022: Signature for this request is not valid.
- -1003: Too many requests.
To avoid bans, continually monitor your usage weight and implement backoff strategies to prevent excessive usage.
Conclusion
You now have a comprehensive set of commands in one place that will make building your next Binance-integrated project faster and more efficient. With this guide, we do not intend for you to skip the documentation. Instead, it’s about improving your workflow, helping you focus on business logic, and freeing up time to innovate. Binance APIs are well-documented but can be overwhelming. This cheat sheet eliminates the noise, bringing you only what matters.
Keep this page open when working on tools for building portfolio trackers, automating trade entries, or exporting data for reports. Never forget the security principles, especially when handling private keys and seed phrases, which must always be stored safely, encrypted, and never shared with the client-side.
Vezgo: The Crypto API
After collecting and streamlining Binance API commands, the next step in optimizing your crypto application is integrating with Vezgo, the all-in-one Crypto API designed to eliminate the fragmentation that slows down development. Instead of building and maintaining dozens of individual exchange integrations, Vezgo’s Crypto Data API gives you access to users’ balances, tokens, positions, and full transaction histories across hundreds of centralized exchanges, DeFi wallets, and blockchain networks, all through one secure and scalable interface. Vezgo simplifies the data layer, allowing you to focus on functionality and features, rather than reconciliation or syncing issues.
Vezgo delivers accurate, up-to-date data with enterprise-grade reliability. Through built-in support for real-time data, your app can reflect live portfolio movements, token values, and activity as it happens. It is powered by a secure cloud infrastructure designed to scale as your user base grows, without sacrificing speed or uptime. That infrastructure includes performance-optimized APIs with response consistency that suits everything from mobile dashboards to sophisticated backend analytics. For developers building portfolio trackers, Vezgo makes it easy to connect to user accounts on Binance, Coinbase, Kraken, and many more, all in just a few clicks via the Vezgo Connect widget.
Security is deeply embedded in Vezgo’s foundation. The platform is compliant with SOC 2 Type II, ensuring that every aspect of data handling, storage, and processing meets the highest industry standards. Sensitive data is protected using AES-256 encryption and in-transit protection via TLS 1.2, which guards against interception, tampering, and eavesdropping. Vezgo was built with developer trust in mind, offering clean documentation, stable endpoints, and robust reliability. If you are serious about scaling your crypto product securely and efficiently, Vezgo is not just a complementary tool to the Binance API; it is the infrastructure partner you have been looking for.
Leave a Reply