A new OpenAPI v2 interface has been added this time, and future iterations will continue on the v2 interface.
A new OpenAPI v2 interface has been added this time, and future iterations will continue on the v2 interface.
A new OpenAPI v2 interface has been added this time, and future iterations will continue on the v2 interface.
Skip to main content

Account Positions

Interface Description

  • Function description: Query the account position list according to the account ID page.

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

  • Request URL: /account/positions

  • Request method: GET

  • Frequency limit: The calling frequency of each AppId is limited to 2 times in 2 seconds.

Request parameters

ParameterTypeRequired fieldsDescriptionExample value
account_idStringYesAccount ID863417315629211648
page_sizeintNoNumber of entries per page: default value is 10, and the maximum value is 100 with integers being filled.10
last_idStringNoThe last id of the previous page, if not passed, the first page is checked by default123456

Response parameter

ParameterTypeRequired fieldsDescriptionExample value
has_nextBooleanYesIs there a next pagetrue
holdings[ ]HoldingNoPosition List

Holding:

ParameterTypeDescriptionExample value
idStringUnique identifier for the account position123456
instrument_idStringUnique identifier for the security913256135
symbolStringTicker symbolAAPL
instrument_typeStringrefer to the dictionary value CategoryUS_STOCK
short_nameStringStock abbreviation, in EnglishAAPL
currencyStringCurrencyUSD
unit_costStringCost price101.0775
qtyintNumber of shares20
total_costStringTotal cost2021.55
last_priceStringMarket Price176.84
market_valueStringMarket capitalization2006.00
unrealized_profit_lossStringFloating profit and loss1530.80
unrealized_profit_loss_rateStringfloating profit and loss ratio16.2133
holding_proportionStringPosition ratio1.0000
account_tax_typeStringAccount tax type refers to the dictionary value AccountTaxType. For cash account only.SPECIFIC
positions[]ContractPositionDetails of Positions in contract dimention. For margin account only.

positions

ParameterTypeDescriptionExample value
contract_idStringContract idIQG6KIFUR4043631CNHVEFAH09
account_tax_typeStringAccount tax type refers to the dictionary value AccountTaxTypeSPECIFIC
qtyStringNumber of shares6
total_costStringTotal cost598.60
unrealized_profit_lossStringFloating profit and loss467.04
market_valueStringMarket capitalization594.00
margin_typeStringMargin typeONE_DAY

Request example

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.JP.value)
api = API(api_client)
response = api.account.get_account_position(account_id)
if response.status_code == 200:
account_position = response.json()

Response example

Cash Account

{
"has_next":
false
"holdings":[
0:{
"id":
"123456"
"instrument_id":
"901521219027"
"symbol":
"AAPL"
"instrument_type":
"US_STOCK"
"short_name":
"AAPL"
"qty":
"20"
"unit_cost":
"101.0775"
"currency":
"USD"
"total_cost":
"2021.55"
"last_price":
"176.84"
"market_value":
"2006.00"
"unrealized_profit_loss":
"1530.80"
"unrealized_profit_loss_rate":
"16.2133"
"holding_proportion":
"1.0000"
"account_tax_type":
"GENERAL"
}
]
}

Margin Account

{
"has_next":
false
"holdings":[
0:{
"id":
"123456"
"instrument_id":
"901521219027"
"symbol":
"AAPL"
"instrument_type":
"US_STOCK"
"short_name":
"AAPL"
"qty":
"20"
"unit_cost":
"101.0775"
"currency":
"USD"
"total_cost":
"2021.55"
"last_price":
"176.84"
"market_value":
"2006.00"
"unrealized_profit_loss":
"1530.80"
"unrealized_profit_loss_rate":
"16.2133"
"holding_proportion":
"1.0000"
"positions":[
0:{
"contract_id":
"IQG6KIFUR4043631CNHVEFAH09"
"account_tax_type":
"GENERAL"
"qty":
"6"
"total_cost":
"598.60"
"unrealized_profit_loss":
"467.04"
"market_value":
"594.00"
}
1:{
"contract_id":
"JHJOQ16A84FEA2HEUA0CL3C48B"
"account_tax_type":
"GENERAL"
"qty":
"3"
"total_cost":
"299.31"
"unrealized_profit_loss":
"233.52"
"market_value":
"297.00"
"margin_type":
"ONE_DAY"
}
]
}
]
}

Exception example

{
"error_code":
"INVALID_TOKEN"
"message":
"401 UNAUTHORIZED "app_id and account_id not related""
}