# 獲取持股明細
- 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 The Vanguard 268596433 2.977 0.031
2026/Q1 BlackRock 240834898 2.669 0.088
2026/Q1 Norges Bank Investment Management 122744699 1.360 -0.083
2026/Q1 FMR 86765121 0.961 -0.232
2026/Q1 Capital Research 85568118 0.948 0.024
2026/Q1 J.P. Morgan Asset Management, Inc. 62437911 0.692 -0.025
2026/Q1 E Fund Management Co., Ltd. 52722677 0.584 0.000
2026/Q1 Baillie Gifford 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
- 返回
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
- 返回
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
- 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: "Annual Report"
}
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
- 返回
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
- 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=7459212646576371604
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: "Annual Report"
}
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
- 返回
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
- 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: "Annual Report"
}
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
- 返回
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
- 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": "Annual Report"
//...
}]
}
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 The Vanguard 268596433 2.977 0.031
2026/Q1 BlackRock 240834898 2.669 0.088
2026/Q1 Norges Bank Investment Management 122744699 1.360 -0.083
2026/Q1 FMR 86765121 0.961 -0.232
2026/Q1 Capital Research 85568118 0.948 0.024
2026/Q1 J.P. Morgan Asset Management, Inc. 62437911 0.692 -0.025
2026/Q1 E Fund Management Co., Ltd. 52722677 0.584 0.000
2026/Q1 Baillie Gifford 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
- 返回
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
- 返回
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
- 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: "Annual Report"
}
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
- 返回
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
- 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=7459212646576371604
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: "Annual Report"
}
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
- 返回
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
- 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: "Annual Report"
}
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
- 返回
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
- 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": "Annual Report"
//...
}]
}
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 筆;分頁標識為字串類型。