Skip to main content

Account Position Details

Interface Description

  • Function description: Query the position detail list according to the account ID and ticker ID page, the position_details.contract_id in the returned data can be used for closing positions, corresponding to close_detracts.contract_id.

  • Applicable objects: Customers who connect to Webull through the OpenApi development platform.

  • Request URL: /openapi/account/position/details

  • Request method: GET

  • Frequency limit: The calling frequency of each AppId is limited to 10 times per second.

parameters

ParameterTypeRequired fieldsDescriptionExample value
account_idStringYesAccount ID863417315629211648
instrument_idStringYesTicker ID,[instrument_id] from /account/positions123456
sizeintNoNumber of entries per page: default value is 20, and the maximum value is 100 with integers being filled.20
last_instrument_idStringNoThe last position id of the previous page, if not passed, the first page is checked by default123456

Request example

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_position_details(account_id, size, ticker_id, last_instrument_id)
if res.status_code == 200:
account_position = res.json()


Response

ParameterTypeRequired fieldsDescriptionExample value
last_instrument_idStringYesnext page query id,if has next page"fqweqwq"
position_details[ ]OAuthCommonPositionDetailVONoContract list of this ticker

OAuthCommonPositionDetailVO:

ParameterTypeDescriptionExample value
idStringUnique identifier for the account position123456
symbolStringTicker symbolAAPL
account_idStringAccount IDsdfwedw3412
currencyStringCurrencyUSD
account_tax_typeStringAccount tax type refers to the dictionary value AccountTaxType. For cash account only.SPECIFIC
ticker_idStringTicker ID913256135
contract_idStringContract id, can be used for closing positions, corresponding to close_detracts.contract_idwdgfwew234123
hold_typeStringPosition side,long or shortlong
margin_typeStringONE_DAY/INDEFINITEINDEFINITE
qtyintNumber of this contract shares20
average_priceBigdecimalAverage buy price of this contract176.84
unrealized_plBigdecimalFloating profit and loss1530.80

Response example