查詢子帳戶UID列表 (限制)
最多返回10000個子帳戶, 適合少於1萬個子帳戶的母帳戶調用。需使用母帳戶的API key。
提示
在調用接口時,使用的API key至少需要擁有以下其中一種權限
- 母API key: "Account Transfer(資產帳戶劃轉)", "Subaccount Transfer(母子帳戶劃轉)", "Withdrawal(提幣)"
HTTP 請求
GET /v5/user/query-sub-members
請求參數
無
返回參數
參數 | 類型 | 說明 |
---|---|---|
subMembers | array | Object |
> uid | string | 子帳戶userId |
> username | string | 用戶名 |
> memberType | integer | 1 : 普通子帳戶, 6 : 託管子帳戶 |
> status | integer | 帳戶狀態.
|
> accountMode | integer | 帳戶模式.
|
> remark | string | 備註 |
請求示例
- HTTP
- Python
- Node.js
GET /v5/user/query-sub-members HTTP/1.1
Host: api.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1676430318405
X-BAPI-RECV-WINDOW: 5000
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="XXXXX",
api_secret="XXXXX",
)
print(session.get_sub_uid())
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getSubUIDList()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
響應示例
{
"retCode": 0,
"retMsg": "",
"result": {
"subMembers": [
{
"uid": "53888001",
"username": "xxx001",
"memberType": 1,
"status": 1,
"remark": "test",
"accountMode": 1
},
{
"uid": "53888002",
"username": "xxx002",
"memberType": 6,
"status": 1,
"remark": "",
"accountMode": 3
}
]
},
"retExtInfo": {},
"time": 1676430319452
}