OpenAPI新增股票卖空及期权功能,具体内容请参看更新日志。
OpenAPI新增股票卖空及期权功能,具体内容请参看更新日志。
OpenAPI新增股票卖空及期权功能,具体内容请参看更新日志。
OpenAPI新增股票卖空及期权功能,具体内容请参看更新日志。
OpenAPI新增股票卖空及期权功能,具体内容请参看更新日志。
OpenAPI新增股票卖空及期权功能,具体内容请参看更新日志。
跳到主要内容

账户持仓

接口说明

  • 功能说明:根据账户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
qtyString标的数量,股数11000
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":[
0:{
"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"
}
1:{
"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""
}