跳到主要内容

账户余额

接口说明

  • 功能说明:根据账户id查询账户资产。

  • 适用对象:通过OpenAPI开发平台对接webull的客户。

  • 请求URL:/account/balance

  • 请求方式:GET

  • 频次限制:每个App ID调用频次限制为30秒10次。

请求参数

参数类型是否必填描述示例值
account_idString账户id20150320010101001
total_asset_currencyString资产计价币种,只支持 USDUSD

响应参数

参数类型描述示例值
account_idString账户id13467788
total_asset_currencyString资产计价币种,只支持 USDUSD
total_assetString账户总资产,币种为total_asset_currency字段值。
total_asset=sum(net_liquidation_value*汇率)
1247724759.52
total_market_valueString总市值,币种为total_asset_currency字段值。
total_market_value=sum(positions_market_value*汇率)
89038914.52
total_cash_balanceString现金总额,币种为total_asset_currency字段值。
total_cash_balance=sum(cash_balance*汇率)
1158685845.00
margin_utilization_rateString融资使用率,百分比。预留参数1.00
account_currency_assets[]Account_Currency_Asset账户资产列表

上述的汇率=Account_Currency_Asset中的currency币种兑换成total_asset_currency币种的汇率。

Account_Currency_Asset

参数类型描述示例值
currencyString币种USD
net_liquidation_valueString净资产
net_liquidation_value=positions_market_value+cash_balance+pending_incoming
458809435.44
positions_market_valueString持仓市值153208546.14
cash_balanceString现金余额305600889.30
margin_powerString融资购买力305587431.94
cash_powerString现金购买力305587431.94
pending_incomingString在途资金0.00
cash_frozenString冻结资金13457.36
available_withdrawalString可提现金额305587431.94
interests_unpaidString待付利息0.00

请求示例

from webullsdktrade.api import API
from webullsdkcore.client import ApiClient
from webullsdkcore.common.region import Region
from webullsdktrade.common.currency import Currency

api_client = ApiClient(your_app_key, your_app_secret, Region.US.value)
api = API(api_client)
response = api.account.get_account_balance(account_id, Currency.USD.name)
if response.status_code == 200:
account_balance = response.json()

响应示例

{
"account_id":"6TGIBSMG28Q35OVA465T99VHPB",
"total_asset_currency":"USD",
"total_market_value":"0.00",
"margin_utilization_rate":"2.00",
"account_currency_assets":[
{
"currency":"USD",
"netAsset":"400000000.00",
"marketValue":"0.00",
"cashBalance":"400000000.00",
"marginPower":"1599995029.60",
"cashPower":"4799985859.00",
"cashInTransit":"0.00",
"cashFrozen":"485.10",
"cashWithdraw":"-2485.20",
"interestsUnpaid":"0.00"
}
]
}

异常示例

{
"error_code": "INVALID_TOKEN",
"message": "401 UNAUTHORIZED \"app_id and account_id not related\""
}