跳至主要内容

賬戶持倉

接口說明

  • 功能說明:根據賬戶id分頁查詢賬戶持倉列表。

  • 適用對象:通過OpenApi開發平台對接webull的客戶。

  • 請求URL:/account/positions

  • 請求方式:GET

  • 頻次限制:每個AppId調用頻次限制為2秒2次

請求參數

參數類型是否必填描述示例值
account_idString賬戶id20150320010101001
page_sizeint每頁條數。 默認值:10;最大值:100,可填整數。10
last_instrument_idString上一頁最後一個的標的id,不傳默認查第一頁202202180001

響應參數

參數類型是否必填描述示例值
has_nextBooleantrue是否還有下一頁true
holdings[ ]Holding持倉列表

Holding:

參數類型描述示例值
instrument_idString標的id913252773
symbolString標的代碼00001
instrument_typeString標的類型:STOCK股票STOCK
short_nameString股票簡稱,取英文CKH HOLDINGS
currencyString持倉幣種HKD
unit_costString持倉成本價9.5460000000
qtyFloat標的數量,股數11000.0
total_costString持倉總成本105006.00000000000000000000
last_priceString市價52.250
market_valueString市值574750.0000000000000
unrealized_profit_lossString浮動盈虧469744.00000000000000000000
unrealized_profit_loss_rateString浮動盈虧率4.4735
holding_proportionString持倉佔比0.9854

請求示例

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

響應示例

{
"has_next": false,
"holdings": [
{
"instrument_id": "913252773",
"symbol": "00001",
"instrument_type": "STOCK",
"short_name": "CKH HOLDINGS",
"qty": 11000.0,
"unit_cost": "9.5460000000",
"currency": "HKD",
"total_cost": "105006.00000000000000000000",
"last_price": "52.250",
"market_value": "574750.0000000000000",
"unrealized_profit_loss": "469744.00000000000000000000",
"unrealized_profit_loss_rate": "4.4735",
"holding_proportion": "0.9854"
},
{
"instrument_id": "950146898",
"symbol": "09988",
"instrument_type": "STOCK",
"short_name": "BABA-SW",
"qty": 100.0,
"unit_cost": "100.0000000000",
"currency": "HKD",
"total_cost": "10000.00000000000000000000",
"last_price": "85.250",
"market_value": "8525.0000000000000",
"unrealized_profit_loss": "-1475.00000000000000000000",
"unrealized_profit_loss_rate": "-0.1475",
"holding_proportion": "0.0146"
}
]
}

異常示例

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