Accounts
Webull's Account API allows developers to query account information via the HTTP protocol. For details, please refer to the API Reference.
Before calling the Account API, you need to have an App Key and Secret. For details, please refer to the Individual Application Process.
1. Base URLs
- Production Environment:
https://api.webull.com/ - Test Environment:
http://us-openapi-alb.uat.webullbroker.com/
2. Code Example
- Python
- Java
from webull.core.client import ApiClient
from webull.trade.trade_client import TradeClient
optional_api_endpoint = "<webull_api_host>" # PRD env host: api.webull.com; Test env host: us-openapi-alb.uat.webullbroker.com
your_app_key = "<your_app_key>"
your_app_secret = "<your_app_secret>"
region_id = "us"
api_client = ApiClient(your_app_key, your_app_secret, region_id)
api_client.add_endpoint(region_id, optional_api_endpoint)
if __name__ == '__main__':
trade_client = TradeClient(api_client)
res = trade_client.account_v2.get_account_list()
if res.status_code == 200:
print('get account list:', res.json())
public class AccountList {
private static final Logger logger = LoggerFactory.getLogger(AccountList.class);
public static void main(String[] args) throws InterruptedException {
HttpApiConfig apiConfig = HttpApiConfig.builder()
.appKey("<your_app_key>") // <your_app_key>
.appSecret("<your_app_secret>") //<your_app_secret>
.regionId("us") //<your_region_id> @see com.webull.openapi.core.common.Region
.endpoint("<webull_api_host>") //PRD env host: api.webull.com; Test env host: us-openapi-alb.uat.webullbroker.com
.build();
com.webull.openapi.trade.TradeClientV2 apiService = new com.webull.openapi.trade.TradeClientV2(apiConfig);
// get account list
List<Account> accounts = apiService.listAccount();
logger.info("Accounts: {}", accounts);
}
}