Account balance
Interface description
Function Description: Query account details by account ID.
Applicable objects: Customers who connect to Webull through the OpenApi development platform.
Request URL:
/openapi/account/balanceRequest method: GET
Frequency limit: The calling frequency of each AppId is limited to 2 times in 2 seconds.
Parameters
| Parameter | Type | Required | Description | Values/Example |
|---|---|---|---|---|
| account_id | String | Required | Account ID | 863417315629211648 |
Response
| Parameter | Type | Required | Description | Values/Example |
|---|---|---|---|---|
| total_asset_currency | String | Required | Currency | JPY |
| total_cash_balance | String | Required | Cash Balance | 485705 |
| total_unrealized_profit_loss | String | Required | Open P&L | 227689 |
| maintenance_margin | String | Required | Maintenance margin(only available for margin account) | 5.83 |
| used_margin | String | Optional | Margin currently consumed by open positions | 0.00 |
| used_margin_for_open_order | String | Optional | Margin reserved for pending/working orders; not available for other use | 11.66 |
| margin_excess | String | Optional | Remaining available margin after accounting for required margins | 9897688.80 |
| margin_ratio | String | Optional | Equity to Margin Ratio (Margin Ratio) is a risk capacity metric that measures the proportion (0%–100%) of an account’s total equity available to meet initial margin requirements. Lower values indicate a higher risk of margin stress or potential forced liquidation. | 848858.8877 |
| account_currency_assets | String | Required | []currency_assets | Details |
currency_assets
| Parameter | Type | Required | Description | Values/Example |
|---|---|---|---|---|
| currency | String | Required | Currency | JPY |
| cash_balance | String | Required | Cash Balance | 485705 |
| buying_power | String | Required | Buying Power | 484551 |
| unrealized_profit_loss | String | Required | Open P&L | 227689 |
Request example
- Python
- Java
from webullsdkcore.client import ApiClient
from webullsdktrade.api import API
api_client = ApiClient(your_app_key, your_app_secret, Region.JP.value)
api = API(api_client)
res = api.account_v2.get_account_balance(account_id)
if res.status_code == 200:
print("account_balance=" + json.dumps(res.json(), indent=4))
HttpApiConfig apiConfig = HttpApiConfig.builder()
.appKey(Env.APP_KEY)
.appSecret(Env.APP_SECRET)
.regionId(Region.jp.name())
.build();
TradeApiService apiService = new TradeHttpApiService(apiConfig);
BalanceBase accountBalance = apiService.balanceAccount(accountId, currency);
Response
Cash Account
Margin Account