# Get Company Operational Efficiency
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_company_operational_efficiency(code, num=10, next_key=None, currency_code=None, financial_type=0)
Description
Get company operational efficiency data for the specified stock, including employee count, revenue per capita, operating profit per capita, and net profit per capita.
Parameters
Parameter Type Description code str Stock code e.g. HK.00700; supports equities and fundsnum int Number of records per page Default 10, range 1~50next_key str Pagination key Leave empty for the first request; pass the next_key from the previous response to fetch more; "-1" means no more datacurrency_code str Currency code ISO 4217, e.g. CNY, USD, HKD, SGD, JPY, CAD, AUD; returns default currency if not specifiedfinancial_type F10Type Financial report period supports 0-7, default 0 (no filter)F10Type Enum
Value Description 0 No filter 1 Q1 (First quarter) 2 Q2 (Second quarter) 3 Q3 (Third quarter) 4 Q4 (Fourth quarter) 5 Q6 (Semi-annual) 6 Q9 (Three-quarter) 7 Annual Return
Parameter Type Description ret RET_CODE API call result data dict When ret == RET_OK, returns operational efficiency data dict str When ret != RET_OK, returns error description Return dict fields:
Field Type Description item_list list Operational efficiency list; each item is a dict, fields shown below next_key str Pagination key "-1" means no more datacurrency_code str Currency code ISO 4217item_list sub-item fields:
Field Type Description fiscal_year int Fiscal year e.g. 2024financial_type F10Type Financial report type period_text str Report period e.g. "2024/Q3", "2024/FY"end_date int Period end timestamp Unix timestamp in secondsend_date_str str Period end date string Format YYYY-MM-DD, in the market's timezoneemployee_num int Number of employees employee_num_yoy float YoY change in employee count Value before %; e.g. 12.34 means 12.34%income_per_capita float Revenue per capita income_per_capita_yoy float YoY change in revenue per capita Value before %; e.g. 12.34 means 12.34%profit_per_capita float Operating profit per capita profit_per_capita_yoy float YoY change in operating profit per capita Value before %; e.g. 12.34 means 12.34%net_profit_per_capita float Net profit per capita net_profit_per_capita_yoy float YoY change in net profit per capita Value before %; e.g. 12.34 means 12.34%
Example
from futu import *
import pandas as pd
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_company_operational_efficiency("HK.00700")
if ret == RET_OK:
df = pd.DataFrame(data.get('item_list', []))
print(df.to_string(index=False))
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
- Output
fiscal_year period_text end_date end_date_str employee_num employee_num_yoy income_per_capita income_per_capita_yoy profit_per_capita profit_per_capita_yoy net_profit_per_capita net_profit_per_capita_yoy
2025 2025/FY 1767110400 2025-12-31 115849 4.7857 6489188.5126 8.6594 2085145.3184 10.7787 1983625.2362 11.6246
2024 2024/FY 1735574400 2024-12-31 110558 4.8768 5972041.8242 3.3726 1882260.8947 23.9566 1777049.1506 58.6906
2023 2023/FY 1703952000 2023-12-31 105417 -2.7841 5777199.1234 12.9662 1518483.7360 48.5723 1119819.3839 -35.6529
2022 2022/FY 1672416000 2022-12-31 108436 -3.8440 5114094.9500 2.9643 1022049.8727 -57.5666 1740279.9808 -13.8522
2021 2021/FY 1640880000 2021-12-31 112771 31.3459 4966862.0478 -11.5377 2408597.9551 12.2453 2020111.5535 8.3170
2020 2020/FY 1609344000 2020-12-31 85858 36.5317 5614666.0765 -6.4170 2145833.8186 13.6879 1864998.0199 22.3097
2019 2019/FY 1577721600 2019-12-31 62885 15.7911 5999666.0570 4.2027 1887477.1408 4.9760 1524815.1387 3.5346
2018 2018/FY 1546185600 2018-12-31 54309 21.2362 5757682.8886 8.4796 1798007.6966 -10.8064 1472757.7381 -8.9654
2017 2017/FY 1514649600 2017-12-31 44796 15.5280 5307616.7514 35.4518 2015849.6294 39.2885 1617800.6964 51.3504
2016 2016/FY 1483113600 2016-12-31 38775 26.5461 3918452.6112 16.7235 1447246.9374 9.1517 1068910.3803 12.5205
2
3
4
5
6
7
8
9
10
11
# Qot_GetCompanyOperationalEfficiency.proto
Description
Get Company Operational Efficiency
Parameters
message C2S
{
required Qot_Common.Security security = 1; // Stock
optional string nextKey = 2; // Pagination key; leave empty for first request; pass the value from previous response; "-1" means no more data
optional int32 num = 3; // Number of records per page, default 10, range 1~50
optional string currencyCode = 4; // Currency code (ISO 4217), e.g. CNY, USD, HKD, SGD, JPY, CAD, AUD; returns default currency if not specified
optional Qot_Common.F10Type financialType = 5; // Financial report period filter, supports 0-7, default 0 (no filter)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Return
// Operational efficiency data item
message OperationalEfficiencyItem
{
optional int32 fiscalYear = 1; // Fiscal year, e.g. 2024
optional Qot_Common.F10Type financialType = 2; // Financial report type
optional string periodText = 3; // Report period, e.g. "2024/Q3", "2024/FY"
optional int64 endDate = 4; // Period end timestamp (seconds)
optional string endDateStr = 5; // Period end date string, format YYYY-MM-DD
optional int64 employeeNum = 6; // Number of employees
optional double employeeNumYoy = 7; // YoY change in employee count, value before %
optional double incomePerCapita = 8; // Revenue per capita
optional double incomePerCapitaYoy = 9; // YoY change in revenue per capita, value before %
optional double profitPerCapita = 10; // Operating profit per capita
optional double profitPerCapitaYoy = 11; // YoY change in operating profit per capita, value before %
optional double netProfitPerCapita = 12; // Net profit per capita
optional double netProfitPerCapitaYoy = 13; // YoY change in net profit per capita, value before %
}
message S2C
{
repeated OperationalEfficiencyItem itemList = 1; // Operational efficiency data list
optional string nextKey = 2; // Pagination key, "-1" means no more data
optional string currencyCode = 3; // Currency code (ISO 4217)
}
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
32
Protocol ID
3246
uint GetCompanyOperationalEfficiency(QotGetCompanyOperationalEfficiency.Request req);
virtual void OnReply_GetCompanyOperationalEfficiency(MMAPI_Conn client, uint nSerialNo, QotGetCompanyOperationalEfficiency.Response rsp);
Description
Get Company Operational Efficiency
Parameters
message C2S
{
required Qot_Common.Security security = 1; // Stock
optional string nextKey = 2; // Pagination key; leave empty for first request; pass the value from previous response; "-1" means no more data
optional int32 num = 3; // Number of records per page, default 10, range 1~50
optional string currencyCode = 4; // Currency code (ISO 4217), e.g. CNY, USD, HKD, SGD, JPY, CAD, AUD; returns default currency if not specified
optional Qot_Common.F10Type financialType = 5; // Financial report period filter, supports 0-7, default 0 (no filter)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security structure: refer to Security
- Return
message S2C
{
repeated OperationalEfficiencyItem itemList = 1; // Operational efficiency data list
optional string nextKey = 2; // Pagination key, "-1" means no more data
optional string currencyCode = 3; // Currency code (ISO 4217)
}
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
- 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();
QotGetCompanyOperationalEfficiency.C2S c2s = QotGetCompanyOperationalEfficiency.C2S.CreateBuilder()
.SetSecurity(sec)
.Build();
QotGetCompanyOperationalEfficiency.Request req = QotGetCompanyOperationalEfficiency.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetCompanyOperationalEfficiency(req);
Console.Write("Send QotGetCompanyOperationalEfficiency: {0}\n", seqNo);
}
public void OnDisconnect(FTAPI_Conn client, long errCode)
{
Console.Write("Qot onDisConnect: {0}\n", errCode);
}
public void OnReply_GetCompanyOperationalEfficiency(FTAPI_Conn client, uint nSerialNo, QotGetCompanyOperationalEfficiency.Response rsp)
{
Console.Write("Reply: QotGetCompanyOperationalEfficiency: {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 {
itemList {
fiscalYear: 2025
financialType: F10Type_Annual
periodText: "2025/FY"
endDate: 1767110400
endDateStr: "2025-12-31"
employeeNum: 115849
employeeNumYoy: 4.7857
incomePerCapita: 6489188.5126
incomePerCapitaYoy: 8.6594
profitPerCapita: 2085145.3184
profitPerCapitaYoy: 10.7787
netProfitPerCapita: 1983625.2362
netProfitPerCapitaYoy: 11.6246
}
itemList {
//...
}
nextKey: "1483113600"
currencyCode: "CNY"
}
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 getCompanyOperationalEfficiency(QotGetCompanyOperationalEfficiency.Request req);
void onReply_GetCompanyOperationalEfficiency(MMAPI_Conn client, int nSerialNo, QotGetCompanyOperationalEfficiency.Response rsp);
Description
Get Company Operational Efficiency
Parameters
message C2S
{
required Qot_Common.Security security = 1; // Stock
optional string nextKey = 2; // Pagination key; leave empty for first request; pass the value from previous response; "-1" means no more data
optional int32 num = 3; // Number of records per page, default 10, range 1~50
optional string currencyCode = 4; // Currency code (ISO 4217), e.g. CNY, USD, HKD, SGD, JPY, CAD, AUD; returns default currency if not specified
optional Qot_Common.F10Type financialType = 5; // Financial report period filter, supports 0-7, default 0 (no filter)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security structure: refer to Security
- Return
message S2C
{
repeated OperationalEfficiencyItem itemList = 1; // Operational efficiency data list
optional string nextKey = 2; // Pagination key, "-1" means no more data
optional string currencyCode = 3; // Currency code (ISO 4217)
}
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
- 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();
QotGetCompanyOperationalEfficiency.C2S c2s = QotGetCompanyOperationalEfficiency.C2S.newBuilder()
.setSecurity(sec)
.build();
QotGetCompanyOperationalEfficiency.Request req = QotGetCompanyOperationalEfficiency.Request.newBuilder().setC2S(c2s).build();
int seqNo = qot.getCompanyOperationalEfficiency(req);
System.out.printf("Send QotGetCompanyOperationalEfficiency: %d\n", seqNo);
}
@Override
public void onDisconnect(FTAPI_Conn client, long errCode) {
System.out.printf("Qot onDisConnect: %d\n", errCode);
}
@Override
public void onReply_GetCompanyOperationalEfficiency(FTAPI_Conn client, int nSerialNo, QotGetCompanyOperationalEfficiency.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("QotGetCompanyOperationalEfficiency failed: %s\n", rsp.getRetMsg());
}
else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive QotGetCompanyOperationalEfficiency: %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=7459212697646186649
Send Qot_GetCompanyOperationalEfficiency: 2
Receive Qot_GetCompanyOperationalEfficiency: retType: 0
retMsg: ""
errCode: 0
s2c {
itemList {
fiscalYear: 2025
financialType: F10Type_Annual
periodText: "2025/FY"
endDate: 1767110400
endDateStr: "2025-12-31"
employeeNum: 115849
employeeNumYoy: 4.7857
incomePerCapita: 6489188.5126
incomePerCapitaYoy: 8.6594
profitPerCapita: 2085145.3184
profitPerCapitaYoy: 10.7787
netProfitPerCapita: 1983625.2362
netProfitPerCapitaYoy: 11.6246
}
itemList {
//...
}
nextKey: "1483113600"
currencyCode: "CNY"
}
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 GetCompanyOperationalEfficiency(const Qot_GetCompanyOperationalEfficiency::Request &stReq);
virtual void OnReply_GetCompanyOperationalEfficiency(moomoo::u32_t nSerialNo, const Qot_GetCompanyOperationalEfficiency::Response &stRsp) = 0;
Description
Get Company Operational Efficiency
Parameters
message C2S
{
required Qot_Common.Security security = 1; // Stock
optional string nextKey = 2; // Pagination key; leave empty for first request; pass the value from previous response; "-1" means no more data
optional int32 num = 3; // Number of records per page, default 10, range 1~50
optional string currencyCode = 4; // Currency code (ISO 4217), e.g. CNY, USD, HKD, SGD, JPY, CAD, AUD; returns default currency if not specified
optional Qot_Common.F10Type financialType = 5; // Financial report period filter, supports 0-7, default 0 (no filter)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security structure: refer to Security
- Return
message S2C
{
repeated OperationalEfficiencyItem itemList = 1; // Operational efficiency data list
optional string nextKey = 2; // Pagination key, "-1" means no more data
optional string currencyCode = 3; // Currency code (ISO 4217)
}
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
- 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_GetCompanyOperationalEfficiency::Request req;
Qot_GetCompanyOperationalEfficiency::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->GetCompanyOperationalEfficiency(req);
cout << "GetCompanyOperationalEfficiency" << endl;
}
virtual void OnReply_GetCompanyOperationalEfficiency(Futu::u32_t nSerialNo, const Qot_GetCompanyOperationalEfficiency::Response &stRsp){
cout << "OnReply_GetCompanyOperationalEfficiency:" << 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_GetCompanyOperationalEfficiency seqNo=3
retType: 0
retMsg: ""
errCode: 0
s2c {
itemList {
fiscalYear: 2025
financialType: F10Type_Annual
periodText: "2025/FY"
endDate: 1767110400
endDateStr: "2025-12-31"
employeeNum: 115849
employeeNumYoy: 4.7857
incomePerCapita: 6489188.5126
incomePerCapitaYoy: 8.6594
profitPerCapita: 2085145.3184
profitPerCapitaYoy: 10.7787
netProfitPerCapita: 1983625.2362
netProfitPerCapitaYoy: 11.6246
}
itemList {
//...
}
nextKey: "1483113600"
currencyCode: "CNY"
}
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
GetCompanyOperationalEfficiency(req);
Description
Get Company Operational Efficiency
Parameters
message C2S
{
required Qot_Common.Security security = 1; // Stock
optional string nextKey = 2; // Pagination key; leave empty for first request; pass the value from previous response; "-1" means no more data
optional int32 num = 3; // Number of records per page, default 10, range 1~50
optional string currencyCode = 4; // Currency code (ISO 4217), e.g. CNY, USD, HKD, SGD, JPY, CAD, AUD; returns default currency if not specified
optional Qot_Common.F10Type financialType = 5; // Financial report period filter, supports 0-7, default 0 (no filter)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security structure: refer to Security
- Return
message S2C
{
repeated OperationalEfficiencyItem itemList = 1; // Operational efficiency data list
optional string nextKey = 2; // Pagination key, "-1" means no more data
optional string currencyCode = 3; // Currency code (ISO 4217)
}
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
- Example
import ftWebsocket from "futu-api";
import { Common, Qot_Common } from "futu-api/proto";
import beautify from "js-beautify";
function QotGetCompanyOperationalEfficiency(){
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.GetCompanyOperationalEfficiency(req)
.then((res) => {
let { errCode, retMsg, retType,s2c } = res
console.log("GetCompanyOperationalEfficiency: 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
GetCompanyOperationalEfficiency: errCode 0, retMsg , retType 0
{
"itemList": [{
"fiscalYear": 2025,
"financialType": "F10Type_Annual",
"periodText": "2025/FY",
"endDate": "1767110400",
"endDateStr": "2025-12-31",
"employeeNum": "115849",
"employeeNumYoy": 4.7857,
"incomePerCapita": 6489188.5126,
"incomePerCapitaYoy": 8.6594,
"profitPerCapita": 2085145.3184,
"profitPerCapitaYoy": 10.7787,
"netProfitPerCapita": 1983625.2362,
"netProfitPerCapitaYoy": 11.6246
//...
}],
"nextKey": "1483113600",
"currencyCode": "CNY"
}
stop
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Restrictions
- Maximum 30 requests per 30 seconds.
- Supports equities and funds.
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_company_operational_efficiency(code, num=None, next_key=None, currency_code=None)
Description
Get company operational efficiency data for the specified stock, including employee count, revenue per capita, operating profit per capita, and net profit per capita.
Parameters
Parameter Type Description code str Stock code e.g. HK.00700; supports equities and fundsnum int Number of records per page Default 10, range 1~50next_key str Pagination key Leave empty for the first request; pass the next_key from the previous response to fetch more; "-1" means no more datacurrency_code str Currency code ISO 4217, e.g. CNY, USD, HKD, SGD, JPY, CAD, AUD; returns default currency if not specifiedReturn
Parameter Type Description ret RET_CODE API call result data dict When ret == RET_OK, returns operational efficiency data dict str When ret != RET_OK, returns error description Return dict fields:
Field Type Description item_list list Operational efficiency list; each item is a dict, fields shown below next_key str Pagination key "-1" means no more datacurrency_code str Currency code ISO 4217item_list sub-item fields:
Field Type Description fiscal_year int Fiscal year e.g. 2024financial_type F10Type Financial report type period_text str Report period e.g. "2024/Q3", "2024/FY"end_date int Period end timestamp Unix timestamp in secondsend_date_str str Period end date string Format YYYY-MM-DD, in the market's timezoneemployee_num int Number of employees employee_num_yoy float YoY change in employee count Value before %; e.g. 12.34 means 12.34%income_per_capita float Revenue per capita income_per_capita_yoy float YoY change in revenue per capita Value before %; e.g. 12.34 means 12.34%profit_per_capita float Operating profit per capita profit_per_capita_yoy float YoY change in operating profit per capita Value before %; e.g. 12.34 means 12.34%net_profit_per_capita float Net profit per capita net_profit_per_capita_yoy float YoY change in net profit per capita Value before %; e.g. 12.34 means 12.34%
Example
from moomoo import *
import pandas as pd
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_company_operational_efficiency("HK.00700")
if ret == RET_OK:
df = pd.DataFrame(data.get('item_list', []))
print(df.to_string(index=False))
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
- Output
fiscal_year period_text end_date end_date_str employee_num employee_num_yoy income_per_capita income_per_capita_yoy profit_per_capita profit_per_capita_yoy net_profit_per_capita net_profit_per_capita_yoy
2025 2025/FY 1767110400 2025-12-31 115849 4.7857 6489188.5126 8.6594 2085145.3184 10.7787 1983625.2362 11.6246
2024 2024/FY 1735574400 2024-12-31 110558 4.8768 5972041.8242 3.3726 1882260.8947 23.9566 1777049.1506 58.6906
2023 2023/FY 1703952000 2023-12-31 105417 -2.7841 5777199.1234 12.9662 1518483.7360 48.5723 1119819.3839 -35.6529
2022 2022/FY 1672416000 2022-12-31 108436 -3.8440 5114094.9500 2.9643 1022049.8727 -57.5666 1740279.9808 -13.8522
2021 2021/FY 1640880000 2021-12-31 112771 31.3459 4966862.0478 -11.5377 2408597.9551 12.2453 2020111.5535 8.3170
2020 2020/FY 1609344000 2020-12-31 85858 36.5317 5614666.0765 -6.4170 2145833.8186 13.6879 1864998.0199 22.3097
2019 2019/FY 1577721600 2019-12-31 62885 15.7911 5999666.0570 4.2027 1887477.1408 4.9760 1524815.1387 3.5346
2018 2018/FY 1546185600 2018-12-31 54309 21.2362 5757682.8886 8.4796 1798007.6966 -10.8064 1472757.7381 -8.9654
2017 2017/FY 1514649600 2017-12-31 44796 15.5280 5307616.7514 35.4518 2015849.6294 39.2885 1617800.6964 51.3504
2016 2016/FY 1483113600 2016-12-31 38775 26.5461 3918452.6112 16.7235 1447246.9374 9.1517 1068910.3803 12.5205
2
3
4
5
6
7
8
9
10
11
# Qot_GetCompanyOperationalEfficiency.proto
Description
Get Company Operational Efficiency
Parameters
message C2S
{
required Qot_Common.Security security = 1; // Stock
optional string nextKey = 2; // Pagination key; leave empty for first request; pass the value from previous response; "-1" means no more data
optional int32 num = 3; // Number of records per page, default 10, range 1~50
optional string currencyCode = 4; // Currency code (ISO 4217), e.g. CNY, USD, HKD, SGD, JPY, CAD, AUD; returns default currency if not specified
optional Qot_Common.F10Type financialType = 5; // Financial report period filter, supports 0-7, default 0 (no filter)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Return
// Operational efficiency data item
message OperationalEfficiencyItem
{
optional int32 fiscalYear = 1; // Fiscal year, e.g. 2024
optional Qot_Common.F10Type financialType = 2; // Financial report type
optional string periodText = 3; // Report period, e.g. "2024/Q3", "2024/FY"
optional int64 endDate = 4; // Period end timestamp (seconds)
optional string endDateStr = 5; // Period end date string, format YYYY-MM-DD
optional int64 employeeNum = 6; // Number of employees
optional double employeeNumYoy = 7; // YoY change in employee count, value before %
optional double incomePerCapita = 8; // Revenue per capita
optional double incomePerCapitaYoy = 9; // YoY change in revenue per capita, value before %
optional double profitPerCapita = 10; // Operating profit per capita
optional double profitPerCapitaYoy = 11; // YoY change in operating profit per capita, value before %
optional double netProfitPerCapita = 12; // Net profit per capita
optional double netProfitPerCapitaYoy = 13; // YoY change in net profit per capita, value before %
}
message S2C
{
repeated OperationalEfficiencyItem itemList = 1; // Operational efficiency data list
optional string nextKey = 2; // Pagination key, "-1" means no more data
optional string currencyCode = 3; // Currency code (ISO 4217)
}
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
32
Protocol ID
3246
uint GetCompanyOperationalEfficiency(QotGetCompanyOperationalEfficiency.Request req);
virtual void OnReply_GetCompanyOperationalEfficiency(MMAPI_Conn client, uint nSerialNo, QotGetCompanyOperationalEfficiency.Response rsp);
Description
Get Company Operational Efficiency
Parameters
message C2S
{
required Qot_Common.Security security = 1; // Stock
optional string nextKey = 2; // Pagination key; leave empty for first request; pass the value from previous response; "-1" means no more data
optional int32 num = 3; // Number of records per page, default 10, range 1~50
optional string currencyCode = 4; // Currency code (ISO 4217), e.g. CNY, USD, HKD, SGD, JPY, CAD, AUD; returns default currency if not specified
optional Qot_Common.F10Type financialType = 5; // Financial report period filter, supports 0-7, default 0 (no filter)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security structure: refer to Security
- Return
message S2C
{
repeated OperationalEfficiencyItem itemList = 1; // Operational efficiency data list
optional string nextKey = 2; // Pagination key, "-1" means no more data
optional string currencyCode = 3; // Currency code (ISO 4217)
}
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
- 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();
QotGetCompanyOperationalEfficiency.C2S c2s = QotGetCompanyOperationalEfficiency.C2S.CreateBuilder()
.SetSecurity(sec)
.Build();
QotGetCompanyOperationalEfficiency.Request req = QotGetCompanyOperationalEfficiency.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetCompanyOperationalEfficiency(req);
Console.Write("Send QotGetCompanyOperationalEfficiency: {0}\n", seqNo);
}
public void OnDisconnect(MMAPI_Conn client, long errCode)
{
Console.Write("Qot onDisConnect: {0}\n", errCode);
}
public void OnReply_GetCompanyOperationalEfficiency(MMAPI_Conn client, uint nSerialNo, QotGetCompanyOperationalEfficiency.Response rsp)
{
Console.Write("Reply: QotGetCompanyOperationalEfficiency: {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 {
itemList {
fiscalYear: 2025
financialType: F10Type_Annual
periodText: "2025/FY"
endDate: 1767110400
endDateStr: "2025-12-31"
employeeNum: 115849
employeeNumYoy: 4.7857
incomePerCapita: 6489188.5126
incomePerCapitaYoy: 8.6594
profitPerCapita: 2085145.3184
profitPerCapitaYoy: 10.7787
netProfitPerCapita: 1983625.2362
netProfitPerCapitaYoy: 11.6246
}
itemList {
//...
}
nextKey: "1483113600"
currencyCode: "CNY"
}
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 getCompanyOperationalEfficiency(QotGetCompanyOperationalEfficiency.Request req);
void onReply_GetCompanyOperationalEfficiency(MMAPI_Conn client, int nSerialNo, QotGetCompanyOperationalEfficiency.Response rsp);
Description
Get Company Operational Efficiency
Parameters
message C2S
{
required Qot_Common.Security security = 1; // Stock
optional string nextKey = 2; // Pagination key; leave empty for first request; pass the value from previous response; "-1" means no more data
optional int32 num = 3; // Number of records per page, default 10, range 1~50
optional string currencyCode = 4; // Currency code (ISO 4217), e.g. CNY, USD, HKD, SGD, JPY, CAD, AUD; returns default currency if not specified
optional Qot_Common.F10Type financialType = 5; // Financial report period filter, supports 0-7, default 0 (no filter)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security structure: refer to Security
- Return
message S2C
{
repeated OperationalEfficiencyItem itemList = 1; // Operational efficiency data list
optional string nextKey = 2; // Pagination key, "-1" means no more data
optional string currencyCode = 3; // Currency code (ISO 4217)
}
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
- 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();
QotGetCompanyOperationalEfficiency.C2S c2s = QotGetCompanyOperationalEfficiency.C2S.newBuilder()
.setSecurity(sec)
.build();
QotGetCompanyOperationalEfficiency.Request req = QotGetCompanyOperationalEfficiency.Request.newBuilder().setC2S(c2s).build();
int seqNo = qot.getCompanyOperationalEfficiency(req);
System.out.printf("Send QotGetCompanyOperationalEfficiency: %d\n", seqNo);
}
@Override
public void onDisconnect(MMAPI_Conn client, long errCode) {
System.out.printf("Qot onDisConnect: %d\n", errCode);
}
@Override
public void onReply_GetCompanyOperationalEfficiency(MMAPI_Conn client, int nSerialNo, QotGetCompanyOperationalEfficiency.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("QotGetCompanyOperationalEfficiency failed: %s\n", rsp.getRetMsg());
}
else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive QotGetCompanyOperationalEfficiency: %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=7459212697646186649
Send Qot_GetCompanyOperationalEfficiency: 2
Receive Qot_GetCompanyOperationalEfficiency: retType: 0
retMsg: ""
errCode: 0
s2c {
itemList {
fiscalYear: 2025
financialType: F10Type_Annual
periodText: "2025/FY"
endDate: 1767110400
endDateStr: "2025-12-31"
employeeNum: 115849
employeeNumYoy: 4.7857
incomePerCapita: 6489188.5126
incomePerCapitaYoy: 8.6594
profitPerCapita: 2085145.3184
profitPerCapitaYoy: 10.7787
netProfitPerCapita: 1983625.2362
netProfitPerCapitaYoy: 11.6246
}
itemList {
//...
}
nextKey: "1483113600"
currencyCode: "CNY"
}
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 GetCompanyOperationalEfficiency(const Qot_GetCompanyOperationalEfficiency::Request &stReq);
virtual void OnReply_GetCompanyOperationalEfficiency(moomoo::u32_t nSerialNo, const Qot_GetCompanyOperationalEfficiency::Response &stRsp) = 0;
Description
Get Company Operational Efficiency
Parameters
message C2S
{
required Qot_Common.Security security = 1; // Stock
optional string nextKey = 2; // Pagination key; leave empty for first request; pass the value from previous response; "-1" means no more data
optional int32 num = 3; // Number of records per page, default 10, range 1~50
optional string currencyCode = 4; // Currency code (ISO 4217), e.g. CNY, USD, HKD, SGD, JPY, CAD, AUD; returns default currency if not specified
optional Qot_Common.F10Type financialType = 5; // Financial report period filter, supports 0-7, default 0 (no filter)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security structure: refer to Security
- Return
message S2C
{
repeated OperationalEfficiencyItem itemList = 1; // Operational efficiency data list
optional string nextKey = 2; // Pagination key, "-1" means no more data
optional string currencyCode = 3; // Currency code (ISO 4217)
}
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
- 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_GetCompanyOperationalEfficiency::Request req;
Qot_GetCompanyOperationalEfficiency::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->GetCompanyOperationalEfficiency(req);
cout << "GetCompanyOperationalEfficiency" << endl;
}
virtual void OnReply_GetCompanyOperationalEfficiency(moomoo::u32_t nSerialNo, const Qot_GetCompanyOperationalEfficiency::Response &stRsp){
cout << "OnReply_GetCompanyOperationalEfficiency:" << 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_GetCompanyOperationalEfficiency seqNo=3
retType: 0
retMsg: ""
errCode: 0
s2c {
itemList {
fiscalYear: 2025
financialType: F10Type_Annual
periodText: "2025/FY"
endDate: 1767110400
endDateStr: "2025-12-31"
employeeNum: 115849
employeeNumYoy: 4.7857
incomePerCapita: 6489188.5126
incomePerCapitaYoy: 8.6594
profitPerCapita: 2085145.3184
profitPerCapitaYoy: 10.7787
netProfitPerCapita: 1983625.2362
netProfitPerCapitaYoy: 11.6246
}
itemList {
//...
}
nextKey: "1483113600"
currencyCode: "CNY"
}
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
GetCompanyOperationalEfficiency(req);
Description
Get Company Operational Efficiency
Parameters
message C2S
{
required Qot_Common.Security security = 1; // Stock
optional string nextKey = 2; // Pagination key; leave empty for first request; pass the value from previous response; "-1" means no more data
optional int32 num = 3; // Number of records per page, default 10, range 1~50
optional string currencyCode = 4; // Currency code (ISO 4217), e.g. CNY, USD, HKD, SGD, JPY, CAD, AUD; returns default currency if not specified
optional Qot_Common.F10Type financialType = 5; // Financial report period filter, supports 0-7, default 0 (no filter)
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security structure: refer to Security
- Return
message S2C
{
repeated OperationalEfficiencyItem itemList = 1; // Operational efficiency data list
optional string nextKey = 2; // Pagination key, "-1" means no more data
optional string currencyCode = 3; // Currency code (ISO 4217)
}
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
- Example
import mmWebsocket from "moomoo-api";
import { Common, Qot_Common } from "moomoo-api/proto";
import beautify from "js-beautify";
function QotGetCompanyOperationalEfficiency(){
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.GetCompanyOperationalEfficiency(req)
.then((res) => {
let { errCode, retMsg, retType,s2c } = res
console.log("GetCompanyOperationalEfficiency: 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
GetCompanyOperationalEfficiency: errCode 0, retMsg , retType 0
{
"itemList": [{
"fiscalYear": 2025,
"financialType": "F10Type_Annual",
"periodText": "2025/FY",
"endDate": "1767110400",
"endDateStr": "2025-12-31",
"employeeNum": "115849",
"employeeNumYoy": 4.7857,
"incomePerCapita": 6489188.5126,
"incomePerCapitaYoy": 8.6594,
"profitPerCapita": 2085145.3184,
"profitPerCapitaYoy": 10.7787,
"netProfitPerCapita": 1983625.2362,
"netProfitPerCapitaYoy": 11.6246
//...
}],
"nextKey": "1483113600",
"currencyCode": "CNY"
}
stop
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Restrictions
- Maximum 30 requests per 30 seconds.
- Supports equities and funds.