Accounts
The Account API lets you retrieve your account list, query balances, and check current positions. These are typically the first calls you make before placing any orders.
Available Endpoints
| Endpoint | Description |
|---|---|
| Account List | Retrieve all accounts under your credentials |
| Account Balance | Query balance, buying power, and cash details for a specific account |
| Account Positions | Retrieve current holdings and positions for a specific account |
Typical Workflow
- Call Account List to get your
account_id - Use the
account_idto query Balance or Positions - Based on balance and positions, decide on your trading strategy
tip
The Account List response includes all accounts associated with your credentials.
Code Examples
Get Account List
- Python
- Java
from webull.core.client import ApiClient
from webull.trade.trade_client import TradeClient
api_client = ApiClient("<your_app_key>", "<your_app_secret>", "au")
api_client.add_endpoint("au", "<api_endpoint>")
trade_client = TradeClient(api_client)
res = trade_client.account_v2.get_account_list()
if res.status_code == 200:
accounts = res.json()
for account in accounts:
print(f"Account ID: {account['account_id']}, Type: {account['account_type']}")
import com.webull.openapi.core.http.HttpApiConfig;
import com.webull.openapi.trade.TradeClientV2;
HttpApiConfig config = HttpApiConfig.builder()
.appKey("<your_app_key>")
.appSecret("<your_app_secret>")
.regionId("au")
.endpoint("<api_endpoint>")
.build();
TradeClientV2 client = new TradeClientV2(config);
var accounts = client.getAccountList();
System.out.println("Accounts: " + accounts);
What's Next
- Orders — Place and manage orders using your Account ID