查詢資產信息
只能查詢經典帳戶的現貨帳戶資產
HTTP 請求
GET /v5/asset/transfer/query-asset-info
請求參數
參數 | 是否必需 | 類型 | 說明 |
---|---|---|---|
accountType | true | string | 賬戶類型, SPOT |
coin | false | string | 幣種 |
響應參數
參數 | 類型 | 說明 |
---|---|---|
spot | Object | |
> status | string | 賬戶狀態. ACCOUNT_STATUS_NORMAL : 正常, ACCOUNT_STATUS_UNSPECIFIED : 禁用 |
> assets | array | Object |
>> coin | string | 幣種 |
>> frozen | string | 掛單凍結金額 |
>> free | string | 可用余額 |
>> withdraw | string | 提現中金額 |
請求示例
- HTTP
- Python
- Node.js
GET /v5/asset/transfer/query-asset-info?accountType=SPOT&coin=ETH HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1672136538042
X-BAPI-RECV-WINDOW: 5000
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="XXXXX",
api_secret="XXXXX",
)
print(session.get_spot_asset_info(
accountType="FUND",
coin="USDC",
))
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getAssetInfo({ accountType: 'FUND', coin: 'USDC' })
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
響應示例
{
"retCode": 0,
"retMsg": "success",
"result": {
"spot": {
"status": "ACCOUNT_STATUS_NORMAL",
"assets": [
{
"coin": "ETH",
"frozen": "0",
"free": "11.53485",
"withdraw": ""
}
]
}
},
"retExtInfo": {},
"time": 1672136539127
}