# Get Shareholders Holder Detail
- 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)
Description
Get the holder detail list for a stock under a specified holder type, with pagination support
Parameters
Parameter Type Description code str Stock code e.g. US.AAPL; supports HK stocks, US stocks and fundsrequest_type HolderDetailType Holder type 0=Default, 1000=All, 1=Other Institution, 2=Traditional Investment Manager, 3=Hedge Fund, 4=Venture/Private Equity, 5=Corporate Pension, 6=Foundation Fund, 7=Insurance Company, 8=Bank/Investment Bank, 9=Family Office/Trust, 10=Sovereign Wealth Fund, 11=REIT, 12=Structured Finance Manager, 13=Union Pension, 14=Government Pension, 15=Endowment Fund, 100=Individual, 200=ADS, 300=Listed Company, 400=Unlisted Company, 500=State-Owned Shares; default returns per server-side logicnext_key str Pagination key Omit for the first request; pass the next_key returned from the previous response for subsequent pages; "-1" means no more datanum int Page size Default 10, range 1~50sort_column SortField Sort field 61=Holder quantity (default), 62=Share change numsort_type SortType Sort direction 1=Descending (default), 2=Ascendingperiod_id int Reporting period ID Matches the periodId in holdingPeriodList returned by GetShareholdersOverview (3237); default 0 means the latest periodholder_id int Holder ID filter Default 0 means no filter; can be obtained from the holder_id returned by GetShareholdersOverview (3237), GetShareholdersHoldingChanges (3238), this protocol (3239), GetInsiderHolderList (3241), or GetInsiderTradeList (3242)Return
Parameter Type Description ret RET_CODE API call result data pd.DataFrame When ret == RET_OK, returns holder detail DataFrame str When ret != RET_OK, returns error description DataFrame field descriptions:
Field Type Description update_time_str str Data update time Format YYYY-MM-DD HH:MM:SS, corresponding market timezonenext_key str Pagination key "-1" means no more data; pass as-is in the next request's next_key parameterperiod_text str Reporting period e.g. "2026/Q1"holder_id int Holder ID Can be used as holder_id filter in other shareholder-related protocolsname str Holder name holder_quantity int Total shares held Unit: sharesholder_quantity_change int Share change number Unit: shares; positive means increased, negative means decreasedholder_pct float Holding percentage Value before the percent sign, e.g. 12.34 means 12.34%holder_pct_change float Holding change ratio Value before the percent sign, e.g. 12.34 means a change of 12.34%; negative means decreaseholding_date_str str Holding date Format YYYY-MM-DD, Hong Kong timezoneclose_price float Closing price on holding date Actual closing price corresponding to the holding dateprice_change_pct float Price change percentage Value before the percent sign, e.g. -0.4467 means -0.4467%source_group_name str Data source Disclosure source of holder detail, e.g. "13F", "13F Summary", etc.
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
Description
Get shareholders holder detail
Parameters
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // Request data type, see Qot_Common.HolderDetailType; default returns per server-side logic
optional string nextKey = 3; // Pagination key; omit for first request, pass previous nextKey for subsequent pages; "-1" means no more data
optional int32 num = 4; // Page size, default 10, range 1~50
optional Qot_Common.SortField sortColumn = 5; // Sort field, see Qot_Common.SortField: 61=Holder quantity (default), 62=Share change num
optional Qot_Common.SortType sortType = 6; // Sort direction, see Qot_Common.SortType, default descending
optional int32 periodId = 7; // Reporting period ID; matches periodId in holdingPeriodList returned by GetShareholdersOverview (3237); default 0 means latest period
optional int32 holderId = 8; // Filter by holder ID; default 0 means no filter; can be obtained from GetShareholdersOverview (3237), GetShareholdersHoldingChanges (3238), this protocol (3239), GetInsiderHolderList (3241), or GetInsiderTradeList (3242)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- For the Security structure, see Security
- For holder detail type, see HolderDetailType
- Return
message OwnershipDetailItem
{
optional string periodText = 1; // Reporting period, e.g. "2025/Q3"
optional uint64 holderId = 2; // Holder ID
optional string name = 3; // Holder name
optional int64 holderQuantity = 4; // Total shares held (unit: shares)
optional int64 holderQuantityChange = 5; // Share change number (unit: shares; positive=increase, negative=decrease)
optional double holderPct = 6; // Holding percentage, value before percent sign, e.g. 12.34 means 12.34%
optional double holderPctChange = 7; // Holding change ratio, value before percent sign, e.g. 12.34 means a change of 12.34%; negative means decrease
optional uint64 holdingDate = 8; // Holding date timestamp (seconds)
optional string holdingDateStr = 9; // Holding date string, format YYYY-MM-DD, Hong Kong timezone
optional double closePrice = 10; // Closing price on holding date (actual price)
optional double priceChangePct = 11; // Price change percentage on holding date, e.g. -0.4467 means -0.4467%
optional string sourceGroupName = 12; // Disclosure source of holder detail (e.g. 13F, multiple filings, etc.)
}
message S2C
{
optional uint64 updateTime = 1; // Data update timestamp (seconds)
optional string updateTimeStr = 2; // Data update time string, format YYYY-MM-DD HH:MM:SS, corresponding market timezone
optional string nextKey = 3; // Pagination key; "-1" means no more data
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // Return result, see Common.RetType
optional string retMsg = 2; // Return result description
optional int32 errCode = 3; // Error code
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
- For API call result structure, see RetType
- For holder detail holder information type, see HolderDetailType
Protocol ID
3239
uint GetShareholdersHolderDetail(QotGetShareholdersHolderDetail.Request req);
virtual void OnReply_GetShareholdersHolderDetail(MMAPI_Conn client, uint nSerialNo, QotGetShareholdersHolderDetail.Response rsp);
Description
Get shareholders holder detail
Parameters
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // Request data type, see Qot_Common.HolderDetailType; default returns per server-side logic
optional string nextKey = 3; // Pagination key; omit for first request, pass previous nextKey for subsequent pages; "-1" means no more data
optional int32 num = 4; // Page size, default 10, range 1~50
optional Qot_Common.SortField sortColumn = 5; // Sort field, see Qot_Common.SortField: 61=Holder quantity (default), 62=Share change num
optional Qot_Common.SortType sortType = 6; // Sort direction, see Qot_Common.SortType, default descending
optional int32 periodId = 7; // Reporting period ID; matches periodId in holdingPeriodList returned by GetShareholdersOverview (3237); default 0 means latest period
optional int32 holderId = 8; // Filter by holder ID; default 0 means no filter; can be obtained from GetShareholdersOverview (3237), GetShareholdersHoldingChanges (3238), this protocol (3239), GetInsiderHolderList (3241), or GetInsiderTradeList (3242)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- For the Security structure, see Security
- Return
message OwnershipDetailItem
{
optional string periodText = 1; // Reporting period, e.g. "2025/Q3"
optional uint64 holderId = 2; // Holder ID
optional string name = 3; // Holder name
optional int64 holderQuantity = 4; // Total shares held (unit: shares)
optional int64 holderQuantityChange = 5; // Share change number (unit: shares; positive=increase, negative=decrease)
optional double holderPct = 6; // Holding percentage, value before percent sign, e.g. 12.34 means 12.34%
optional double holderPctChange = 7; // Holding change ratio, value before percent sign, e.g. 12.34 means a change of 12.34%; negative means decrease
optional uint64 holdingDate = 8; // Holding date timestamp (seconds)
optional string holdingDateStr = 9; // Holding date string, format YYYY-MM-DD, Hong Kong timezone
optional double closePrice = 10; // Closing price on holding date (actual price)
optional double priceChangePct = 11; // Price change percentage on holding date, e.g. -0.4467 means -0.4467%
optional string sourceGroupName = 12; // Disclosure source of holder detail (e.g. 13F, multiple filings, etc.)
}
message S2C
{
optional uint64 updateTime = 1; // Data update timestamp (seconds)
optional string updateTimeStr = 2; // Data update time string, format YYYY-MM-DD HH:MM:SS, corresponding market timezone
optional string nextKey = 3; // Pagination key; "-1" means no more data
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // Return result, see Common.RetType
optional string retMsg = 2; // Return result description
optional int32 errCode = 3; // Error code
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
- For API call result structure, see 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(MMAPI_Conn client, int nSerialNo, QotGetShareholdersHolderDetail.Response rsp);
Description
Get shareholders holder detail
Parameters
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // Request data type, see Qot_Common.HolderDetailType; default returns per server-side logic
optional string nextKey = 3; // Pagination key; omit for first request, pass previous nextKey for subsequent pages; "-1" means no more data
optional int32 num = 4; // Page size, default 10, range 1~50
optional Qot_Common.SortField sortColumn = 5; // Sort field, see Qot_Common.SortField: 61=Holder quantity (default), 62=Share change num
optional Qot_Common.SortType sortType = 6; // Sort direction, see Qot_Common.SortType, default descending
optional int32 periodId = 7; // Reporting period ID; matches periodId in holdingPeriodList returned by GetShareholdersOverview (3237); default 0 means latest period
optional int32 holderId = 8; // Filter by holder ID; default 0 means no filter; can be obtained from GetShareholdersOverview (3237), GetShareholdersHoldingChanges (3238), this protocol (3239), GetInsiderHolderList (3241), or GetInsiderTradeList (3242)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- For the Security structure, see Security
- Return
message OwnershipDetailItem
{
optional string periodText = 1; // Reporting period, e.g. "2025/Q3"
optional uint64 holderId = 2; // Holder ID
optional string name = 3; // Holder name
optional int64 holderQuantity = 4; // Total shares held (unit: shares)
optional int64 holderQuantityChange = 5; // Share change number (unit: shares; positive=increase, negative=decrease)
optional double holderPct = 6; // Holding percentage, value before percent sign, e.g. 12.34 means 12.34%
optional double holderPctChange = 7; // Holding change ratio, value before percent sign, e.g. 12.34 means a change of 12.34%; negative means decrease
optional uint64 holdingDate = 8; // Holding date timestamp (seconds)
optional string holdingDateStr = 9; // Holding date string, format YYYY-MM-DD, Hong Kong timezone
optional double closePrice = 10; // Closing price on holding date (actual price)
optional double priceChangePct = 11; // Price change percentage on holding date, e.g. -0.4467 means -0.4467%
optional string sourceGroupName = 12; // Disclosure source of holder detail (e.g. 13F, multiple filings, etc.)
}
message S2C
{
optional uint64 updateTime = 1; // Data update timestamp (seconds)
optional string updateTimeStr = 2; // Data update time string, format YYYY-MM-DD HH:MM:SS, corresponding market timezone
optional string nextKey = 3; // Pagination key; "-1" means no more data
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // Return result, see Common.RetType
optional string retMsg = 2; // Return result description
optional int32 errCode = 3; // Error code
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
- For API call result structure, see 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
moomoo::u32_t GetShareholdersHolderDetail(const Qot_GetShareholdersHolderDetail::Request &stReq);
virtual void OnReply_GetShareholdersHolderDetail(moomoo::u32_t nSerialNo, const Qot_GetShareholdersHolderDetail::Response &stRsp) = 0;
Description
Get shareholders holder detail
Parameters
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // Request data type, see Qot_Common.HolderDetailType; default returns per server-side logic
optional string nextKey = 3; // Pagination key; omit for first request, pass previous nextKey for subsequent pages; "-1" means no more data
optional int32 num = 4; // Page size, default 10, range 1~50
optional Qot_Common.SortField sortColumn = 5; // Sort field, see Qot_Common.SortField: 61=Holder quantity (default), 62=Share change num
optional Qot_Common.SortType sortType = 6; // Sort direction, see Qot_Common.SortType, default descending
optional int32 periodId = 7; // Reporting period ID; matches periodId in holdingPeriodList returned by GetShareholdersOverview (3237); default 0 means latest period
optional int32 holderId = 8; // Filter by holder ID; default 0 means no filter; can be obtained from GetShareholdersOverview (3237), GetShareholdersHoldingChanges (3238), this protocol (3239), GetInsiderHolderList (3241), or GetInsiderTradeList (3242)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- For the Security structure, see Security
- Return
message OwnershipDetailItem
{
optional string periodText = 1; // Reporting period, e.g. "2025/Q3"
optional uint64 holderId = 2; // Holder ID
optional string name = 3; // Holder name
optional int64 holderQuantity = 4; // Total shares held (unit: shares)
optional int64 holderQuantityChange = 5; // Share change number (unit: shares; positive=increase, negative=decrease)
optional double holderPct = 6; // Holding percentage, value before percent sign, e.g. 12.34 means 12.34%
optional double holderPctChange = 7; // Holding change ratio, value before percent sign, e.g. 12.34 means a change of 12.34%; negative means decrease
optional uint64 holdingDate = 8; // Holding date timestamp (seconds)
optional string holdingDateStr = 9; // Holding date string, format YYYY-MM-DD, Hong Kong timezone
optional double closePrice = 10; // Closing price on holding date (actual price)
optional double priceChangePct = 11; // Price change percentage on holding date, e.g. -0.4467 means -0.4467%
optional string sourceGroupName = 12; // Disclosure source of holder detail (e.g. 13F, multiple filings, etc.)
}
message S2C
{
optional uint64 updateTime = 1; // Data update timestamp (seconds)
optional string updateTimeStr = 2; // Data update time string, format YYYY-MM-DD HH:MM:SS, corresponding market timezone
optional string nextKey = 3; // Pagination key; "-1" means no more data
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // Return result, see Common.RetType
optional string retMsg = 2; // Return result description
optional int32 errCode = 3; // Error code
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
- For API call result structure, see 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);
Description
Get shareholders holder detail
Parameters
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // Request data type, see Qot_Common.HolderDetailType; default returns per server-side logic
optional string nextKey = 3; // Pagination key; omit for first request, pass previous nextKey for subsequent pages; "-1" means no more data
optional int32 num = 4; // Page size, default 10, range 1~50
optional Qot_Common.SortField sortColumn = 5; // Sort field, see Qot_Common.SortField: 61=Holder quantity (default), 62=Share change num
optional Qot_Common.SortType sortType = 6; // Sort direction, see Qot_Common.SortType, default descending
optional int32 periodId = 7; // Reporting period ID; matches periodId in holdingPeriodList returned by GetShareholdersOverview (3237); default 0 means latest period
optional int32 holderId = 8; // Filter by holder ID; default 0 means no filter; can be obtained from GetShareholdersOverview (3237), GetShareholdersHoldingChanges (3238), this protocol (3239), GetInsiderHolderList (3241), or GetInsiderTradeList (3242)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- For the Security structure, see Security
- Return
message OwnershipDetailItem
{
optional string periodText = 1; // Reporting period, e.g. "2025/Q3"
optional uint64 holderId = 2; // Holder ID
optional string name = 3; // Holder name
optional int64 holderQuantity = 4; // Total shares held (unit: shares)
optional int64 holderQuantityChange = 5; // Share change number (unit: shares; positive=increase, negative=decrease)
optional double holderPct = 6; // Holding percentage, value before percent sign, e.g. 12.34 means 12.34%
optional double holderPctChange = 7; // Holding change ratio, value before percent sign, e.g. 12.34 means a change of 12.34%; negative means decrease
optional uint64 holdingDate = 8; // Holding date timestamp (seconds)
optional string holdingDateStr = 9; // Holding date string, format YYYY-MM-DD, Hong Kong timezone
optional double closePrice = 10; // Closing price on holding date (actual price)
optional double priceChangePct = 11; // Price change percentage on holding date, e.g. -0.4467 means -0.4467%
optional string sourceGroupName = 12; // Disclosure source of holder detail (e.g. 13F, multiple filings, etc.)
}
message S2C
{
optional uint64 updateTime = 1; // Data update timestamp (seconds)
optional string updateTimeStr = 2; // Data update time string, format YYYY-MM-DD HH:MM:SS, corresponding market timezone
optional string nextKey = 3; // Pagination key; "-1" means no more data
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // Return result, see Common.RetType
optional string retMsg = 2; // Return result description
optional int32 errCode = 3; // Error code
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
- For API call result structure, see 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
Interface Limits
- Max 30 requests per 30 seconds.
- Supports HK stocks, US stocks and funds.
- Supports pagination; default page size is 10; pagination key is of string type.
- 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)
Description
Get the holder detail list for a stock under a specified holder type, with pagination support
Parameters
Parameter Type Description code str Stock code e.g. US.AAPL; supports HK stocks, US stocks and fundsrequest_type HolderDetailType Holder type 0=Default, 1000=All, 1=Other Institution, 2=Traditional Investment Manager, 3=Hedge Fund, 4=Venture/Private Equity, 5=Corporate Pension, 6=Foundation Fund, 7=Insurance Company, 8=Bank/Investment Bank, 9=Family Office/Trust, 10=Sovereign Wealth Fund, 11=REIT, 12=Structured Finance Manager, 13=Union Pension, 14=Government Pension, 15=Endowment Fund, 100=Individual, 200=ADS, 300=Listed Company, 400=Unlisted Company, 500=State-Owned Shares; default returns per server-side logicnext_key str Pagination key Omit for the first request; pass the next_key returned from the previous response for subsequent pages; "-1" means no more datanum int Page size Default 10, range 1~50sort_column SortField Sort field 61=Holder quantity (default), 62=Share change numsort_type SortType Sort direction 1=Descending (default), 2=Ascendingperiod_id int Reporting period ID Matches the periodId in holdingPeriodList returned by GetShareholdersOverview (3237); default 0 means the latest periodholder_id int Holder ID filter Default 0 means no filter; can be obtained from the holder_id returned by GetShareholdersOverview (3237), GetShareholdersHoldingChanges (3238), this protocol (3239), GetInsiderHolderList (3241), or GetInsiderTradeList (3242)Return
Parameter Type Description ret RET_CODE API call result data pd.DataFrame When ret == RET_OK, returns holder detail DataFrame str When ret != RET_OK, returns error description DataFrame field descriptions:
Field Type Description update_time_str str Data update time Format YYYY-MM-DD HH:MM:SS, corresponding market timezonenext_key str Pagination key "-1" means no more data; pass as-is in the next request's next_key parameterperiod_text str Reporting period e.g. "2026/Q1"holder_id int Holder ID Can be used as holder_id filter in other shareholder-related protocolsname str Holder name holder_quantity int Total shares held Unit: sharesholder_quantity_change int Share change number Unit: shares; positive means increased, negative means decreasedholder_pct float Holding percentage Value before the percent sign, e.g. 12.34 means 12.34%holder_pct_change float Holding change ratio Value before the percent sign, e.g. 12.34 means a change of 12.34%; negative means decreaseholding_date_str str Holding date Format YYYY-MM-DD, Hong Kong timezoneclose_price float Closing price on holding date Actual closing price corresponding to the holding dateprice_change_pct float Price change percentage Value before the percent sign, e.g. -0.4467 means -0.4467%source_group_name str Data source Disclosure source of holder detail, e.g. "13F", "13F Summary", etc.
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
Description
Get shareholders holder detail
Parameters
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // Request data type, see Qot_Common.HolderDetailType; default returns per server-side logic
optional string nextKey = 3; // Pagination key; omit for first request, pass previous nextKey for subsequent pages; "-1" means no more data
optional int32 num = 4; // Page size, default 10, range 1~50
optional Qot_Common.SortField sortColumn = 5; // Sort field, see Qot_Common.SortField: 61=Holder quantity (default), 62=Share change num
optional Qot_Common.SortType sortType = 6; // Sort direction, see Qot_Common.SortType, default descending
optional int32 periodId = 7; // Reporting period ID; matches periodId in holdingPeriodList returned by GetShareholdersOverview (3237); default 0 means latest period
optional int32 holderId = 8; // Filter by holder ID; default 0 means no filter; can be obtained from GetShareholdersOverview (3237), GetShareholdersHoldingChanges (3238), this protocol (3239), GetInsiderHolderList (3241), or GetInsiderTradeList (3242)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- For the Security structure, see Security
- For holder detail type, see HolderDetailType
- Return
message OwnershipDetailItem
{
optional string periodText = 1; // Reporting period, e.g. "2025/Q3"
optional uint64 holderId = 2; // Holder ID
optional string name = 3; // Holder name
optional int64 holderQuantity = 4; // Total shares held (unit: shares)
optional int64 holderQuantityChange = 5; // Share change number (unit: shares; positive=increase, negative=decrease)
optional double holderPct = 6; // Holding percentage, value before percent sign, e.g. 12.34 means 12.34%
optional double holderPctChange = 7; // Holding change ratio, value before percent sign, e.g. 12.34 means a change of 12.34%; negative means decrease
optional uint64 holdingDate = 8; // Holding date timestamp (seconds)
optional string holdingDateStr = 9; // Holding date string, format YYYY-MM-DD, Hong Kong timezone
optional double closePrice = 10; // Closing price on holding date (actual price)
optional double priceChangePct = 11; // Price change percentage on holding date, e.g. -0.4467 means -0.4467%
optional string sourceGroupName = 12; // Disclosure source of holder detail (e.g. 13F, multiple filings, etc.)
}
message S2C
{
optional uint64 updateTime = 1; // Data update timestamp (seconds)
optional string updateTimeStr = 2; // Data update time string, format YYYY-MM-DD HH:MM:SS, corresponding market timezone
optional string nextKey = 3; // Pagination key; "-1" means no more data
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // Return result, see Common.RetType
optional string retMsg = 2; // Return result description
optional int32 errCode = 3; // Error code
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
- For API call result structure, see RetType
- For holder detail holder information type, see HolderDetailType
Protocol ID
3239
uint GetShareholdersHolderDetail(QotGetShareholdersHolderDetail.Request req);
virtual void OnReply_GetShareholdersHolderDetail(MMAPI_Conn client, uint nSerialNo, QotGetShareholdersHolderDetail.Response rsp);
Description
Get shareholders holder detail
Parameters
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // Request data type, see Qot_Common.HolderDetailType; default returns per server-side logic
optional string nextKey = 3; // Pagination key; omit for first request, pass previous nextKey for subsequent pages; "-1" means no more data
optional int32 num = 4; // Page size, default 10, range 1~50
optional Qot_Common.SortField sortColumn = 5; // Sort field, see Qot_Common.SortField: 61=Holder quantity (default), 62=Share change num
optional Qot_Common.SortType sortType = 6; // Sort direction, see Qot_Common.SortType, default descending
optional int32 periodId = 7; // Reporting period ID; matches periodId in holdingPeriodList returned by GetShareholdersOverview (3237); default 0 means latest period
optional int32 holderId = 8; // Filter by holder ID; default 0 means no filter; can be obtained from GetShareholdersOverview (3237), GetShareholdersHoldingChanges (3238), this protocol (3239), GetInsiderHolderList (3241), or GetInsiderTradeList (3242)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- For the Security structure, see Security
- Return
message OwnershipDetailItem
{
optional string periodText = 1; // Reporting period, e.g. "2025/Q3"
optional uint64 holderId = 2; // Holder ID
optional string name = 3; // Holder name
optional int64 holderQuantity = 4; // Total shares held (unit: shares)
optional int64 holderQuantityChange = 5; // Share change number (unit: shares; positive=increase, negative=decrease)
optional double holderPct = 6; // Holding percentage, value before percent sign, e.g. 12.34 means 12.34%
optional double holderPctChange = 7; // Holding change ratio, value before percent sign, e.g. 12.34 means a change of 12.34%; negative means decrease
optional uint64 holdingDate = 8; // Holding date timestamp (seconds)
optional string holdingDateStr = 9; // Holding date string, format YYYY-MM-DD, Hong Kong timezone
optional double closePrice = 10; // Closing price on holding date (actual price)
optional double priceChangePct = 11; // Price change percentage on holding date, e.g. -0.4467 means -0.4467%
optional string sourceGroupName = 12; // Disclosure source of holder detail (e.g. 13F, multiple filings, etc.)
}
message S2C
{
optional uint64 updateTime = 1; // Data update timestamp (seconds)
optional string updateTimeStr = 2; // Data update time string, format YYYY-MM-DD HH:MM:SS, corresponding market timezone
optional string nextKey = 3; // Pagination key; "-1" means no more data
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // Return result, see Common.RetType
optional string retMsg = 2; // Return result description
optional int32 errCode = 3; // Error code
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
- For API call result structure, see 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);
Description
Get shareholders holder detail
Parameters
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // Request data type, see Qot_Common.HolderDetailType; default returns per server-side logic
optional string nextKey = 3; // Pagination key; omit for first request, pass previous nextKey for subsequent pages; "-1" means no more data
optional int32 num = 4; // Page size, default 10, range 1~50
optional Qot_Common.SortField sortColumn = 5; // Sort field, see Qot_Common.SortField: 61=Holder quantity (default), 62=Share change num
optional Qot_Common.SortType sortType = 6; // Sort direction, see Qot_Common.SortType, default descending
optional int32 periodId = 7; // Reporting period ID; matches periodId in holdingPeriodList returned by GetShareholdersOverview (3237); default 0 means latest period
optional int32 holderId = 8; // Filter by holder ID; default 0 means no filter; can be obtained from GetShareholdersOverview (3237), GetShareholdersHoldingChanges (3238), this protocol (3239), GetInsiderHolderList (3241), or GetInsiderTradeList (3242)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- For the Security structure, see Security
- Return
message OwnershipDetailItem
{
optional string periodText = 1; // Reporting period, e.g. "2025/Q3"
optional uint64 holderId = 2; // Holder ID
optional string name = 3; // Holder name
optional int64 holderQuantity = 4; // Total shares held (unit: shares)
optional int64 holderQuantityChange = 5; // Share change number (unit: shares; positive=increase, negative=decrease)
optional double holderPct = 6; // Holding percentage, value before percent sign, e.g. 12.34 means 12.34%
optional double holderPctChange = 7; // Holding change ratio, value before percent sign, e.g. 12.34 means a change of 12.34%; negative means decrease
optional uint64 holdingDate = 8; // Holding date timestamp (seconds)
optional string holdingDateStr = 9; // Holding date string, format YYYY-MM-DD, Hong Kong timezone
optional double closePrice = 10; // Closing price on holding date (actual price)
optional double priceChangePct = 11; // Price change percentage on holding date, e.g. -0.4467 means -0.4467%
optional string sourceGroupName = 12; // Disclosure source of holder detail (e.g. 13F, multiple filings, etc.)
}
message S2C
{
optional uint64 updateTime = 1; // Data update timestamp (seconds)
optional string updateTimeStr = 2; // Data update time string, format YYYY-MM-DD HH:MM:SS, corresponding market timezone
optional string nextKey = 3; // Pagination key; "-1" means no more data
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // Return result, see Common.RetType
optional string retMsg = 2; // Return result description
optional int32 errCode = 3; // Error code
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
- For API call result structure, see 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;
Description
Get shareholders holder detail
Parameters
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // Request data type, see Qot_Common.HolderDetailType; default returns per server-side logic
optional string nextKey = 3; // Pagination key; omit for first request, pass previous nextKey for subsequent pages; "-1" means no more data
optional int32 num = 4; // Page size, default 10, range 1~50
optional Qot_Common.SortField sortColumn = 5; // Sort field, see Qot_Common.SortField: 61=Holder quantity (default), 62=Share change num
optional Qot_Common.SortType sortType = 6; // Sort direction, see Qot_Common.SortType, default descending
optional int32 periodId = 7; // Reporting period ID; matches periodId in holdingPeriodList returned by GetShareholdersOverview (3237); default 0 means latest period
optional int32 holderId = 8; // Filter by holder ID; default 0 means no filter; can be obtained from GetShareholdersOverview (3237), GetShareholdersHoldingChanges (3238), this protocol (3239), GetInsiderHolderList (3241), or GetInsiderTradeList (3242)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- For the Security structure, see Security
- Return
message OwnershipDetailItem
{
optional string periodText = 1; // Reporting period, e.g. "2025/Q3"
optional uint64 holderId = 2; // Holder ID
optional string name = 3; // Holder name
optional int64 holderQuantity = 4; // Total shares held (unit: shares)
optional int64 holderQuantityChange = 5; // Share change number (unit: shares; positive=increase, negative=decrease)
optional double holderPct = 6; // Holding percentage, value before percent sign, e.g. 12.34 means 12.34%
optional double holderPctChange = 7; // Holding change ratio, value before percent sign, e.g. 12.34 means a change of 12.34%; negative means decrease
optional uint64 holdingDate = 8; // Holding date timestamp (seconds)
optional string holdingDateStr = 9; // Holding date string, format YYYY-MM-DD, Hong Kong timezone
optional double closePrice = 10; // Closing price on holding date (actual price)
optional double priceChangePct = 11; // Price change percentage on holding date, e.g. -0.4467 means -0.4467%
optional string sourceGroupName = 12; // Disclosure source of holder detail (e.g. 13F, multiple filings, etc.)
}
message S2C
{
optional uint64 updateTime = 1; // Data update timestamp (seconds)
optional string updateTimeStr = 2; // Data update time string, format YYYY-MM-DD HH:MM:SS, corresponding market timezone
optional string nextKey = 3; // Pagination key; "-1" means no more data
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // Return result, see Common.RetType
optional string retMsg = 2; // Return result description
optional int32 errCode = 3; // Error code
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
- For API call result structure, see 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);
Description
Get shareholders holder detail
Parameters
message C2S
{
required Qot_Common.Security security = 1;
optional Qot_Common.HolderDetailType requestType = 2; // Request data type, see Qot_Common.HolderDetailType; default returns per server-side logic
optional string nextKey = 3; // Pagination key; omit for first request, pass previous nextKey for subsequent pages; "-1" means no more data
optional int32 num = 4; // Page size, default 10, range 1~50
optional Qot_Common.SortField sortColumn = 5; // Sort field, see Qot_Common.SortField: 61=Holder quantity (default), 62=Share change num
optional Qot_Common.SortType sortType = 6; // Sort direction, see Qot_Common.SortType, default descending
optional int32 periodId = 7; // Reporting period ID; matches periodId in holdingPeriodList returned by GetShareholdersOverview (3237); default 0 means latest period
optional int32 holderId = 8; // Filter by holder ID; default 0 means no filter; can be obtained from GetShareholdersOverview (3237), GetShareholdersHoldingChanges (3238), this protocol (3239), GetInsiderHolderList (3241), or GetInsiderTradeList (3242)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- For the Security structure, see Security
- Return
message OwnershipDetailItem
{
optional string periodText = 1; // Reporting period, e.g. "2025/Q3"
optional uint64 holderId = 2; // Holder ID
optional string name = 3; // Holder name
optional int64 holderQuantity = 4; // Total shares held (unit: shares)
optional int64 holderQuantityChange = 5; // Share change number (unit: shares; positive=increase, negative=decrease)
optional double holderPct = 6; // Holding percentage, value before percent sign, e.g. 12.34 means 12.34%
optional double holderPctChange = 7; // Holding change ratio, value before percent sign, e.g. 12.34 means a change of 12.34%; negative means decrease
optional uint64 holdingDate = 8; // Holding date timestamp (seconds)
optional string holdingDateStr = 9; // Holding date string, format YYYY-MM-DD, Hong Kong timezone
optional double closePrice = 10; // Closing price on holding date (actual price)
optional double priceChangePct = 11; // Price change percentage on holding date, e.g. -0.4467 means -0.4467%
optional string sourceGroupName = 12; // Disclosure source of holder detail (e.g. 13F, multiple filings, etc.)
}
message S2C
{
optional uint64 updateTime = 1; // Data update timestamp (seconds)
optional string updateTimeStr = 2; // Data update time string, format YYYY-MM-DD HH:MM:SS, corresponding market timezone
optional string nextKey = 3; // Pagination key; "-1" means no more data
repeated OwnershipDetailItem itemList = 4;
}
message Response
{
required int32 retType = 1 [default = -400]; // Return result, see Common.RetType
optional string retMsg = 2; // Return result description
optional int32 errCode = 3; // Error code
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
- For API call result structure, see 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
Interface Limits
- Max 30 requests per 30 seconds.
- Supports HK stocks, US stocks and funds.
- Supports pagination; default page size is 10; pagination key is of string type.