Get All Coins Balance
You could get all coin balance of all account types under the master account, and sub account.
Important
It is not allowed to get master account coin balance via sub account api key.
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
|
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 type |
> walletBalance | string | Wallet balance |
> transferBalance | string | Transferable balance |
> bonus | string | The bonus |
Request Example
- HTTP
- Python
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",
))
Response Example
{
"retCode": 0,
"retMsg": "success",
"result": {
"memberId": "XXXX",
"accountType": "FUND",
"balance": [
{
"coin": "USDC",
"transferBalance": "0",
"walletBalance": "0",
"bonus": ""
}
]
},
"retExtInfo": {},
"time": 1675866354913
}