Account Positions
Interface Description
Function description: Query the account position list according to the account ID page.
URL: /account/positions
Method: GET
Rate limit: The calling frequency of each App ID is limited to 10 times in 30 seconds.
Request Parameters
Parameter | Type | Required fields | Description | Example value |
---|---|---|---|---|
account_id | String | Yes | Account ID | co393b0ab01 |
Response Parameter
Parameter | Type | Required fields | Description | Example value |
---|---|---|---|---|
account_id | String | Webull Pay Account ID | co393b0ab01 | |
total_market_value | number | Total martket value | ||
invest_amt | number | Investment amount | ||
unrealized_profit_loss | number | Unrealized Profit Loss | ||
unrealized_profit_loss_rate | number | Unrealized Profit Loss Rate | ||
positions | Position | No | Position List |
Position:
Parameter | Type | Description | Example value |
---|---|---|---|
id | String | Account position ID | 1 |
instrument_id | String | Symbol ID | 950160802 |
symbol | String | Ticker symbol | BTCUSD |
name | String | Symbol name | Bitcoin |
instrument_type | String | CRYPTO | CRYPTO |
currency | String | Currency | USD |
unit_cost | String | Cost price | 9.5460000000 |
quantity | int | Number of shares | 11000.0 |
total_cost | String | Total cost | 105006.00000000000000000000 |
last_price | String | Market Price | 52.250 |
market_value | String | Market capitalization | 574750.0000000000000 |
unrealized_profit_loss | String | Floating profit and loss | 469744.00000000000000000000 |
unrealized_profit_loss_rate | String | Floating profit and loss ratio | 4.4700 |
unrealized_profit_loss_base | String | Floating profit and loss base | 0.9800 |
update_time | String | Update Time (Eastern time) | 2025-01-23 07:49:45 EST |
Request Example
- Python
- Java
from webullpaysdktrade.api import API
from webullpaysdkcore.client import ApiClient
from webullpaysdkcore.common.region import Region
your_app_key = "<your_app_key>"
your_app_secret = "<your_app_secret>"
account_id = "account_id"
api_client = ApiClient(your_app_key, your_app_secret, Region.US.value)
api = API(api_client)
response = api.account.get_account_position(account_id)
if response.status_code == 200:
account_position = response.json()
print(account_position)
HttpApiConfig apiConfig = HttpApiConfig.builder()
.appKey("<your_app_key>")
.appSecret("<your_app_secret>")
.regionId(Region.us.name())
.build();
TradeApiService apiService = new TradeHttpApiService(apiConfig);
AccountPositions accountPositions = apiService.getAccountPositions("account_id");
//print
System.out.println(JsonSerializer.toJson(accountPositions, SerializeConfig.builder().underscoresToCamel(true).build()));
Response Example
{
"account_id": "co393b0ab01",
"positions": [
{
"id": "CO0352B4Q7Q486H0KHK4HG000000",
"instrument_id": "950160802",
"symbol": "BTCUSD",
"name": "Bitcoin",
"instrument_type": "CRYPTO",
"quantity": "0.01008406",
"unit_cost": "29633.64",
"currency": "USD",
"total_cost": "298.83",
"last_price": "96528.31",
"market_value": "973.40",
"unrealized_profit_loss": "674.57",
"unrealized_profit_loss_rate": "2.2574",
"unrealized_profit_loss_base": "298.83",
"update_time": "2025-01-23 07:49:45 EST"
}
],
"total_market_value": 1392.81,
"invest_amt": 670.48,
"unrealized_profit_loss": 722.33,
"unrealized_profit_loss_rate": 1.0773
}
Exception Example
{
"error_code": "INVALID_TOKEN",
"message": "401 UNAUTHORIZED \"app_id and account_id not related\""
}