Get All Coins Balance
You could get all coin balance of all account types under the master account, and sub account.
HTTP Request
GET /v5/asset/transfer/query-account-coins-balance
Request Parameters
Parameter | Required | Type | Comments |
---|---|---|---|
memberId | false | string | User Id. It is required when you use master api key to check sub account coin balance |
accountType | true | string | Account type |
coin | false | string | Coin name, uppercase only
UNIFIED , and supports up to 10 coins each request |
withBonus | false | integer | 0 (default): not query bonus. 1 : query bonus |
Response Parameters
Parameter | Type | Comments |
---|---|---|
accountType | string | Account type |
memberId | string | UserID |
balance | array | Object |
> coin | string | Currency |
> walletBalance | string | Wallet balance |
> transferBalance | string | Transferable balance |
> bonus | string | Bonus |
Request Example
- HTTP
- Python
- Node.js
GET /v5/asset/transfer/query-account-coins-balance?accountType=FUND&coin=USDC HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1675866354698
X-BAPI-RECV-WINDOW: 5000
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="XXXXX",
api_secret="XXXXX",
)
print(session.get_coins_balance(
accountType="FUND",
coin="USDC",
))
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getAllCoinsBalance({ accountType: 'FUND', coin: 'USDC' })
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
Response Example
{
"retCode": 0,
"retMsg": "success",
"result": {
"memberId": "XXXX",
"accountType": "FUND",
"balance": [
{
"coin": "USDC",
"transferBalance": "0",
"walletBalance": "0",
"bonus": ""
}
]
},
"retExtInfo": {},
"time": 1675866354913
}