Account Positions
Interface Description
Function description: Query the account position list according to the account ID page.
Applicable objects: Customers who integrate into Webull through Webull OpenAPI.
Request URL: /account/positions
Request method: GET
Frequency 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 | 20150320010101001 |
page_size | int | No | Number of entries per page: default value is 10, and the maximum value is 100 with integers being filled. | 10 |
last_instrument_id | String | No | The last target id of the previous page, if not passed, the first page is checked by default | 202202180001 |
Response Parameter
Parameter | Type | Required fields | Description | Example value |
---|---|---|---|---|
has_next | Boolean | Yes | Is there a next page | true |
holdings | [ ]Holding | No | Position List |
Holding:
Parameter | Type | Description | Example value |
---|---|---|---|
instrument_id | String | Symbol ID | 913256135 |
symbol | String | Ticker symbol | AAPL |
instrument_type | String | TickerType | STOCK |
currency | String | Currency | USD |
unit_cost | String | Cost price | 9.54 |
qty | int | Number of shares | 11000.0 |
total_cost | String | Total cost | 105006.00 |
last_price | String | Market Price | 52.250 |
market_value | String | Market capitalization | 574750.00 |
unrealized_profit_loss | String | Floating profit and loss | 469744.00 |
unrealized_profit_loss_rate | String | floating profit and loss ratio | 4.4700 |
holding_proportion | String | Position ratio | 0.9800 |
Request Example
- Python
- Java
from webullsdktrade.api import API
from webullsdkcore.client import ApiClient
from webullsdkcore.common.region import Region
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()
HttpApiConfig apiConfig = HttpApiConfig.builder()
.appKey(Env.APP_KEY)
.appSecret(Env.APP_SECRET)
.regionId(Region.us.name())
.build();
TradeApiService apiService = new TradeHttpApiService(apiConfig);
AccountPositions accountPositions = apiService.getAccountPositions(accountId, pageSize, lastInstrumentId);
Response Example
{
"has_next": false,
"holdings": [
{
"instrument_id": "913256135",
"symbol": "AAPL",
"short_name": "AAPL",
"qty": 200,
"unit_cost": "10.00",
"currency": "USD",
"total_cost": "2000.00",
"last_price": "135.62",
"market_value": "27124.00",
"unrealized_profit_loss": "25124.00",
"unrealized_profit_loss_rate": "12.56",
"holding_proportion": "1.00"
}
]
}
Exception Example
{
"error_code": "INVALID_TOKEN",
"message": "401 UNAUTHORIZED \"app_id and account_id not related\""
}