# 获取持股明细
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_shareholders_holder_detail(code, request_type=None, next_key=None, num=None, sort_column=None, sort_type=None, period_id=None, holder_id=None)
介绍
获取股票某一持股类型下的持有人明细列表,支持分页拉取
参数
参数 类型 说明 code str 股票代码 如 US.AAPL;支持港股、美股正股及基金request_type HolderDetailType 持股类型 0=Default,1000=All,1=其他机构,2=传统投资经理,3=对冲基金,4=风险资本/私募,5=企业年金,6=基金会基金,7=保险公司,8=银行/投资银行,9=家族办公室/信托,10=主权财富基金,11=REIT,12=结构化融资经理,13=联合养老金,14=政府养老金,15=捐赠基金,100=个人,200=ADS,300=上市公司,400=未公开上市公司,500=国有股;默认按服务端默认逻辑返回next_key str 分页标识 首次不传,续拉时填上次返回的 next_key;"-1" 表示无更多数据num int 每页数量 默认 10,范围 1~50sort_column SortField 排序字段 61=持股股数(默认),62=持股变动数sort_type SortType 排序方向 1=降序(默认),2=升序period_id int 报告期 ID 与 Qot_GetShareholdersOverview(3237)返回的 holdingPeriodList 中 periodId 一致;默认 0 表示最新周期holder_id int 持有人 ID 过滤 默认 0 表示不过滤;可取自 GetShareholdersOverview(3237)、GetShareholdersHoldingChanges(3238)、本协议(3239)、GetInsiderHolderList(3241)、GetInsiderTradeList(3242)返回的 holder_id返回
参数 类型 说明 ret RET_CODE 接口调用结果 data pd.DataFrame 当 ret == RET_OK,返回持股明细 DataFrame str 当 ret != RET_OK,返回错误描述 返回 DataFrame 字段说明:
字段 类型 说明 update_time_str str 数据更新时间 格式 YYYY-MM-DD HH:MM:SS,对应市场时区next_key str 分页标识 "-1" 表示无更多数据;续拉时原样传入 next_key 参数period_text str 报告期 如 "2026/Q1"holder_id int 持股人 ID 可用于其他持股相关协议的 holder_id 过滤name str 股东名称 holder_quantity int 总持股数 单位:股holder_quantity_change int 持股变动数 单位:股;正为增持,负为减持holder_pct float 持股比例 百分号前的值,如 12.34 表示 12.34%holder_pct_change float 持股变动比例 百分号前的值,如 12.34 表示变动 12.34%;负值为减少holding_date_str str 持股日期 格式 YYYY-MM-DD,香港时区close_price float 持股日期收盘价 对应持股日期的收盘价(真实价格)price_change_pct float 价格涨跌幅 百分号前的值,如 -0.4467 表示 -0.4467%source_group_name str 数据来源 持股明细披露信息来源,如 "13F"、"13F数据汇总" 等
Example
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_shareholders_holder_detail("HK.00700", request_type=1000)
if ret == RET_OK:
print(data[['period_text', 'name', 'holder_quantity', 'holder_pct', 'holder_pct_change']].to_string(index=False))
print('next_key:', data.attrs.get('next_key', '-1'))
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
- Output
period_text name holder_quantity holder_pct holder_pct_change
2026/Q1 Prosus Ventures N.V. 2079512000 23.053 -0.285
2026/Q1 Huateng Ma 709859700 7.869 0.000
2026/Q1 先锋领航 268596433 2.977 0.031
2026/Q1 贝莱德 240834898 2.669 0.088
2026/Q1 挪威银行投资管理 122744699 1.360 -0.083
2026/Q1 富达管理与研究 86765121 0.961 -0.232
2026/Q1 资本集团 85568118 0.948 0.024
2026/Q1 摩根大通 62437911 0.692 -0.025
2026/Q1 E Fund Management Co., Ltd. 52722677 0.584 0.000
2026/Q1 柏基投资 35674108 0.395 0.020
next_key: 10
2
3
4
5
6
7
8
9
10
11
12
# Qot_GetShareholdersHolderDetail.proto
介绍
获取持股明细
参数
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // 请求数据类型,详见 Qot_Common.HolderDetailType 定义,默认按服务端默认逻辑返回
optional string nextKey = 3; // 分页标识,首次不填,续拉时填上次返回的 nextKey;"-1" 表示无更多数据
optional int32 num = 4; // 每页返回数量,默认 10,范围 1~50
optional Qot_Common.SortField sortColumn = 5; // 排序列,详见 Qot_Common.SortField,61=持股股数(默认)62=持股变动数
optional Qot_Common.SortType sortType = 6; // 排序方向,详见 Qot_Common.SortType 定义,默认降序
optional int32 periodId = 7; // 指定统计周期 ID;与 Qot_GetShareholdersOverview(3237)返回的 holdingPeriodList 中 periodId 一致;默认 0 表示最新周期
optional int32 holderId = 8; // 按持股人 ID 过滤;默认 0 表示不过滤;可取自 GetShareholdersOverview(3237)、GetShareholdersHoldingChanges(3238)、本协议(3239)、GetInsiderHolderList(3241)、GetInsiderTradeList(3242)返回的 holderId
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- 股票结构参见 Security
- 持股类型参见 HolderDetailType
- 排序字段参见 SortField
- 排序方向参见 SortType
- 返回
message OwnershipDetailItem
{
optional string periodText = 1; // 报告期,如 "2025/Q3"
optional uint64 holderId = 2; // 持股人 ID
optional string name = 3; // 股东名称
optional int64 holderQuantity = 4; // 总持股数(股)
optional int64 holderQuantityChange = 5; // 持股变动数(股,正为增持,负为减持)
optional double holderPct = 6; // 持股比例(%),如 12.34 表示 12.34%
optional double holderPctChange = 7; // 持股变动比例(%),如 12.34 表示 12.34%;负值为减少
optional uint64 holdingDate = 8; // 持股日期时间戳(秒)
optional string holdingDateStr = 9; // 持股日期字符串,格式 YYYY-MM-DD,香港时区
optional double closePrice = 10; // 持股日期对应收盘价(真实价格)
optional double priceChangePct = 11; // 持股日期对应涨跌幅(%),如 -0.4467 表示 -0.4467%
optional string sourceGroupName = 12; // 持股明细披露信息来源(如 13F、多份文件等)
}
message S2C
{
optional uint64 updateTime = 1; // 数据更新时间戳(秒)
optional string updateTimeStr = 2; // 数据更新时间字符串,格式 YYYY-MM-DD HH:MM:SS,对应市场时区
optional string nextKey = 3; // 分页标识,"-1" 表示无更多数据
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // 返回结果,详见 Common.RetType
optional string retMsg = 2; // 返回结果描述
optional int32 errCode = 3; // 错误码
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- 接口调用结果,结构参见 RetType
- 股东持仓明细机构类型参见 HolderDetailType
协议 ID
3239
uint GetShareholdersHolderDetail(QotGetShareholdersHolderDetail.Request req);
virtual void OnReply_GetShareholdersHolderDetail(FTAPI_Conn client, uint nSerialNo, QotGetShareholdersHolderDetail.Response rsp);
介绍
获取持股明细
参数
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // 请求数据类型,详见 Qot_Common.HolderDetailType 定义,默认按服务端默认逻辑返回
optional string nextKey = 3; // 分页标识,首次不填,续拉时填上次返回的 nextKey;"-1" 表示无更多数据
optional int32 num = 4; // 每页返回数量,默认 10,范围 1~50
optional Qot_Common.SortField sortColumn = 5; // 排序列,详见 Qot_Common.SortField,61=持股股数(默认)62=持股变动数
optional Qot_Common.SortType sortType = 6; // 排序方向,详见 Qot_Common.SortType 定义,默认降序
optional int32 periodId = 7; // 指定统计周期 ID;与 Qot_GetShareholdersOverview(3237)返回的 holdingPeriodList 中 periodId 一致;默认 0 表示最新周期
optional int32 holderId = 8; // 按持股人 ID 过滤;默认 0 表示不过滤;可取自 GetShareholdersOverview(3237)、GetShareholdersHoldingChanges(3238)、本协议(3239)、GetInsiderHolderList(3241)、GetInsiderTradeList(3242)返回的 holderId
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- 股票结构参见 Security
- 持股类型参见 HolderDetailType
- 排序字段参见 SortField
- 排序方向参见 SortType
- 返回
message OwnershipDetailItem
{
optional string periodText = 1; // 报告期,如 "2025/Q3"
optional uint64 holderId = 2; // 持股人 ID
optional string name = 3; // 股东名称
optional int64 holderQuantity = 4; // 总持股数(股)
optional int64 holderQuantityChange = 5; // 持股变动数(股,正为增持,负为减持)
optional double holderPct = 6; // 持股比例(%),如 12.34 表示 12.34%
optional double holderPctChange = 7; // 持股变动比例(%),如 12.34 表示 12.34%;负值为减少
optional uint64 holdingDate = 8; // 持股日期时间戳(秒)
optional string holdingDateStr = 9; // 持股日期字符串,格式 YYYY-MM-DD,香港时区
optional double closePrice = 10; // 持股日期对应收盘价(真实价格)
optional double priceChangePct = 11; // 持股日期对应涨跌幅(%),如 -0.4467 表示 -0.4467%
optional string sourceGroupName = 12; // 持股明细披露信息来源(如 13F、多份文件等)
}
message S2C
{
optional uint64 updateTime = 1; // 数据更新时间戳(秒)
optional string updateTimeStr = 2; // 数据更新时间字符串,格式 YYYY-MM-DD HH:MM:SS,对应市场时区
optional string nextKey = 3; // 分页标识,"-1" 表示无更多数据
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // 返回结果,详见 Common.RetType
optional string retMsg = 2; // 返回结果描述
optional int32 errCode = 3; // 错误码
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- 接口调用结果,结构参见 RetType
- 股东持仓明细机构类型参见 HolderDetailType
- Example
public class Program : FTSPI_Qot, FTSPI_Conn
{
FTAPI_Qot qot = new FTAPI_Qot();
public Program()
{
qot.SetClientInfo("csharp", 1);
qot.SetConnCallback(this);
qot.SetQotCallback(this);
}
public void Start()
{
qot.InitConnect("127.0.0.1", (ushort)11111, false);
}
public void OnInitConnect(FTAPI_Conn client, long errCode, String desc)
{
Console.Write("Qot onInitConnect: ret={0} desc={1} connID={2}\n", errCode, desc, client.GetConnectID());
if (errCode != 0)
return;
QotCommon.Security sec = QotCommon.Security.CreateBuilder()
.SetMarket((int)QotCommon.QotMarket.QotMarket_HK_Security)
.SetCode("00700")
.Build();
QotGetShareholdersHolderDetail.C2S c2s = QotGetShareholdersHolderDetail.C2S.CreateBuilder()
.SetSecurity(sec)
.Build();
QotGetShareholdersHolderDetail.Request req = QotGetShareholdersHolderDetail.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetShareholdersHolderDetail(req);
Console.Write("Send QotGetShareholdersHolderDetail: {0}\n", seqNo);
}
public void OnDisconnect(FTAPI_Conn client, long errCode)
{
Console.Write("Qot onDisConnect: {0}\n", errCode);
}
public void OnReply_GetShareholdersHolderDetail(FTAPI_Conn client, uint nSerialNo, QotGetShareholdersHolderDetail.Response rsp)
{
Console.Write("Reply: QotGetShareholdersHolderDetail: {0} {1}\n", nSerialNo, rsp.ToString());
}
public static void Main(String[] args)
{
FTAPI.Init();
Program qot = new Program();
qot.Start();
while (true)
Thread.Sleep(1000 * 600);
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
- Output
sent seqNo=3
retType: 0
retMsg: ""
errCode: 0
s2c {
updateTime: 1778344379
updateTimeStr: "2026-05-10 00:32:59"
nextKey: "10"
itemList {
periodText: "2026/Q1"
holderId: 337488017
name: "Prosus Ventures N.V."
holderQuantity: 2079512000
holderQuantityChange: -25741100
holderPct: 23.053
holderPctChange: -0.285
holdingDate: 1767110400
holdingDateStr: "2025-12-31"
closePrice: 599
priceChangePct: -0.1666
sourceGroupName: "年报"
}
itemList {
//...
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
int getShareholdersHolderDetail(QotGetShareholdersHolderDetail.Request req);
void onReply_GetShareholdersHolderDetail(FTAPI_Conn client, int nSerialNo, QotGetShareholdersHolderDetail.Response rsp);
介绍
获取持股明细
参数
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // 请求数据类型,详见 Qot_Common.HolderDetailType 定义,默认按服务端默认逻辑返回
optional string nextKey = 3; // 分页标识,首次不填,续拉时填上次返回的 nextKey;"-1" 表示无更多数据
optional int32 num = 4; // 每页返回数量,默认 10,范围 1~50
optional Qot_Common.SortField sortColumn = 5; // 排序列,详见 Qot_Common.SortField,61=持股股数(默认)62=持股变动数
optional Qot_Common.SortType sortType = 6; // 排序方向,详见 Qot_Common.SortType 定义,默认降序
optional int32 periodId = 7; // 指定统计周期 ID;与 Qot_GetShareholdersOverview(3237)返回的 holdingPeriodList 中 periodId 一致;默认 0 表示最新周期
optional int32 holderId = 8; // 按持股人 ID 过滤;默认 0 表示不过滤;可取自 GetShareholdersOverview(3237)、GetShareholdersHoldingChanges(3238)、本协议(3239)、GetInsiderHolderList(3241)、GetInsiderTradeList(3242)返回的 holderId
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- 股票结构参见 Security
- 持股类型参见 HolderDetailType
- 排序字段参见 SortField
- 排序方向参见 SortType
- 返回
message OwnershipDetailItem
{
optional string periodText = 1; // 报告期,如 "2025/Q3"
optional uint64 holderId = 2; // 持股人 ID
optional string name = 3; // 股东名称
optional int64 holderQuantity = 4; // 总持股数(股)
optional int64 holderQuantityChange = 5; // 持股变动数(股,正为增持,负为减持)
optional double holderPct = 6; // 持股比例(%),如 12.34 表示 12.34%
optional double holderPctChange = 7; // 持股变动比例(%),如 12.34 表示 12.34%;负值为减少
optional uint64 holdingDate = 8; // 持股日期时间戳(秒)
optional string holdingDateStr = 9; // 持股日期字符串,格式 YYYY-MM-DD,香港时区
optional double closePrice = 10; // 持股日期对应收盘价(真实价格)
optional double priceChangePct = 11; // 持股日期对应涨跌幅(%),如 -0.4467 表示 -0.4467%
optional string sourceGroupName = 12; // 持股明细披露信息来源(如 13F、多份文件等)
}
message S2C
{
optional uint64 updateTime = 1; // 数据更新时间戳(秒)
optional string updateTimeStr = 2; // 数据更新时间字符串,格式 YYYY-MM-DD HH:MM:SS,对应市场时区
optional string nextKey = 3; // 分页标识,"-1" 表示无更多数据
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // 返回结果,详见 Common.RetType
optional string retMsg = 2; // 返回结果描述
optional int32 errCode = 3; // 错误码
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- 接口调用结果,结构参见 RetType
- 股东持仓明细机构类型参见 HolderDetailType
- Example
public class QotDemo implements FTSPI_Qot, FTSPI_Conn {
FTAPI_Conn_Qot qot = new FTAPI_Conn_Qot();
public QotDemo() {
qot.setClientInfo("javaclient", 1);
qot.setConnSpi(this);
qot.setQotSpi(this);
}
public void start() {
qot.initConnect("127.0.0.1", (short)11111, false);
}
@Override
public void onInitConnect(FTAPI_Conn client, long errCode, String desc)
{
System.out.printf("Qot onInitConnect: ret=%b desc=%s connID=%d\n", errCode, desc, client.getConnectID());
if (errCode != 0)
return;
QotCommon.Security sec = QotCommon.Security.newBuilder()
.setMarket(QotCommon.QotMarket.QotMarket_HK_Security_VALUE)
.setCode("00700")
.build();
QotGetShareholdersHolderDetail.C2S c2s = QotGetShareholdersHolderDetail.C2S.newBuilder()
.setSecurity(sec)
.build();
QotGetShareholdersHolderDetail.Request req = QotGetShareholdersHolderDetail.Request.newBuilder().setC2S(c2s).build();
int seqNo = qot.getShareholdersHolderDetail(req);
System.out.printf("Send QotGetShareholdersHolderDetail: %d\n", seqNo);
}
@Override
public void onDisconnect(FTAPI_Conn client, long errCode) {
System.out.printf("Qot onDisConnect: %d\n", errCode);
}
@Override
public void onReply_GetShareholdersHolderDetail(FTAPI_Conn client, int nSerialNo, QotGetShareholdersHolderDetail.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("QotGetShareholdersHolderDetail failed: %s\n", rsp.getRetMsg());
}
else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive QotGetShareholdersHolderDetail: %s\n", json);
} catch (InvalidProtocolBufferException e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) {
FTAPI.init();
QotDemo qot = new QotDemo();
qot.start();
while (true) {
try {
Thread.sleep(1000 * 600);
} catch (InterruptedException exc) {
}
}
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
- Output
Qot onInitConnect: ret=0 desc= connID=7459213593710642273
Send Qot_GetShareholdersHolderDetail: 2
Receive Qot_GetShareholdersHolderDetail: retType: 0
retMsg: ""
errCode: 0
s2c {
updateTime: 1778344379
updateTimeStr: "2026-05-10 00:32:59"
nextKey: "10"
itemList {
periodText: "2026/Q1"
holderId: 337488017
name: "Prosus Ventures N.V."
holderQuantity: 2079512000
holderQuantityChange: -25741100
holderPct: 23.053
holderPctChange: -0.285
holdingDate: 1767110400
holdingDateStr: "2025-12-31"
closePrice: 599.0
priceChangePct: -0.1666
sourceGroupName: "年报"
}
itemList {
//...
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Futu::u32_t GetShareholdersHolderDetail(const Qot_GetShareholdersHolderDetail::Request &stReq);
virtual void OnReply_GetShareholdersHolderDetail(Futu::u32_t nSerialNo, const Qot_GetShareholdersHolderDetail::Response &stRsp) = 0;
介绍
获取持股明细
参数
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // 请求数据类型,详见 Qot_Common.HolderDetailType 定义,默认按服务端默认逻辑返回
optional string nextKey = 3; // 分页标识,首次不填,续拉时填上次返回的 nextKey;"-1" 表示无更多数据
optional int32 num = 4; // 每页返回数量,默认 10,范围 1~50
optional Qot_Common.SortField sortColumn = 5; // 排序列,详见 Qot_Common.SortField,61=持股股数(默认)62=持股变动数
optional Qot_Common.SortType sortType = 6; // 排序方向,详见 Qot_Common.SortType 定义,默认降序
optional int32 periodId = 7; // 指定统计周期 ID;与 Qot_GetShareholdersOverview(3237)返回的 holdingPeriodList 中 periodId 一致;默认 0 表示最新周期
optional int32 holderId = 8; // 按持股人 ID 过滤;默认 0 表示不过滤;可取自 GetShareholdersOverview(3237)、GetShareholdersHoldingChanges(3238)、本协议(3239)、GetInsiderHolderList(3241)、GetInsiderTradeList(3242)返回的 holderId
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- 股票结构参见 Security
- 持股类型参见 HolderDetailType
- 排序字段参见 SortField
- 排序方向参见 SortType
- 返回
message OwnershipDetailItem
{
optional string periodText = 1; // 报告期,如 "2025/Q3"
optional uint64 holderId = 2; // 持股人 ID
optional string name = 3; // 股东名称
optional int64 holderQuantity = 4; // 总持股数(股)
optional int64 holderQuantityChange = 5; // 持股变动数(股,正为增持,负为减持)
optional double holderPct = 6; // 持股比例(%),如 12.34 表示 12.34%
optional double holderPctChange = 7; // 持股变动比例(%),如 12.34 表示 12.34%;负值为减少
optional uint64 holdingDate = 8; // 持股日期时间戳(秒)
optional string holdingDateStr = 9; // 持股日期字符串,格式 YYYY-MM-DD,香港时区
optional double closePrice = 10; // 持股日期对应收盘价(真实价格)
optional double priceChangePct = 11; // 持股日期对应涨跌幅(%),如 -0.4467 表示 -0.4467%
optional string sourceGroupName = 12; // 持股明细披露信息来源(如 13F、多份文件等)
}
message S2C
{
optional uint64 updateTime = 1; // 数据更新时间戳(秒)
optional string updateTimeStr = 2; // 数据更新时间字符串,格式 YYYY-MM-DD HH:MM:SS,对应市场时区
optional string nextKey = 3; // 分页标识,"-1" 表示无更多数据
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // 返回结果,详见 Common.RetType
optional string retMsg = 2; // 返回结果描述
optional int32 errCode = 3; // 错误码
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- 接口调用结果,结构参见 RetType
- 股东持仓明细机构类型参见 HolderDetailType
- Example
class Program : public FTSPI_Qot, public FTSPI_Trd, public FTSPI_Conn
{
public:
Program() {
m_pQotApi = FTAPI::CreateQotApi();
m_pQotApi->RegisterQotSpi(this);
m_pQotApi->RegisterConnSpi(this);
}
~Program() {
if (m_pQotApi != nullptr)
{
m_pQotApi->UnregisterQotSpi();
m_pQotApi->UnregisterConnSpi();
FTAPI::ReleaseQotApi(m_pQotApi);
m_pQotApi = nullptr;
}
}
void Start() {
m_pQotApi->InitConnect("127.0.0.1", 11111, false);
}
virtual void OnInitConnect(FTAPI_Conn* pConn, Futu::i64_t nErrCode, const char* strDesc) {
cout << "connect" << endl;
// construct request message
Qot_GetShareholdersHolderDetail::Request req;
Qot_GetShareholdersHolderDetail::C2S *c2s = req.mutable_c2s();
Qot_Common::Security *sec = c2s->mutable_security();
sec->set_code("00700");
sec->set_market(Qot_Common::QotMarket::QotMarket_HK_Security);
m_pQotApi->GetShareholdersHolderDetail(req);
cout << "GetShareholdersHolderDetail" << endl;
}
virtual void OnReply_GetShareholdersHolderDetail(Futu::u32_t nSerialNo, const Qot_GetShareholdersHolderDetail::Response &stRsp){
cout << "OnReply_GetShareholdersHolderDetail:" << endl;
// print response
// ProtoBufToBodyData and UTF8ToLocal refer to tool.h in Samples
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
FTAPI_Qot *m_pQotApi;
};
int32_t main(int32_t argc, char** argv)
{
FTAPI::Init();
{
Program program;
program.Start();
getchar();
}
protobuf::ShutdownProtobufLibrary();
FTAPI::UnInit();
return 0;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
- Output
onInitConnect: ret=0 desc=Succeed!
Send Qot_GetShareholdersHolderDetail seqNo=3
retType: 0
retMsg: ""
errCode: 0
s2c {
updateTime: 1778344379
updateTimeStr: "2026-05-10 00:32:59"
nextKey: "10"
itemList {
periodText: "2026/Q1"
holderId: 337488017
name: "Prosus Ventures N.V."
holderQuantity: 2079512000
holderQuantityChange: -25741100
holderPct: 23.053
holderPctChange: -0.285
holdingDate: 1767110400
holdingDateStr: "2025-12-31"
closePrice: 599
priceChangePct: -0.1666
sourceGroupName: "年报"
}
itemList {
//...
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
GetShareholdersHolderDetail(req);
介绍
获取持股明细
参数
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // 请求数据类型,详见 Qot_Common.HolderDetailType 定义,默认按服务端默认逻辑返回
optional string nextKey = 3; // 分页标识,首次不填,续拉时填上次返回的 nextKey;"-1" 表示无更多数据
optional int32 num = 4; // 每页返回数量,默认 10,范围 1~50
optional Qot_Common.SortField sortColumn = 5; // 排序列,详见 Qot_Common.SortField,61=持股股数(默认)62=持股变动数
optional Qot_Common.SortType sortType = 6; // 排序方向,详见 Qot_Common.SortType 定义,默认降序
optional int32 periodId = 7; // 指定统计周期 ID;与 Qot_GetShareholdersOverview(3237)返回的 holdingPeriodList 中 periodId 一致;默认 0 表示最新周期
optional int32 holderId = 8; // 按持股人 ID 过滤;默认 0 表示不过滤;可取自 GetShareholdersOverview(3237)、GetShareholdersHoldingChanges(3238)、本协议(3239)、GetInsiderHolderList(3241)、GetInsiderTradeList(3242)返回的 holderId
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- 股票结构参见 Security
- 持股类型参见 HolderDetailType
- 排序字段参见 SortField
- 排序方向参见 SortType
- 返回
message OwnershipDetailItem
{
optional string periodText = 1; // 报告期,如 "2025/Q3"
optional uint64 holderId = 2; // 持股人 ID
optional string name = 3; // 股东名称
optional int64 holderQuantity = 4; // 总持股数(股)
optional int64 holderQuantityChange = 5; // 持股变动数(股,正为增持,负为减持)
optional double holderPct = 6; // 持股比例(%),如 12.34 表示 12.34%
optional double holderPctChange = 7; // 持股变动比例(%),如 12.34 表示 12.34%;负值为减少
optional uint64 holdingDate = 8; // 持股日期时间戳(秒)
optional string holdingDateStr = 9; // 持股日期字符串,格式 YYYY-MM-DD,香港时区
optional double closePrice = 10; // 持股日期对应收盘价(真实价格)
optional double priceChangePct = 11; // 持股日期对应涨跌幅(%),如 -0.4467 表示 -0.4467%
optional string sourceGroupName = 12; // 持股明细披露信息来源(如 13F、多份文件等)
}
message S2C
{
optional uint64 updateTime = 1; // 数据更新时间戳(秒)
optional string updateTimeStr = 2; // 数据更新时间字符串,格式 YYYY-MM-DD HH:MM:SS,对应市场时区
optional string nextKey = 3; // 分页标识,"-1" 表示无更多数据
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // 返回结果,详见 Common.RetType
optional string retMsg = 2; // 返回结果描述
optional int32 errCode = 3; // 错误码
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- 接口调用结果,结构参见 RetType
- 股东持仓明细机构类型参见 HolderDetailType
- Example
import ftWebsocket from "futu-api";
import { Common, Qot_Common } from "futu-api/proto";
import beautify from "js-beautify";
function QotGetShareholdersHolderDetail(){
const { RetType } = Common
const { QotMarket } = Qot_Common
let [addr, port, enable_ssl, key] = ["127.0.0.1", 33333, false, '7522027ccf5a06b1'];
let websocket = new ftWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) {
const req = {
c2s: {
security: {
market: QotMarket.QotMarket_HK_Security,
code: "00700",
},
},
};
websocket.GetShareholdersHolderDetail(req)
.then((res) => {
let { errCode, retMsg, retType,s2c } = res
console.log("GetShareholdersHolderDetail: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);
if(retType == RetType.RetType_Succeed){
let data = beautify(JSON.stringify(s2c), {
indent_size: 2,
space_in_empty_paren: true,
});
console.log(data);
}
})
.catch((error) => {
console.log("error:", error);
});
} else {
console.log("error", msg);
}
};
websocket.start(addr, port, enable_ssl, key);
setTimeout(()=>{
websocket.stop();
console.log("stop");
}, 5000);
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
- Output
GetShareholdersHolderDetail: errCode 0, retMsg , retType 0
{
"updateTime": "1778344379",
"updateTimeStr": "2026-05-10 00:32:59",
"nextKey": "10",
"itemList": [{
"periodText": "2026/Q1",
"holderId": "337488017",
"name": "Prosus Ventures N.V.",
"holderQuantity": "2079512000",
"holderQuantityChange": "-25741100",
"holderPct": 23.053,
"holderPctChange": -0.285,
"holdingDate": "1767110400",
"holdingDateStr": "2025-12-31",
"closePrice": 599,
"priceChangePct": -0.1666,
"sourceGroupName": "年报"
//...
}]
}
stop
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
接口限制
- 每 30 秒内最多请求 30 次。
- 支持港股、美股正股及基金。
- 支持分页,默认每页 10 条;分页标识为字符串类型。
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_shareholders_holder_detail(code, request_type=None, next_key=None, num=None, sort_column=None, sort_type=None, period_id=None, holder_id=None)
介绍
获取股票某一持股类型下的持有人明细列表,支持分页拉取
参数
参数 类型 说明 code str 股票代码 如 US.AAPL;支持港股、美股正股及基金request_type HolderDetailType 持股类型 0=Default,1000=All,1=其他机构,2=传统投资经理,3=对冲基金,4=风险资本/私募,5=企业年金,6=基金会基金,7=保险公司,8=银行/投资银行,9=家族办公室/信托,10=主权财富基金,11=REIT,12=结构化融资经理,13=联合养老金,14=政府养老金,15=捐赠基金,100=个人,200=ADS,300=上市公司,400=未公开上市公司,500=国有股;默认按服务端默认逻辑返回next_key str 分页标识 首次不传,续拉时填上次返回的 next_key;"-1" 表示无更多数据num int 每页数量 默认 10,范围 1~50sort_column SortField 排序字段 61=持股股数(默认),62=持股变动数sort_type SortType 排序方向 1=降序(默认),2=升序period_id int 报告期 ID 与 Qot_GetShareholdersOverview(3237)返回的 holdingPeriodList 中 periodId 一致;默认 0 表示最新周期holder_id int 持有人 ID 过滤 默认 0 表示不过滤;可取自 GetShareholdersOverview(3237)、GetShareholdersHoldingChanges(3238)、本协议(3239)、GetInsiderHolderList(3241)、GetInsiderTradeList(3242)返回的 holder_id返回
参数 类型 说明 ret RET_CODE 接口调用结果 data pd.DataFrame 当 ret == RET_OK,返回持股明细 DataFrame str 当 ret != RET_OK,返回错误描述 返回 DataFrame 字段说明:
字段 类型 说明 update_time_str str 数据更新时间 格式 YYYY-MM-DD HH:MM:SS,对应市场时区next_key str 分页标识 "-1" 表示无更多数据;续拉时原样传入 next_key 参数period_text str 报告期 如 "2026/Q1"holder_id int 持股人 ID 可用于其他持股相关协议的 holder_id 过滤name str 股东名称 holder_quantity int 总持股数 单位:股holder_quantity_change int 持股变动数 单位:股;正为增持,负为减持holder_pct float 持股比例 百分号前的值,如 12.34 表示 12.34%holder_pct_change float 持股变动比例 百分号前的值,如 12.34 表示变动 12.34%;负值为减少holding_date_str str 持股日期 格式 YYYY-MM-DD,香港时区close_price float 持股日期收盘价 对应持股日期的收盘价(真实价格)price_change_pct float 价格涨跌幅 百分号前的值,如 -0.4467 表示 -0.4467%source_group_name str 数据来源 持股明细披露信息来源,如 "13F"、"13F数据汇总" 等
Example
from moomoo import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_shareholders_holder_detail("HK.00700", request_type=1000)
if ret == RET_OK:
print(data[['period_text', 'name', 'holder_quantity', 'holder_pct', 'holder_pct_change']].to_string(index=False))
print('next_key:', data.attrs.get('next_key', '-1'))
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
- Output
period_text name holder_quantity holder_pct holder_pct_change
2026/Q1 Prosus Ventures N.V. 2079512000 23.053 -0.285
2026/Q1 Huateng Ma 709859700 7.869 0.000
2026/Q1 先锋领航 268596433 2.977 0.031
2026/Q1 贝莱德 240834898 2.669 0.088
2026/Q1 挪威银行投资管理 122744699 1.360 -0.083
2026/Q1 富达管理与研究 86765121 0.961 -0.232
2026/Q1 资本集团 85568118 0.948 0.024
2026/Q1 摩根大通 62437911 0.692 -0.025
2026/Q1 E Fund Management Co., Ltd. 52722677 0.584 0.000
2026/Q1 柏基投资 35674108 0.395 0.020
next_key: 10
2
3
4
5
6
7
8
9
10
11
12
# Qot_GetShareholdersHolderDetail.proto
介绍
获取持股明细
参数
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // 请求数据类型,详见 Qot_Common.HolderDetailType 定义,默认按服务端默认逻辑返回
optional string nextKey = 3; // 分页标识,首次不填,续拉时填上次返回的 nextKey;"-1" 表示无更多数据
optional int32 num = 4; // 每页返回数量,默认 10,范围 1~50
optional Qot_Common.SortField sortColumn = 5; // 排序列,详见 Qot_Common.SortField,61=持股股数(默认)62=持股变动数
optional Qot_Common.SortType sortType = 6; // 排序方向,详见 Qot_Common.SortType 定义,默认降序
optional int32 periodId = 7; // 指定统计周期 ID;与 Qot_GetShareholdersOverview(3237)返回的 holdingPeriodList 中 periodId 一致;默认 0 表示最新周期
optional int32 holderId = 8; // 按持股人 ID 过滤;默认 0 表示不过滤;可取自 GetShareholdersOverview(3237)、GetShareholdersHoldingChanges(3238)、本协议(3239)、GetInsiderHolderList(3241)、GetInsiderTradeList(3242)返回的 holderId
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- 股票结构参见 Security
- 持股类型参见 HolderDetailType
- 排序字段参见 SortField
- 排序方向参见 SortType
- 返回
message OwnershipDetailItem
{
optional string periodText = 1; // 报告期,如 "2025/Q3"
optional uint64 holderId = 2; // 持股人 ID
optional string name = 3; // 股东名称
optional int64 holderQuantity = 4; // 总持股数(股)
optional int64 holderQuantityChange = 5; // 持股变动数(股,正为增持,负为减持)
optional double holderPct = 6; // 持股比例(%),如 12.34 表示 12.34%
optional double holderPctChange = 7; // 持股变动比例(%),如 12.34 表示 12.34%;负值为减少
optional uint64 holdingDate = 8; // 持股日期时间戳(秒)
optional string holdingDateStr = 9; // 持股日期字符串,格式 YYYY-MM-DD,香港时区
optional double closePrice = 10; // 持股日期对应收盘价(真实价格)
optional double priceChangePct = 11; // 持股日期对应涨跌幅(%),如 -0.4467 表示 -0.4467%
optional string sourceGroupName = 12; // 持股明细披露信息来源(如 13F、多份文件等)
}
message S2C
{
optional uint64 updateTime = 1; // 数据更新时间戳(秒)
optional string updateTimeStr = 2; // 数据更新时间字符串,格式 YYYY-MM-DD HH:MM:SS,对应市场时区
optional string nextKey = 3; // 分页标识,"-1" 表示无更多数据
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // 返回结果,详见 Common.RetType
optional string retMsg = 2; // 返回结果描述
optional int32 errCode = 3; // 错误码
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- 接口调用结果,结构参见 RetType
- 股东持仓明细机构类型参见 HolderDetailType
协议 ID
3239
uint GetShareholdersHolderDetail(QotGetShareholdersHolderDetail.Request req);
virtual void OnReply_GetShareholdersHolderDetail(MMAPI_Conn client, uint nSerialNo, QotGetShareholdersHolderDetail.Response rsp);
介绍
获取持股明细
参数
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // 请求数据类型,详见 Qot_Common.HolderDetailType 定义,默认按服务端默认逻辑返回
optional string nextKey = 3; // 分页标识,首次不填,续拉时填上次返回的 nextKey;"-1" 表示无更多数据
optional int32 num = 4; // 每页返回数量,默认 10,范围 1~50
optional Qot_Common.SortField sortColumn = 5; // 排序列,详见 Qot_Common.SortField,61=持股股数(默认)62=持股变动数
optional Qot_Common.SortType sortType = 6; // 排序方向,详见 Qot_Common.SortType 定义,默认降序
optional int32 periodId = 7; // 指定统计周期 ID;与 Qot_GetShareholdersOverview(3237)返回的 holdingPeriodList 中 periodId 一致;默认 0 表示最新周期
optional int32 holderId = 8; // 按持股人 ID 过滤;默认 0 表示不过滤;可取自 GetShareholdersOverview(3237)、GetShareholdersHoldingChanges(3238)、本协议(3239)、GetInsiderHolderList(3241)、GetInsiderTradeList(3242)返回的 holderId
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- 股票结构参见 Security
- 持股类型参见 HolderDetailType
- 排序字段参见 SortField
- 排序方向参见 SortType
- 返回
message OwnershipDetailItem
{
optional string periodText = 1; // 报告期,如 "2025/Q3"
optional uint64 holderId = 2; // 持股人 ID
optional string name = 3; // 股东名称
optional int64 holderQuantity = 4; // 总持股数(股)
optional int64 holderQuantityChange = 5; // 持股变动数(股,正为增持,负为减持)
optional double holderPct = 6; // 持股比例(%),如 12.34 表示 12.34%
optional double holderPctChange = 7; // 持股变动比例(%),如 12.34 表示 12.34%;负值为减少
optional uint64 holdingDate = 8; // 持股日期时间戳(秒)
optional string holdingDateStr = 9; // 持股日期字符串,格式 YYYY-MM-DD,香港时区
optional double closePrice = 10; // 持股日期对应收盘价(真实价格)
optional double priceChangePct = 11; // 持股日期对应涨跌幅(%),如 -0.4467 表示 -0.4467%
optional string sourceGroupName = 12; // 持股明细披露信息来源(如 13F、多份文件等)
}
message S2C
{
optional uint64 updateTime = 1; // 数据更新时间戳(秒)
optional string updateTimeStr = 2; // 数据更新时间字符串,格式 YYYY-MM-DD HH:MM:SS,对应市场时区
optional string nextKey = 3; // 分页标识,"-1" 表示无更多数据
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // 返回结果,详见 Common.RetType
optional string retMsg = 2; // 返回结果描述
optional int32 errCode = 3; // 错误码
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- 接口调用结果,结构参见 RetType
- 股东持仓明细机构类型参见 HolderDetailType
- Example
public class Program : MMSPI_Qot, MMSPI_Conn
{
MMAPI_Qot qot = new MMAPI_Qot();
public Program()
{
qot.SetClientInfo("csharp", 1);
qot.SetConnCallback(this);
qot.SetQotCallback(this);
}
public void Start()
{
qot.InitConnect("127.0.0.1", (ushort)11111, false);
}
public void OnInitConnect(MMAPI_Conn client, long errCode, String desc)
{
Console.Write("Qot onInitConnect: ret={0} desc={1} connID={2}\n", errCode, desc, client.GetConnectID());
if (errCode != 0)
return;
QotCommon.Security sec = QotCommon.Security.CreateBuilder()
.SetMarket((int)QotCommon.QotMarket.QotMarket_HK_Security)
.SetCode("00700")
.Build();
QotGetShareholdersHolderDetail.C2S c2s = QotGetShareholdersHolderDetail.C2S.CreateBuilder()
.SetSecurity(sec)
.Build();
QotGetShareholdersHolderDetail.Request req = QotGetShareholdersHolderDetail.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetShareholdersHolderDetail(req);
Console.Write("Send QotGetShareholdersHolderDetail: {0}\n", seqNo);
}
public void OnDisconnect(MMAPI_Conn client, long errCode)
{
Console.Write("Qot onDisConnect: {0}\n", errCode);
}
public void OnReply_GetShareholdersHolderDetail(MMAPI_Conn client, uint nSerialNo, QotGetShareholdersHolderDetail.Response rsp)
{
Console.Write("Reply: QotGetShareholdersHolderDetail: {0} {1}\n", nSerialNo, rsp.ToString());
}
public static void Main(String[] args)
{
MMAPI.Init();
Program qot = new Program();
qot.Start();
while (true)
Thread.Sleep(1000 * 600);
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
- Output
sent seqNo=3
retType: 0
retMsg: ""
errCode: 0
s2c {
updateTime: 1778344379
updateTimeStr: "2026-05-10 00:32:59"
nextKey: "10"
itemList {
periodText: "2026/Q1"
holderId: 337488017
name: "Prosus Ventures N.V."
holderQuantity: 2079512000
holderQuantityChange: -25741100
holderPct: 23.053
holderPctChange: -0.285
holdingDate: 1767110400
holdingDateStr: "2025-12-31"
closePrice: 599
priceChangePct: -0.1666
sourceGroupName: "年报"
}
itemList {
//...
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
int getShareholdersHolderDetail(QotGetShareholdersHolderDetail.Request req);
void onReply_GetShareholdersHolderDetail(MMAPI_Conn client, int nSerialNo, QotGetShareholdersHolderDetail.Response rsp);
介绍
获取持股明细
参数
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // 请求数据类型,详见 Qot_Common.HolderDetailType 定义,默认按服务端默认逻辑返回
optional string nextKey = 3; // 分页标识,首次不填,续拉时填上次返回的 nextKey;"-1" 表示无更多数据
optional int32 num = 4; // 每页返回数量,默认 10,范围 1~50
optional Qot_Common.SortField sortColumn = 5; // 排序列,详见 Qot_Common.SortField,61=持股股数(默认)62=持股变动数
optional Qot_Common.SortType sortType = 6; // 排序方向,详见 Qot_Common.SortType 定义,默认降序
optional int32 periodId = 7; // 指定统计周期 ID;与 Qot_GetShareholdersOverview(3237)返回的 holdingPeriodList 中 periodId 一致;默认 0 表示最新周期
optional int32 holderId = 8; // 按持股人 ID 过滤;默认 0 表示不过滤;可取自 GetShareholdersOverview(3237)、GetShareholdersHoldingChanges(3238)、本协议(3239)、GetInsiderHolderList(3241)、GetInsiderTradeList(3242)返回的 holderId
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- 股票结构参见 Security
- 持股类型参见 HolderDetailType
- 排序字段参见 SortField
- 排序方向参见 SortType
- 返回
message OwnershipDetailItem
{
optional string periodText = 1; // 报告期,如 "2025/Q3"
optional uint64 holderId = 2; // 持股人 ID
optional string name = 3; // 股东名称
optional int64 holderQuantity = 4; // 总持股数(股)
optional int64 holderQuantityChange = 5; // 持股变动数(股,正为增持,负为减持)
optional double holderPct = 6; // 持股比例(%),如 12.34 表示 12.34%
optional double holderPctChange = 7; // 持股变动比例(%),如 12.34 表示 12.34%;负值为减少
optional uint64 holdingDate = 8; // 持股日期时间戳(秒)
optional string holdingDateStr = 9; // 持股日期字符串,格式 YYYY-MM-DD,香港时区
optional double closePrice = 10; // 持股日期对应收盘价(真实价格)
optional double priceChangePct = 11; // 持股日期对应涨跌幅(%),如 -0.4467 表示 -0.4467%
optional string sourceGroupName = 12; // 持股明细披露信息来源(如 13F、多份文件等)
}
message S2C
{
optional uint64 updateTime = 1; // 数据更新时间戳(秒)
optional string updateTimeStr = 2; // 数据更新时间字符串,格式 YYYY-MM-DD HH:MM:SS,对应市场时区
optional string nextKey = 3; // 分页标识,"-1" 表示无更多数据
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // 返回结果,详见 Common.RetType
optional string retMsg = 2; // 返回结果描述
optional int32 errCode = 3; // 错误码
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- 接口调用结果,结构参见 RetType
- 股东持仓明细机构类型参见 HolderDetailType
- Example
public class QotDemo implements MMSPI_Qot, MMSPI_Conn {
MMAPI_Conn_Qot qot = new MMAPI_Conn_Qot();
public QotDemo() {
qot.setClientInfo("javaclient", 1);
qot.setConnSpi(this);
qot.setQotSpi(this);
}
public void start() {
qot.initConnect("127.0.0.1", (short)11111, false);
}
@Override
public void onInitConnect(MMAPI_Conn client, long errCode, String desc)
{
System.out.printf("Qot onInitConnect: ret=%b desc=%s connID=%d\n", errCode, desc, client.getConnectID());
if (errCode != 0)
return;
QotCommon.Security sec = QotCommon.Security.newBuilder()
.setMarket(QotCommon.QotMarket.QotMarket_HK_Security_VALUE)
.setCode("00700")
.build();
QotGetShareholdersHolderDetail.C2S c2s = QotGetShareholdersHolderDetail.C2S.newBuilder()
.setSecurity(sec)
.build();
QotGetShareholdersHolderDetail.Request req = QotGetShareholdersHolderDetail.Request.newBuilder().setC2S(c2s).build();
int seqNo = qot.getShareholdersHolderDetail(req);
System.out.printf("Send QotGetShareholdersHolderDetail: %d\n", seqNo);
}
@Override
public void onDisconnect(MMAPI_Conn client, long errCode) {
System.out.printf("Qot onDisConnect: %d\n", errCode);
}
@Override
public void onReply_GetShareholdersHolderDetail(MMAPI_Conn client, int nSerialNo, QotGetShareholdersHolderDetail.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("QotGetShareholdersHolderDetail failed: %s\n", rsp.getRetMsg());
}
else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive QotGetShareholdersHolderDetail: %s\n", json);
} catch (InvalidProtocolBufferException e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) {
MMAPI.init();
QotDemo qot = new QotDemo();
qot.start();
while (true) {
try {
Thread.sleep(1000 * 600);
} catch (InterruptedException exc) {
}
}
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
- Output
Qot onInitConnect: ret=0 desc= connID=7459213593710642273
Send Qot_GetShareholdersHolderDetail: 2
Receive Qot_GetShareholdersHolderDetail: retType: 0
retMsg: ""
errCode: 0
s2c {
updateTime: 1778344379
updateTimeStr: "2026-05-10 00:32:59"
nextKey: "10"
itemList {
periodText: "2026/Q1"
holderId: 337488017
name: "Prosus Ventures N.V."
holderQuantity: 2079512000
holderQuantityChange: -25741100
holderPct: 23.053
holderPctChange: -0.285
holdingDate: 1767110400
holdingDateStr: "2025-12-31"
closePrice: 599.0
priceChangePct: -0.1666
sourceGroupName: "年报"
}
itemList {
//...
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
moomoo::u32_t GetShareholdersHolderDetail(const Qot_GetShareholdersHolderDetail::Request &stReq);
virtual void OnReply_GetShareholdersHolderDetail(moomoo::u32_t nSerialNo, const Qot_GetShareholdersHolderDetail::Response &stRsp) = 0;
介绍
获取持股明细
参数
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // 请求数据类型,详见 Qot_Common.HolderDetailType 定义,默认按服务端默认逻辑返回
optional string nextKey = 3; // 分页标识,首次不填,续拉时填上次返回的 nextKey;"-1" 表示无更多数据
optional int32 num = 4; // 每页返回数量,默认 10,范围 1~50
optional Qot_Common.SortField sortColumn = 5; // 排序列,详见 Qot_Common.SortField,61=持股股数(默认)62=持股变动数
optional Qot_Common.SortType sortType = 6; // 排序方向,详见 Qot_Common.SortType 定义,默认降序
optional int32 periodId = 7; // 指定统计周期 ID;与 Qot_GetShareholdersOverview(3237)返回的 holdingPeriodList 中 periodId 一致;默认 0 表示最新周期
optional int32 holderId = 8; // 按持股人 ID 过滤;默认 0 表示不过滤;可取自 GetShareholdersOverview(3237)、GetShareholdersHoldingChanges(3238)、本协议(3239)、GetInsiderHolderList(3241)、GetInsiderTradeList(3242)返回的 holderId
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- 股票结构参见 Security
- 持股类型参见 HolderDetailType
- 排序字段参见 SortField
- 排序方向参见 SortType
- 返回
message OwnershipDetailItem
{
optional string periodText = 1; // 报告期,如 "2025/Q3"
optional uint64 holderId = 2; // 持股人 ID
optional string name = 3; // 股东名称
optional int64 holderQuantity = 4; // 总持股数(股)
optional int64 holderQuantityChange = 5; // 持股变动数(股,正为增持,负为减持)
optional double holderPct = 6; // 持股比例(%),如 12.34 表示 12.34%
optional double holderPctChange = 7; // 持股变动比例(%),如 12.34 表示 12.34%;负值为减少
optional uint64 holdingDate = 8; // 持股日期时间戳(秒)
optional string holdingDateStr = 9; // 持股日期字符串,格式 YYYY-MM-DD,香港时区
optional double closePrice = 10; // 持股日期对应收盘价(真实价格)
optional double priceChangePct = 11; // 持股日期对应涨跌幅(%),如 -0.4467 表示 -0.4467%
optional string sourceGroupName = 12; // 持股明细披露信息来源(如 13F、多份文件等)
}
message S2C
{
optional uint64 updateTime = 1; // 数据更新时间戳(秒)
optional string updateTimeStr = 2; // 数据更新时间字符串,格式 YYYY-MM-DD HH:MM:SS,对应市场时区
optional string nextKey = 3; // 分页标识,"-1" 表示无更多数据
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // 返回结果,详见 Common.RetType
optional string retMsg = 2; // 返回结果描述
optional int32 errCode = 3; // 错误码
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- 接口调用结果,结构参见 RetType
- 股东持仓明细机构类型参见 HolderDetailType
- Example
class Program : public MMSPI_Qot, public MMSPI_Trd, public MMSPI_Conn
{
public:
Program() {
m_pQotApi = MMAPI::CreateQotApi();
m_pQotApi->RegisterQotSpi(this);
m_pQotApi->RegisterConnSpi(this);
}
~Program() {
if (m_pQotApi != nullptr)
{
m_pQotApi->UnregisterQotSpi();
m_pQotApi->UnregisterConnSpi();
MMAPI::ReleaseQotApi(m_pQotApi);
m_pQotApi = nullptr;
}
}
void Start() {
m_pQotApi->InitConnect("127.0.0.1", 11111, false);
}
virtual void OnInitConnect(MMAPI_Conn* pConn, moomoo::i64_t nErrCode, const char* strDesc) {
cout << "connect" << endl;
// construct request message
Qot_GetShareholdersHolderDetail::Request req;
Qot_GetShareholdersHolderDetail::C2S *c2s = req.mutable_c2s();
Qot_Common::Security *sec = c2s->mutable_security();
sec->set_code("00700");
sec->set_market(Qot_Common::QotMarket::QotMarket_HK_Security);
m_pQotApi->GetShareholdersHolderDetail(req);
cout << "GetShareholdersHolderDetail" << endl;
}
virtual void OnReply_GetShareholdersHolderDetail(moomoo::u32_t nSerialNo, const Qot_GetShareholdersHolderDetail::Response &stRsp){
cout << "OnReply_GetShareholdersHolderDetail:" << endl;
// print response
// ProtoBufToBodyData and UTF8ToLocal refer to tool.h in Samples
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
MMAPI_Qot *m_pQotApi;
};
int32_t main(int32_t argc, char** argv)
{
MMAPI::Init();
{
Program program;
program.Start();
getchar();
}
protobuf::ShutdownProtobufLibrary();
MMAPI::UnInit();
return 0;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
- Output
onInitConnect: ret=0 desc=Succeed!
Send Qot_GetShareholdersHolderDetail seqNo=3
retType: 0
retMsg: ""
errCode: 0
s2c {
updateTime: 1778344379
updateTimeStr: "2026-05-10 00:32:59"
nextKey: "10"
itemList {
periodText: "2026/Q1"
holderId: 337488017
name: "Prosus Ventures N.V."
holderQuantity: 2079512000
holderQuantityChange: -25741100
holderPct: 23.053
holderPctChange: -0.285
holdingDate: 1767110400
holdingDateStr: "2025-12-31"
closePrice: 599
priceChangePct: -0.1666
sourceGroupName: "年报"
}
itemList {
//...
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
GetShareholdersHolderDetail(req);
介绍
获取持股明细
参数
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // 请求数据类型,详见 Qot_Common.HolderDetailType 定义,默认按服务端默认逻辑返回
optional string nextKey = 3; // 分页标识,首次不填,续拉时填上次返回的 nextKey;"-1" 表示无更多数据
optional int32 num = 4; // 每页返回数量,默认 10,范围 1~50
optional Qot_Common.SortField sortColumn = 5; // 排序列,详见 Qot_Common.SortField,61=持股股数(默认)62=持股变动数
optional Qot_Common.SortType sortType = 6; // 排序方向,详见 Qot_Common.SortType 定义,默认降序
optional int32 periodId = 7; // 指定统计周期 ID;与 Qot_GetShareholdersOverview(3237)返回的 holdingPeriodList 中 periodId 一致;默认 0 表示最新周期
optional int32 holderId = 8; // 按持股人 ID 过滤;默认 0 表示不过滤;可取自 GetShareholdersOverview(3237)、GetShareholdersHoldingChanges(3238)、本协议(3239)、GetInsiderHolderList(3241)、GetInsiderTradeList(3242)返回的 holderId
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- 股票结构参见 Security
- 持股类型参见 HolderDetailType
- 排序字段参见 SortField
- 排序方向参见 SortType
- 返回
message OwnershipDetailItem
{
optional string periodText = 1; // 报告期,如 "2025/Q3"
optional uint64 holderId = 2; // 持股人 ID
optional string name = 3; // 股东名称
optional int64 holderQuantity = 4; // 总持股数(股)
optional int64 holderQuantityChange = 5; // 持股变动数(股,正为增持,负为减持)
optional double holderPct = 6; // 持股比例(%),如 12.34 表示 12.34%
optional double holderPctChange = 7; // 持股变动比例(%),如 12.34 表示 12.34%;负值为减少
optional uint64 holdingDate = 8; // 持股日期时间戳(秒)
optional string holdingDateStr = 9; // 持股日期字符串,格式 YYYY-MM-DD,香港时区
optional double closePrice = 10; // 持股日期对应收盘价(真实价格)
optional double priceChangePct = 11; // 持股日期对应涨跌幅(%),如 -0.4467 表示 -0.4467%
optional string sourceGroupName = 12; // 持股明细披露信息来源(如 13F、多份文件等)
}
message S2C
{
optional uint64 updateTime = 1; // 数据更新时间戳(秒)
optional string updateTimeStr = 2; // 数据更新时间字符串,格式 YYYY-MM-DD HH:MM:SS,对应市场时区
optional string nextKey = 3; // 分页标识,"-1" 表示无更多数据
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // 返回结果,详见 Common.RetType
optional string retMsg = 2; // 返回结果描述
optional int32 errCode = 3; // 错误码
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- 接口调用结果,结构参见 RetType
- 股东持仓明细机构类型参见 HolderDetailType
- Example
import mmWebsocket from "moomoo-api";
import { Common, Qot_Common } from "moomoo-api/proto";
import beautify from "js-beautify";
function QotGetShareholdersHolderDetail(){
const { RetType } = Common
const { QotMarket } = Qot_Common
let [addr, port, enable_ssl, key] = ["127.0.0.1", 33333, false, '7522027ccf5a06b1'];
let websocket = new mmWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) {
const req = {
c2s: {
security: {
market: QotMarket.QotMarket_HK_Security,
code: "00700",
},
},
};
websocket.GetShareholdersHolderDetail(req)
.then((res) => {
let { errCode, retMsg, retType,s2c } = res
console.log("GetShareholdersHolderDetail: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);
if(retType == RetType.RetType_Succeed){
let data = beautify(JSON.stringify(s2c), {
indent_size: 2,
space_in_empty_paren: true,
});
console.log(data);
}
})
.catch((error) => {
console.log("error:", error);
});
} else {
console.log("error", msg);
}
};
websocket.start(addr, port, enable_ssl, key);
setTimeout(()=>{
websocket.stop();
console.log("stop");
}, 5000);
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
- Output
GetShareholdersHolderDetail: errCode 0, retMsg , retType 0
{
"updateTime": "1778344379",
"updateTimeStr": "2026-05-10 00:32:59",
"nextKey": "10",
"itemList": [{
"periodText": "2026/Q1",
"holderId": "337488017",
"name": "Prosus Ventures N.V.",
"holderQuantity": "2079512000",
"holderQuantityChange": "-25741100",
"holderPct": 23.053,
"holderPctChange": -0.285,
"holdingDate": "1767110400",
"holdingDateStr": "2025-12-31",
"closePrice": 599,
"priceChangePct": -0.1666,
"sourceGroupName": "年报"
//...
}]
}
stop
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
接口限制
- 每 30 秒内最多请求 30 次。
- 支持港股、美股正股及基金。
- 支持分页,默认每页 10 条;分页标识为字符串类型。