# 获取主营构成
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_financials_revenue_breakdown(code, date=None, financial_type=None, currency_code=None)
介绍
获取指定股票的主营构成数据,支持产品、行业、地区、业务等多维度拆解
参数
参数 类型 说明 code str 股票代码 date int 筛选时间戳 秒;从返回的 screen_date_list 中取 date 值可查历史;不填或填 0 返回最新一期financial_type F10Type 财报类型 0=不限,1=Q1单季报,2=Q2单季报,3=Q3单季报,4=Q4单季报,5=半年报,6=Q9累计报,7=年报,9=聚合季报;默认 0=不限currency_code str 币种代码 ISO 4217,如 CNY、USD、HKD、SGD、JPY、CAD、AUD;不填返回原始货币数据返回
参数 类型 说明 ret RET_CODE 接口调用结果 data dict 当 ret == RET_OK,返回主营构成数据字典 str 当 ret != RET_OK,返回错误描述 返回字典包含以下字段:
字段 类型 说明 period str 财报周期 如 "2025/FY"、"2024/H1"breakdown_list list 各维度主营构成数据列表 每项含 type 和 item_listcurrency_code str 货币代码 ISO 4217screen_date_list list 可选历史日期列表 仅 date 与 financial_type 均未填时返回breakdown_list 每项包含的字段:
字段 类型 说明 type RevenueBreakdownType 维度类型 1=产品(Product),2=行业(Industry),4=地区(Region),8=业务(Business)item_list list 该维度主营构成列表 每项含 name、main_oper_income、ratioitem_list 每项包含的字段:
字段 类型 说明 name str 名称 main_oper_income float 营业收入 ratio float 占比 百分号前的值,如 12.34 表示 12.34%screen_date_list 每项包含的字段:
字段 类型 说明 date int 筛选时间戳 秒;回传型,须为此列表中某个 date 值period_text str 财报周期 如 "2025/FY"financial_type F10Type 财报类型
Example
import pandas as pd
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_financials_revenue_breakdown("HK.00700")
if ret == RET_OK:
df = pd.DataFrame(data['breakdown_list'][0]['item_list'])
print(df)
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
- Output
name main_oper_income ratio
0 增值服务 3.692810e+11 49.1218
1 金融科技及企业服务 2.294350e+11 30.5194
2 营销服务 1.449730e+11 19.2843
3 其他 8.077000e+09 1.0744
2
3
4
5
# Qot_GetFinancialsRevenueBreakdown.proto
介绍
获取主营构成
参数
message C2S
{
required Qot_Common.Security security = 1; // 股票
optional uint32 date = 2; // 筛选时间戳(Unix 时间戳(秒),0 或不填返回最新一期,回传型,须为 screenDateList 中某个 date 值)
optional Qot_Common.F10Type financialType = 3; // 财报类型,详见 Qot_Common.F10Type 定义,支持 0-7, 9,默认 0(Unknown)
optional string currencyCode = 4; // 币种代码(ISO 4217),如 CNY、USD、HKD、SGD、JPY、CAD、AUD;不填返回原始货币数据
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
- 股票结构参见 Security
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 返回
// 主营构成项
message MainIncomeItem
{
optional string name = 1; // 名称
optional double mainOperIncome = 2; // 营业收入
optional double ratio = 3; // 占比,百分号前的值,如 12.34 表示 12.34%
}
// 单一维度主营构成数据
message RevenueBreakdownGroup
{
optional Qot_Common.RevenueBreakdownType type = 1; // 维度类型(详见 Qot_Common.RevenueBreakdownType 定义)
repeated MainIncomeItem itemList = 2; // 该维度主营构成数据列表
}
// 筛选日期
message ScreenDate
{
optional uint32 date = 1; // 筛选时间戳(Unix 时间戳(秒),下次请求原样传入)
optional string periodText = 2; // 财报周期,如 "2024/Q3"、"2024/FY"
optional Qot_Common.F10Type financialType = 3; // 财报类型(详见 Qot_Common.F10Type 定义)
}
message S2C
{
optional string period = 1; // 财报周期,如 "2024/Q3"、"2024/FY"
repeated RevenueBreakdownGroup breakdownList = 2; // 各维度主营构成数据列表
optional string currencyCode = 3; // 货币代码(ISO 4217)
repeated ScreenDate screenDateList = 4; // 可选日期列表,供客户端筛选历史数据,仅 date 与 financialType 都不填时返回
}
message Response
{
required int32 retType = 1 [default = -400]; // 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
32
33
34
35
36
37
38
- 接口调用结果,结构参见 RetType
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
协议 ID
3228
uint GetFinancialsRevenueBreakdown(QotGetFinancialsRevenueBreakdown.Request req);
virtual void OnReply_GetFinancialsRevenueBreakdown(FTAPI_Conn client, uint nSerialNo, QotGetFinancialsRevenueBreakdown.Response rsp);
介绍
获取主营构成
参数
message C2S
{
required Qot_Common.Security security = 1; // 股票
optional uint32 date = 2; // 筛选时间戳
optional Qot_Common.F10Type financialType = 3; // 财报类型
optional string currencyCode = 4; // 币种代码(ISO 4217)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
- 股票结构参见 Security
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 返回
// 主营构成项
message MainIncomeItem
{
optional string name = 1; // 名称
optional double mainOperIncome = 2; // 营业收入
optional double ratio = 3; // 占比,百分号前的值,如 12.34 表示 12.34%
}
// 单一维度主营构成数据
message RevenueBreakdownGroup
{
optional Qot_Common.RevenueBreakdownType type = 1; // 维度类型(详见 Qot_Common.RevenueBreakdownType 定义)
repeated MainIncomeItem itemList = 2; // 该维度主营构成数据列表
}
// 筛选日期
message ScreenDate
{
optional uint32 date = 1; // 筛选时间戳(Unix 时间戳(秒),下次请求原样传入)
optional string periodText = 2; // 财报周期,如 "2024/Q3"、"2024/FY"
optional Qot_Common.F10Type financialType = 3; // 财报类型(详见 Qot_Common.F10Type 定义)
}
message S2C
{
optional string period = 1; // 财报周期,如 "2024/Q3"、"2024/FY"
repeated RevenueBreakdownGroup breakdownList = 2; // 各维度主营构成数据列表
optional string currencyCode = 3; // 货币代码(ISO 4217)
repeated ScreenDate screenDateList = 4; // 可选日期列表,供客户端筛选历史数据,仅 date 与 financialType 都不填时返回
}
message Response
{
required int32 retType = 1 [default = -400]; // 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
32
33
34
35
36
37
38
- 接口调用结果,结构参见 RetType
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 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();
QotGetFinancialsRevenueBreakdown.C2S c2s = QotGetFinancialsRevenueBreakdown.C2S.CreateBuilder()
.SetSecurity(sec)
.Build();
QotGetFinancialsRevenueBreakdown.Request req = QotGetFinancialsRevenueBreakdown.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetFinancialsRevenueBreakdown(req);
Console.Write("Send QotGetFinancialsRevenueBreakdown: {0}\n", seqNo);
}
public void OnDisconnect(FTAPI_Conn client, long errCode)
{
Console.Write("Qot onDisConnect: {0}\n", errCode);
}
public void OnReply_GetFinancialsRevenueBreakdown(FTAPI_Conn client, uint nSerialNo, QotGetFinancialsRevenueBreakdown.Response rsp)
{
Console.Write("Reply: QotGetFinancialsRevenueBreakdown: {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 {
period: "2025/FY"
breakdownList {
type: RevenueBreakdownType_Product
itemList {
name: "增值服务"
mainOperIncome: 369281000000
ratio: 49.1218
}
itemList {
//...
}
}
breakdownList {
//...
}
currencyCode: "CNY"
screenDateList {
date: 1767110400
periodText: "2025/FY"
financialType: F10Type_Annual
}
screenDateList {
//...
}
}
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
int getFinancialsRevenueBreakdown(QotGetFinancialsRevenueBreakdown.Request req);
void onReply_GetFinancialsRevenueBreakdown(FTAPI_Conn client, int nSerialNo, QotGetFinancialsRevenueBreakdown.Response rsp);
介绍
获取主营构成
参数
message C2S
{
required Qot_Common.Security security = 1; // 股票
optional uint32 date = 2; // 筛选时间戳
optional Qot_Common.F10Type financialType = 3; // 财报类型
optional string currencyCode = 4; // 币种代码(ISO 4217)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
- 股票结构参见 Security
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 返回
// 主营构成项
message MainIncomeItem
{
optional string name = 1; // 名称
optional double mainOperIncome = 2; // 营业收入
optional double ratio = 3; // 占比,百分号前的值,如 12.34 表示 12.34%
}
// 单一维度主营构成数据
message RevenueBreakdownGroup
{
optional Qot_Common.RevenueBreakdownType type = 1; // 维度类型(详见 Qot_Common.RevenueBreakdownType 定义)
repeated MainIncomeItem itemList = 2; // 该维度主营构成数据列表
}
// 筛选日期
message ScreenDate
{
optional uint32 date = 1; // 筛选时间戳(Unix 时间戳(秒),下次请求原样传入)
optional string periodText = 2; // 财报周期,如 "2024/Q3"、"2024/FY"
optional Qot_Common.F10Type financialType = 3; // 财报类型(详见 Qot_Common.F10Type 定义)
}
message S2C
{
optional string period = 1; // 财报周期,如 "2024/Q3"、"2024/FY"
repeated RevenueBreakdownGroup breakdownList = 2; // 各维度主营构成数据列表
optional string currencyCode = 3; // 货币代码(ISO 4217)
repeated ScreenDate screenDateList = 4; // 可选日期列表,供客户端筛选历史数据,仅 date 与 financialType 都不填时返回
}
message Response
{
required int32 retType = 1 [default = -400]; // 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
32
33
34
35
36
37
38
- 接口调用结果,结构参见 RetType
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 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();
QotGetFinancialsRevenueBreakdown.C2S c2s = QotGetFinancialsRevenueBreakdown.C2S.newBuilder()
.setSecurity(sec)
.build();
QotGetFinancialsRevenueBreakdown.Request req = QotGetFinancialsRevenueBreakdown.Request.newBuilder().setC2S(c2s).build();
int seqNo = qot.getFinancialsRevenueBreakdown(req);
System.out.printf("Send QotGetFinancialsRevenueBreakdown: %d\n", seqNo);
}
@Override
public void onDisconnect(FTAPI_Conn client, long errCode) {
System.out.printf("Qot onDisConnect: %d\n", errCode);
}
@Override
public void onReply_GetFinancialsRevenueBreakdown(FTAPI_Conn client, int nSerialNo, QotGetFinancialsRevenueBreakdown.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("QotGetFinancialsRevenueBreakdown failed: %s\n", rsp.getRetMsg());
}
else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive QotGetFinancialsRevenueBreakdown: %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=7459213515489724279
Send Qot_GetFinancialsRevenueBreakdown: 2
Receive Qot_GetFinancialsRevenueBreakdown: retType: 0
retMsg: ""
errCode: 0
s2c {
period: "2025/FY"
breakdownList {
type: RevenueBreakdownType_Product
itemList {
name: "增值服务"
mainOperIncome: 3.69281E11
ratio: 49.1218
}
itemList {
//...
}
}
breakdownList {
//...
}
currencyCode: "CNY"
screenDateList {
date: 1767110400
periodText: "2025/FY"
financialType: F10Type_Annual
}
screenDateList {
//...
}
}
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
Futu::u32_t GetFinancialsRevenueBreakdown(const Qot_GetFinancialsRevenueBreakdown::Request &stReq);
virtual void OnReply_GetFinancialsRevenueBreakdown(Futu::u32_t nSerialNo, const Qot_GetFinancialsRevenueBreakdown::Response &stRsp) = 0;
介绍
获取主营构成
参数
message C2S
{
required Qot_Common.Security security = 1; // 股票
optional uint32 date = 2; // 筛选时间戳
optional Qot_Common.F10Type financialType = 3; // 财报类型
optional string currencyCode = 4; // 币种代码(ISO 4217)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
- 股票结构参见 Security
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 返回
// 主营构成项
message MainIncomeItem
{
optional string name = 1; // 名称
optional double mainOperIncome = 2; // 营业收入
optional double ratio = 3; // 占比,百分号前的值,如 12.34 表示 12.34%
}
// 单一维度主营构成数据
message RevenueBreakdownGroup
{
optional Qot_Common.RevenueBreakdownType type = 1; // 维度类型(详见 Qot_Common.RevenueBreakdownType 定义)
repeated MainIncomeItem itemList = 2; // 该维度主营构成数据列表
}
// 筛选日期
message ScreenDate
{
optional uint32 date = 1; // 筛选时间戳(Unix 时间戳(秒),下次请求原样传入)
optional string periodText = 2; // 财报周期,如 "2024/Q3"、"2024/FY"
optional Qot_Common.F10Type financialType = 3; // 财报类型(详见 Qot_Common.F10Type 定义)
}
message S2C
{
optional string period = 1; // 财报周期,如 "2024/Q3"、"2024/FY"
repeated RevenueBreakdownGroup breakdownList = 2; // 各维度主营构成数据列表
optional string currencyCode = 3; // 货币代码(ISO 4217)
repeated ScreenDate screenDateList = 4; // 可选日期列表,供客户端筛选历史数据,仅 date 与 financialType 都不填时返回
}
message Response
{
required int32 retType = 1 [default = -400]; // 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
32
33
34
35
36
37
38
- 接口调用结果,结构参见 RetType
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 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_GetFinancialsRevenueBreakdown::Request req;
Qot_GetFinancialsRevenueBreakdown::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->GetFinancialsRevenueBreakdown(req);
cout << "GetFinancialsRevenueBreakdown" << endl;
}
virtual void OnReply_GetFinancialsRevenueBreakdown(Futu::u32_t nSerialNo, const Qot_GetFinancialsRevenueBreakdown::Response &stRsp){
cout << "OnReply_GetFinancialsRevenueBreakdown:" << 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_GetFinancialsRevenueBreakdown seqNo=3
retType: 0
retMsg: ""
errCode: 0
s2c {
period: "2025/FY"
breakdownList {
type: RevenueBreakdownType_Product
itemList {
name: "增值服务"
mainOperIncome: 369281000000
ratio: 49.1218
}
itemList {
//...
}
}
breakdownList {
//...
}
currencyCode: "CNY"
screenDateList {
date: 1767110400
periodText: "2025/FY"
financialType: F10Type_Annual
}
screenDateList {
//...
}
}
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
GetFinancialsRevenueBreakdown(req);
介绍
获取主营构成
参数
message C2S
{
required Qot_Common.Security security = 1; // 股票
optional uint32 date = 2; // 筛选时间戳
optional Qot_Common.F10Type financialType = 3; // 财报类型
optional string currencyCode = 4; // 币种代码(ISO 4217)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
- 股票结构参见 Security
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 返回
// 主营构成项
message MainIncomeItem
{
optional string name = 1; // 名称
optional double mainOperIncome = 2; // 营业收入
optional double ratio = 3; // 占比,百分号前的值,如 12.34 表示 12.34%
}
// 单一维度主营构成数据
message RevenueBreakdownGroup
{
optional Qot_Common.RevenueBreakdownType type = 1; // 维度类型(详见 Qot_Common.RevenueBreakdownType 定义)
repeated MainIncomeItem itemList = 2; // 该维度主营构成数据列表
}
// 筛选日期
message ScreenDate
{
optional uint32 date = 1; // 筛选时间戳(Unix 时间戳(秒),下次请求原样传入)
optional string periodText = 2; // 财报周期,如 "2024/Q3"、"2024/FY"
optional Qot_Common.F10Type financialType = 3; // 财报类型(详见 Qot_Common.F10Type 定义)
}
message S2C
{
optional string period = 1; // 财报周期,如 "2024/Q3"、"2024/FY"
repeated RevenueBreakdownGroup breakdownList = 2; // 各维度主营构成数据列表
optional string currencyCode = 3; // 货币代码(ISO 4217)
repeated ScreenDate screenDateList = 4; // 可选日期列表,供客户端筛选历史数据,仅 date 与 financialType 都不填时返回
}
message Response
{
required int32 retType = 1 [default = -400]; // 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
32
33
34
35
36
37
38
- 接口调用结果,结构参见 RetType
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- Example
import ftWebsocket from "futu-api";
import { Common, Qot_Common } from "futu-api/proto";
import beautify from "js-beautify";
function QotGetFinancialsRevenueBreakdown(){
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.GetFinancialsRevenueBreakdown(req)
.then((res) => {
let { errCode, retMsg, retType,s2c } = res
console.log("GetFinancialsRevenueBreakdown: 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
GetFinancialsRevenueBreakdown: errCode 0, retMsg , retType 0
{
"period": "2025/FY",
"breakdownList": [{
"type": "RevenueBreakdownType_Product",
"itemList": [{
"name": "增值服务",
"mainOperIncome": 369281000000,
"ratio": 49.1218
//...
}]
//...
}],
"currencyCode": "CNY",
"screenDateList": [{
"date": 1767110400,
"periodText": "2025/FY",
"financialType": "F10Type_Annual"
//...
}]
}
stop
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
接口限制
- 每 30 秒内最多请求 30 次。
- 支持正股及基金。
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_financials_revenue_breakdown(code, date=None, financial_type=None, currency_code=None)
介绍
获取指定股票的主营构成数据,支持产品、行业、地区、业务等多维度拆解
参数
参数 类型 说明 code str 股票代码 date int 筛选时间戳 秒;从返回的 screen_date_list 中取 date 值可查历史;不填或填 0 返回最新一期financial_type F10Type 财报类型 0=不限,1=Q1单季报,2=Q2单季报,3=Q3单季报,4=Q4单季报,5=半年报,6=Q9累计报,7=年报,9=聚合季报;默认 0=不限currency_code str 币种代码 ISO 4217,如 CNY、USD、HKD、SGD、JPY、CAD、AUD;不填返回原始货币数据返回
参数 类型 说明 ret RET_CODE 接口调用结果 data dict 当 ret == RET_OK,返回主营构成数据字典 str 当 ret != RET_OK,返回错误描述 返回字典包含以下字段:
字段 类型 说明 period str 财报周期 如 "2025/FY"、"2024/H1"breakdown_list list 各维度主营构成数据列表 每项含 type 和 item_listcurrency_code str 货币代码 ISO 4217screen_date_list list 可选历史日期列表 仅 date 与 financial_type 均未填时返回breakdown_list 每项包含的字段:
字段 类型 说明 type RevenueBreakdownType 维度类型 1=产品(Product),2=行业(Industry),4=地区(Region),8=业务(Business)item_list list 该维度主营构成列表 每项含 name、main_oper_income、ratioitem_list 每项包含的字段:
字段 类型 说明 name str 名称 main_oper_income float 营业收入 ratio float 占比 百分号前的值,如 12.34 表示 12.34%screen_date_list 每项包含的字段:
字段 类型 说明 date int 筛选时间戳 秒;回传型,须为此列表中某个 date 值period_text str 财报周期 如 "2025/FY"financial_type F10Type 财报类型
Example
from moomoo import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_financials_revenue_breakdown("HK.00700")
if ret == RET_OK:
print(data['period'])
print(data['breakdown_list'][0]['type'])
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
- Output
name main_oper_income ratio
0 增值服务 3.692810e+11 49.1218
1 金融科技及企业服务 2.294350e+11 30.5194
2 营销服务 1.449730e+11 19.2843
3 其他 8.077000e+09 1.0744
2
3
4
5
# Qot_GetFinancialsRevenueBreakdown.proto
介绍
获取主营构成
参数
message C2S
{
required Qot_Common.Security security = 1; // 股票
optional uint32 date = 2; // 筛选时间戳(Unix 时间戳(秒),0 或不填返回最新一期,回传型,须为 screenDateList 中某个 date 值)
optional Qot_Common.F10Type financialType = 3; // 财报类型,详见 Qot_Common.F10Type 定义,支持 0-7, 9,默认 0(Unknown)
optional string currencyCode = 4; // 币种代码(ISO 4217),如 CNY、USD、HKD、SGD、JPY、CAD、AUD;不填返回原始货币数据
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
- 股票结构参见 Security
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 返回
// 主营构成项
message MainIncomeItem
{
optional string name = 1; // 名称
optional double mainOperIncome = 2; // 营业收入
optional double ratio = 3; // 占比,百分号前的值,如 12.34 表示 12.34%
}
// 单一维度主营构成数据
message RevenueBreakdownGroup
{
optional Qot_Common.RevenueBreakdownType type = 1; // 维度类型(详见 Qot_Common.RevenueBreakdownType 定义)
repeated MainIncomeItem itemList = 2; // 该维度主营构成数据列表
}
// 筛选日期
message ScreenDate
{
optional uint32 date = 1; // 筛选时间戳(Unix 时间戳(秒),下次请求原样传入)
optional string periodText = 2; // 财报周期,如 "2024/Q3"、"2024/FY"
optional Qot_Common.F10Type financialType = 3; // 财报类型(详见 Qot_Common.F10Type 定义)
}
message S2C
{
optional string period = 1; // 财报周期,如 "2024/Q3"、"2024/FY"
repeated RevenueBreakdownGroup breakdownList = 2; // 各维度主营构成数据列表
optional string currencyCode = 3; // 货币代码(ISO 4217)
repeated ScreenDate screenDateList = 4; // 可选日期列表,供客户端筛选历史数据,仅 date 与 financialType 都不填时返回
}
message Response
{
required int32 retType = 1 [default = -400]; // 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
32
33
34
35
36
37
38
- 接口调用结果,结构参见 RetType
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
协议 ID
3228
uint GetFinancialsRevenueBreakdown(QotGetFinancialsRevenueBreakdown.Request req);
virtual void OnReply_GetFinancialsRevenueBreakdown(MMAPI_Conn client, uint nSerialNo, QotGetFinancialsRevenueBreakdown.Response rsp);
介绍
获取主营构成
参数
message C2S
{
required Qot_Common.Security security = 1; // 股票
optional uint32 date = 2; // 筛选时间戳
optional Qot_Common.F10Type financialType = 3; // 财报类型
optional string currencyCode = 4; // 币种代码(ISO 4217)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
- 股票结构参见 Security
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 返回
// 主营构成项
message MainIncomeItem
{
optional string name = 1; // 名称
optional double mainOperIncome = 2; // 营业收入
optional double ratio = 3; // 占比,百分号前的值,如 12.34 表示 12.34%
}
// 单一维度主营构成数据
message RevenueBreakdownGroup
{
optional Qot_Common.RevenueBreakdownType type = 1; // 维度类型(详见 Qot_Common.RevenueBreakdownType 定义)
repeated MainIncomeItem itemList = 2; // 该维度主营构成数据列表
}
// 筛选日期
message ScreenDate
{
optional uint32 date = 1; // 筛选时间戳(Unix 时间戳(秒),下次请求原样传入)
optional string periodText = 2; // 财报周期,如 "2024/Q3"、"2024/FY"
optional Qot_Common.F10Type financialType = 3; // 财报类型(详见 Qot_Common.F10Type 定义)
}
message S2C
{
optional string period = 1; // 财报周期,如 "2024/Q3"、"2024/FY"
repeated RevenueBreakdownGroup breakdownList = 2; // 各维度主营构成数据列表
optional string currencyCode = 3; // 货币代码(ISO 4217)
repeated ScreenDate screenDateList = 4; // 可选日期列表,供客户端筛选历史数据,仅 date 与 financialType 都不填时返回
}
message Response
{
required int32 retType = 1 [default = -400]; // 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
32
33
34
35
36
37
38
- 接口调用结果,结构参见 RetType
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 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();
QotGetFinancialsRevenueBreakdown.C2S c2s = QotGetFinancialsRevenueBreakdown.C2S.CreateBuilder()
.SetSecurity(sec)
.Build();
QotGetFinancialsRevenueBreakdown.Request req = QotGetFinancialsRevenueBreakdown.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetFinancialsRevenueBreakdown(req);
Console.Write("Send QotGetFinancialsRevenueBreakdown: {0}\n", seqNo);
}
public void OnDisconnect(MMAPI_Conn client, long errCode)
{
Console.Write("Qot onDisConnect: {0}\n", errCode);
}
public void OnReply_GetFinancialsRevenueBreakdown(MMAPI_Conn client, uint nSerialNo, QotGetFinancialsRevenueBreakdown.Response rsp)
{
Console.Write("Reply: QotGetFinancialsRevenueBreakdown: {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 {
period: "2025/FY"
breakdownList {
type: RevenueBreakdownType_Product
itemList {
name: "增值服务"
mainOperIncome: 369281000000
ratio: 49.1218
}
itemList {
//...
}
}
breakdownList {
//...
}
currencyCode: "CNY"
screenDateList {
date: 1767110400
periodText: "2025/FY"
financialType: F10Type_Annual
}
screenDateList {
//...
}
}
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
int getFinancialsRevenueBreakdown(QotGetFinancialsRevenueBreakdown.Request req);
void onReply_GetFinancialsRevenueBreakdown(MMAPI_Conn client, int nSerialNo, QotGetFinancialsRevenueBreakdown.Response rsp);
介绍
获取主营构成
参数
message C2S
{
required Qot_Common.Security security = 1; // 股票
optional uint32 date = 2; // 筛选时间戳
optional Qot_Common.F10Type financialType = 3; // 财报类型
optional string currencyCode = 4; // 币种代码(ISO 4217)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
- 股票结构参见 Security
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 返回
// 主营构成项
message MainIncomeItem
{
optional string name = 1; // 名称
optional double mainOperIncome = 2; // 营业收入
optional double ratio = 3; // 占比,百分号前的值,如 12.34 表示 12.34%
}
// 单一维度主营构成数据
message RevenueBreakdownGroup
{
optional Qot_Common.RevenueBreakdownType type = 1; // 维度类型(详见 Qot_Common.RevenueBreakdownType 定义)
repeated MainIncomeItem itemList = 2; // 该维度主营构成数据列表
}
// 筛选日期
message ScreenDate
{
optional uint32 date = 1; // 筛选时间戳(Unix 时间戳(秒),下次请求原样传入)
optional string periodText = 2; // 财报周期,如 "2024/Q3"、"2024/FY"
optional Qot_Common.F10Type financialType = 3; // 财报类型(详见 Qot_Common.F10Type 定义)
}
message S2C
{
optional string period = 1; // 财报周期,如 "2024/Q3"、"2024/FY"
repeated RevenueBreakdownGroup breakdownList = 2; // 各维度主营构成数据列表
optional string currencyCode = 3; // 货币代码(ISO 4217)
repeated ScreenDate screenDateList = 4; // 可选日期列表,供客户端筛选历史数据,仅 date 与 financialType 都不填时返回
}
message Response
{
required int32 retType = 1 [default = -400]; // 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
32
33
34
35
36
37
38
- 接口调用结果,结构参见 RetType
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 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();
QotGetFinancialsRevenueBreakdown.C2S c2s = QotGetFinancialsRevenueBreakdown.C2S.newBuilder()
.setSecurity(sec)
.build();
QotGetFinancialsRevenueBreakdown.Request req = QotGetFinancialsRevenueBreakdown.Request.newBuilder().setC2S(c2s).build();
int seqNo = qot.getFinancialsRevenueBreakdown(req);
System.out.printf("Send QotGetFinancialsRevenueBreakdown: %d\n", seqNo);
}
@Override
public void onDisconnect(MMAPI_Conn client, long errCode) {
System.out.printf("Qot onDisConnect: %d\n", errCode);
}
@Override
public void onReply_GetFinancialsRevenueBreakdown(MMAPI_Conn client, int nSerialNo, QotGetFinancialsRevenueBreakdown.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("QotGetFinancialsRevenueBreakdown failed: %s\n", rsp.getRetMsg());
}
else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive QotGetFinancialsRevenueBreakdown: %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=7459213515489724279
Send Qot_GetFinancialsRevenueBreakdown: 2
Receive Qot_GetFinancialsRevenueBreakdown: retType: 0
retMsg: ""
errCode: 0
s2c {
period: "2025/FY"
breakdownList {
type: RevenueBreakdownType_Product
itemList {
name: "增值服务"
mainOperIncome: 3.69281E11
ratio: 49.1218
}
itemList {
//...
}
}
breakdownList {
//...
}
currencyCode: "CNY"
screenDateList {
date: 1767110400
periodText: "2025/FY"
financialType: F10Type_Annual
}
screenDateList {
//...
}
}
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
moomoo::u32_t GetFinancialsRevenueBreakdown(const Qot_GetFinancialsRevenueBreakdown::Request &stReq);
virtual void OnReply_GetFinancialsRevenueBreakdown(moomoo::u32_t nSerialNo, const Qot_GetFinancialsRevenueBreakdown::Response &stRsp) = 0;
介绍
获取主营构成
参数
message C2S
{
required Qot_Common.Security security = 1; // 股票
optional uint32 date = 2; // 筛选时间戳
optional Qot_Common.F10Type financialType = 3; // 财报类型
optional string currencyCode = 4; // 币种代码(ISO 4217)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
- 股票结构参见 Security
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 返回
// 主营构成项
message MainIncomeItem
{
optional string name = 1; // 名称
optional double mainOperIncome = 2; // 营业收入
optional double ratio = 3; // 占比,百分号前的值,如 12.34 表示 12.34%
}
// 单一维度主营构成数据
message RevenueBreakdownGroup
{
optional Qot_Common.RevenueBreakdownType type = 1; // 维度类型(详见 Qot_Common.RevenueBreakdownType 定义)
repeated MainIncomeItem itemList = 2; // 该维度主营构成数据列表
}
// 筛选日期
message ScreenDate
{
optional uint32 date = 1; // 筛选时间戳(Unix 时间戳(秒),下次请求原样传入)
optional string periodText = 2; // 财报周期,如 "2024/Q3"、"2024/FY"
optional Qot_Common.F10Type financialType = 3; // 财报类型(详见 Qot_Common.F10Type 定义)
}
message S2C
{
optional string period = 1; // 财报周期,如 "2024/Q3"、"2024/FY"
repeated RevenueBreakdownGroup breakdownList = 2; // 各维度主营构成数据列表
optional string currencyCode = 3; // 货币代码(ISO 4217)
repeated ScreenDate screenDateList = 4; // 可选日期列表,供客户端筛选历史数据,仅 date 与 financialType 都不填时返回
}
message Response
{
required int32 retType = 1 [default = -400]; // 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
32
33
34
35
36
37
38
- 接口调用结果,结构参见 RetType
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 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_GetFinancialsRevenueBreakdown::Request req;
Qot_GetFinancialsRevenueBreakdown::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->GetFinancialsRevenueBreakdown(req);
cout << "GetFinancialsRevenueBreakdown" << endl;
}
virtual void OnReply_GetFinancialsRevenueBreakdown(moomoo::u32_t nSerialNo, const Qot_GetFinancialsRevenueBreakdown::Response &stRsp){
cout << "OnReply_GetFinancialsRevenueBreakdown:" << 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_GetFinancialsRevenueBreakdown seqNo=3
retType: 0
retMsg: ""
errCode: 0
s2c {
period: "2025/FY"
breakdownList {
type: RevenueBreakdownType_Product
itemList {
name: "增值服务"
mainOperIncome: 369281000000
ratio: 49.1218
}
itemList {
//...
}
}
breakdownList {
//...
}
currencyCode: "CNY"
screenDateList {
date: 1767110400
periodText: "2025/FY"
financialType: F10Type_Annual
}
screenDateList {
//...
}
}
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
GetFinancialsRevenueBreakdown(req);
介绍
获取主营构成
参数
message C2S
{
required Qot_Common.Security security = 1; // 股票
optional uint32 date = 2; // 筛选时间戳
optional Qot_Common.F10Type financialType = 3; // 财报类型
optional string currencyCode = 4; // 币种代码(ISO 4217)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
- 股票结构参见 Security
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- 返回
// 主营构成项
message MainIncomeItem
{
optional string name = 1; // 名称
optional double mainOperIncome = 2; // 营业收入
optional double ratio = 3; // 占比,百分号前的值,如 12.34 表示 12.34%
}
// 单一维度主营构成数据
message RevenueBreakdownGroup
{
optional Qot_Common.RevenueBreakdownType type = 1; // 维度类型(详见 Qot_Common.RevenueBreakdownType 定义)
repeated MainIncomeItem itemList = 2; // 该维度主营构成数据列表
}
// 筛选日期
message ScreenDate
{
optional uint32 date = 1; // 筛选时间戳(Unix 时间戳(秒),下次请求原样传入)
optional string periodText = 2; // 财报周期,如 "2024/Q3"、"2024/FY"
optional Qot_Common.F10Type financialType = 3; // 财报类型(详见 Qot_Common.F10Type 定义)
}
message S2C
{
optional string period = 1; // 财报周期,如 "2024/Q3"、"2024/FY"
repeated RevenueBreakdownGroup breakdownList = 2; // 各维度主营构成数据列表
optional string currencyCode = 3; // 货币代码(ISO 4217)
repeated ScreenDate screenDateList = 4; // 可选日期列表,供客户端筛选历史数据,仅 date 与 financialType 都不填时返回
}
message Response
{
required int32 retType = 1 [default = -400]; // 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
32
33
34
35
36
37
38
- 接口调用结果,结构参见 RetType
- 财报类型参见 F10Type
- 主营构成维度类型参见 RevenueBreakdownType
- Example
import mmWebsocket from "moomoo-api";
import { Common, Qot_Common } from "moomoo-api/proto";
import beautify from "js-beautify";
function QotGetFinancialsRevenueBreakdown(){
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.GetFinancialsRevenueBreakdown(req)
.then((res) => {
let { errCode, retMsg, retType,s2c } = res
console.log("GetFinancialsRevenueBreakdown: 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
GetFinancialsRevenueBreakdown: errCode 0, retMsg , retType 0
{
"period": "2025/FY",
"breakdownList": [{
"type": "RevenueBreakdownType_Product",
"itemList": [{
"name": "增值服务",
"mainOperIncome": 369281000000,
"ratio": 49.1218
//...
}]
//...
}],
"currencyCode": "CNY",
"screenDateList": [{
"date": 1767110400,
"periodText": "2025/FY",
"financialType": "F10Type_Annual"
//...
}]
}
stop
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
接口限制
- 每 30 秒内最多请求 30 次。
- 支持正股及基金。