Skip to main content

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

ParameterTypeRequired fieldsDescriptionExample value
account_idStringYesAccount IDco393b0ab01

Response Parameter

ParameterTypeRequired fieldsDescriptionExample value
account_idStringWebull Pay Account IDco393b0ab01
total_market_valuenumberTotal martket value
invest_amtnumberInvestment amount
unrealized_profit_lossnumberUnrealized Profit Loss
unrealized_profit_loss_ratenumberUnrealized Profit Loss Rate
positionsPositionNoPosition List

Position:

ParameterTypeDescriptionExample value
idStringAccount position ID1
instrument_idStringSymbol ID950160802
symbolStringTicker symbolBTCUSD
nameStringSymbol nameBitcoin
instrument_typeStringCRYPTOCRYPTO
currencyStringCurrencyUSD
unit_costStringCost price9.5460000000
quantityintNumber of shares11000.0
total_costStringTotal cost105006.00000000000000000000
last_priceStringMarket Price52.250
market_valueStringMarket capitalization574750.0000000000000
unrealized_profit_lossStringFloating profit and loss469744.00000000000000000000
unrealized_profit_loss_rateStringFloating profit and loss ratio4.4700
unrealized_profit_loss_baseStringFloating profit and loss base0.9800
update_timeStringUpdate Time (Eastern time)2025-01-23 07:49:45 EST

Request Example

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)

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\""
}