查詢賬戶配置
該接口可以查詢賬戶的保證金模式(統一帳戶), 當前帳戶模式等配置
HTTP 請求
GET /v5/account/info
請求參數
無
響應參數
參數 | 類型 | 說明 |
---|---|---|
unifiedMarginStatus | integer | 帳戶狀態類型 |
marginMode | string | ISOLATED_MARGIN (逐倉保證金)REGULAR_MARGIN (全倉保證金)PORTFOLIO_MARGIN (組合保證金) |
isMasterTrader | boolean | 是否為帶單帳戶. true , false |
spotHedgingStatus | string | 是否開啟現貨對衝. ON , OFF |
updatedTime | string | 賬戶數據更新的時間,毫秒時間戳 |
dcpStatus | string | 廢棄字段, 總是OFF . 請使用查詢DCP配置 |
timeWindow | integer | 廢棄字段, 總是0 . 請使用查詢DCP配置 |
smpGroup | integer | 廢棄字段, 總是0 . 請調用查詢SMP組ID |
請求示例
- HTTP
- Python
- Node.js
GET /v5/account/info HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1672129307221
X-BAPI-RECV-WINDOW: 5000
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="XXXXX",
api_secret="XXXXX",
)
print(session.get_account_info())
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getAccountInfo()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
響應示例
{
"retCode": 0,
"retMsg": "OK",
"result": {
"marginMode": "REGULAR_MARGIN",
"updatedTime": "1697078946000",
"unifiedMarginStatus": 4,
"dcpStatus": "OFF",
"timeWindow": 10,
"smpGroup": 0,
"isMasterTrader": false,
"spotHedgingStatus": "OFF"
}
}