Get Balance
Retrieves account balance information for a specific cryptocurrency or all cryptocurrencies in your Binance spot wallet.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Client Id - The unique identifier from the Connect node (optional if using direct credentials).
- Currency - The asset symbol to query (e.g.,
BTC,ETH,USDT,BNB).
Options
- Api Key - (Optional) Binance API key credential. Use if not providing Client Id.
- Secret Key - (Optional) Binance API secret key credential. Use if not providing Client Id.
- Wallet Type - The type of wallet to check. Currently only
Spotis supported. - GetAllCurrencies - (Boolean) If true, returns balances for all currencies; if false, returns only the specified currency.
Output
- Result - Balance information. Format depends on GetAllCurrencies option:
- If false: Single balance object for the specified currency
- If true: Array of balance objects for all currencies
How It Works
The Get Balance node queries your Binance account for current holdings.
When executed, the node:
- Retrieves the Binance client (from Client Id or creates one from credentials)
- Validates the Currency input
- Queries Binance account information
- Returns either a single currency balance or all balances based on the GetAllCurrencies option
Requirements
- Either a Client Id from Connect node OR API credentials in options
- Valid currency symbol (must exist on Binance)
- Appropriate API permissions (account reading enabled)
- Spot wallet access
Error Handling
The node will return specific errors in the following cases:
- ErrInternal - Failed to retrieve input values
- ErrInvalidArg - Empty Currency or invalid Wallet Type
- ErrGetAccount - Failed to retrieve account information from Binance
- ErrInvalidCurrency - Specified currency not found in account (when GetAllCurrencies is false)
Usage Notes
- Currently only supports Spot wallet balances
- Balance includes both
free(available) andlocked(in orders) amounts - GetAllCurrencies = false requires exact currency symbol match
- All balances are returned when GetAllCurrencies = true, even zero balances
- Currency symbols are case-sensitive (use uppercase: BTC, not btc)
Balance Object Structure
Single Currency (GetAllCurrencies = false):
{
"asset": "BTC",
"free": "0.12345678",
"locked": "0.00100000"
}
All Currencies (GetAllCurrencies = true):
[
{
"asset": "BTC",
"free": "0.12345678",
"locked": "0.00100000"
},
{
"asset": "ETH",
"free": "1.50000000",
"locked": "0.00000000"
},
{
"asset": "USDT",
"free": "1000.50000000",
"locked": "500.00000000"
}
]
Balance Fields
- asset - The cryptocurrency symbol
- free - Available balance (can be used for trading)
- locked - Balance locked in open orders
- Total Balance = free + locked
Example: Check Bitcoin Balance
Scenario: Get your current BTC holdings
Inputs:
- Client Id: (from Connect node)
- Currency:
BTC
Options:
- Wallet Type:
Spot - GetAllCurrencies:
false
Output:
{
"asset": "BTC",
"free": "0.12345678",
"locked": "0.00100000"
}
Example: Get All Balances
Inputs:
- Client Id: (from Connect node)
- Currency:
BTC(required but ignored when GetAllCurrencies is true)
Options:
- Wallet Type:
Spot - GetAllCurrencies:
true
Output: Array of all asset balances in your account.
Example: Pre-Trade Balance Check
[Connect]
|
v
[Get Balance: USDT]
|
v
[Extract: available = result.free]
|
v
[If: available >= 100]
|
+---> [Buy Order: spend 100 USDT]
|
+---> [Alert: "Insufficient USDT balance"]
v
[Disconnect]
Example: Portfolio Summary
[Connect]
|
v
[Get Balance: all currencies]
| GetAllCurrencies: true
v
[Filter: balances where free > 0]
|
v
[For Each: balance]
|
v
[Get Price: balance.asset + "USDT"]
|
v
[Calculate: value = balance.free * price]
|
v
[Sum: total portfolio value]
|
v
[Generate Report]
|
v
[Disconnect]
Example: Available Balance Check
[Get Balance: BTC]
|
v
[Calculate: total = parseFloat(result.free) + parseFloat(result.locked)]
[Calculate: available_percentage = (parseFloat(result.free) / total) * 100]
|
v
[If: available_percentage < 20]
|
v
[Alert: "Most BTC is locked in orders"]
Calculating Total Balance
const totalBalance = parseFloat(balance.free) + parseFloat(balance.locked);
const availableBalance = parseFloat(balance.free);
const lockedBalance = parseFloat(balance.locked);
const availablePercentage = (availableBalance / totalBalance) * 100;
Use Cases
Pre-Trade Validation:
- Verify sufficient balance before placing orders
- Check if funds are available (not locked)
- Validate order amounts against available balance
Portfolio Management:
- Track total holdings across assets
- Calculate portfolio value in USDT
- Monitor asset allocation
Risk Management:
- Ensure adequate reserves before trading
- Check locked balances in open orders
- Monitor available liquidity
Reporting:
- Generate balance reports
- Track account growth over time
- Audit holdings
Trading Tips
- Always check balance before placing orders to avoid errors
- Use
freeamount not total for order validation - Parse strings to numbers for mathematical operations
- Consider locked balance when calculating total holdings
- Cache balances briefly to reduce API calls
- Filter zero balances when displaying portfolio
Best Practices
- Check balance before every trade to avoid insufficient balance errors
- Use the
freefield to determine available trading balance - Parse balance strings to floating-point numbers for calculations
- When GetAllCurrencies is true, filter out zero balances for cleaner data
- Cache balance data briefly to reduce API calls
- Implement error handling for network issues
- Consider both free and locked when calculating total holdings
- Use balance checks in conditional logic before trading operations
Common Patterns
Validation Pattern:
Get Balance
If balance.free >= required_amount:
Execute Trade
Else:
Alert Insufficient Balance
Portfolio Value Pattern:
Get All Balances
For Each Balance:
Get Price in USDT
Calculate Value
Sum Total Portfolio Value
Available Liquidity Pattern:
Get Balance
Calculate: available = free / (free + locked)
If available < 0.5:
Alert: "Low liquidity - many funds in orders"
Understanding Locked Balance
Locked balance represents funds in active orders:
- Buy orders: Quote asset (USDT) is locked
- Sell orders: Base asset (BTC) is locked
- Canceled orders: Locked funds are immediately freed
- Filled orders: Locked funds are used and freed
Currency Symbols
Common currency symbols on Binance:
- Bitcoin:
BTC - Ethereum:
ETH - Binance Coin:
BNB - Tether:
USDT - USD Coin:
USDC - Binance USD:
BUSD - Cardano:
ADA - Solana:
SOL