跳到主要內容

獲取基金持倉

該接口用於獲取包括賬戶、基金代碼、持有份額、成本淨值、當前淨值、幣種在內的基金持倉信息

Request

HTTP MethodGET
HTTP URL/v1/asset/fund

Parameters

Content-Type: application/json; charset=utf-8

NameTypeRequiredDescription
symbolstring[]NO基金代碼,使用 ISIN 格式,例如:HK0000676327 ISIN 解釋

Request Example

# 獲取基金持倉
# https://open.longportapp.com/docs/trade/asset/fund
from longport.openapi import TradeContext, Config

config = Config.from_env()
ctx = TradeContext(config)
resp = ctx.fund_positions()

Response

Response Headers

  • Content-Type: application/json

Response Example

{
"code": 0,
"data": {
"list": [
{
"account_channel": "lb",
"fund_info": [
{
"symbol": "HK0000447943",
"symbol_name": "高騰亞洲收益基金",
"currency": "USD",
"holding_units": "5.000",
"current_net_asset_value": "0",
"cost_net_asset_value": "0.00",
"net_asset_value_day": "1649865600"
}
]
}
]
}
}

Response Status

StatusDescriptionSchema
200返回成功fund_rsp
400內部錯誤None

Schemas

fund_rsp

NameTypeRequiredDescription
listobject[]false股票持倉信息
∟ account_channelstringtrue賬戶類型
∟ fund_infoobject[]false基金詳情
∟∟ symbolstringtrue基金 ISIN 代碼
∟∟ current_net_asset_valuestringtrue當前淨值
∟∟ net_asset_value_daystringtrue當前淨值時間
∟∟ symbol_namestringtrue基金名稱
∟∟ currencystringtrue幣種
∟∟ cost_net_asset_valuestringtrue成本淨值