# Get Event Contract
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_event_contract(event_code, next_page=None, count=None)
Description
Get the Event Contract list under an Event code, including complete information such as contract type, time, status, result, and trading attributes, and return recommended contracts. Supports pagination.
Parameters
Parameter Type Description event_code str Event code, e.g. 'EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT'next_page str Pagination marker, omit on the first page count int Maximum number of items returned per page, default 100, maximum 1000 Return
Parameter Type Description ret RET_CODE API call result data dict When ret == RET_OK, returns Event Contract data, containing contract_list and recommend_contracts str When ret != RET_OK, returns error description next_page str Pagination marker, empty means no next page The dict structure of data is as follows:
Key Type Description contract_list pd.DataFrame Event Contract list (fields below) recommend_contracts list[dict] Recommended contract list, each item contains contract_code The DataFrame fields of contract_list are as follows:
Field Type Description contract_code str Contract code event_code str Owning Event code series_code str Owning Series code contract_type str Contract type, see ECContractType title str Contract title (localized) yes_sub_title str YES sub-title (localized) open_time str Contract open time (UTC ISO8601) close_time str Contract close time (UTC ISO8601) determination_time str Determination time settled_time str Settled time latest_expiration_time str Latest expiration time status str Contract status, see ECStatus result str Contract result settlement_value str Contract settlement value expiration_value str Contract expiration value volume str Contract volume can_close_early bool Whether early close is allowed tick_size str Tick size category str Top-level category identifier tag str Sub-category identifier Example
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data, next_page = quote_ctx.get_event_contract(
'EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT', count=5
)
if ret == RET_OK:
print(data['contract_list'])
print('推荐合约:', data['recommend_contracts'])
print('next_page:', next_page)
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
12
13
- Output
contract_code event_code series_code contract_type title yes_sub_title open_time close_time determination_time settled_time latest_expiration_time status result settlement_value expiration_value volume can_close_early tick_size category tag
0 EC.KXUFCVICROUND-26JUL11SAIPIM-SAI1 EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT EC.KXUFCVICROUND.SERIES BINARY Will Benoit Saint-Denis win the Benoit Saint-Denis vs. Paddy Pimblett 329 fight in Round 1 N/A 2026-07-08 12:29:00 2026-07-11 23:19:55 2026-07-11 23:20:54 2026-07-11 23:27:06 2026-07-25 22:00:00 FINALIZED No N/A Paddy Pimblett to win in Round 1 N/A True 0.010000000 Hot N/A
1 EC.KXUFCVICROUND-26JUL11SAIPIM-PIM2 EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT EC.KXUFCVICROUND.SERIES BINARY Will Paddy Pimblett win the Benoit Saint-Denis vs. Paddy Pimblett 329 fight in Round 2 N/A 2026-07-08 12:29:00 2026-07-11 23:19:55 2026-07-11 23:20:54 2026-07-11 23:27:06 2026-07-25 22:00:00 FINALIZED No N/A Paddy Pimblett to win in Round 1 N/A True 0.010000000 Hot N/A
2 EC.KXUFCVICROUND-26JUL11SAIPIM-PIM3 EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT EC.KXUFCVICROUND.SERIES BINARY Will Paddy Pimblett win the Benoit Saint-Denis vs. Paddy Pimblett 329 fight in Round 3 N/A 2026-07-08 12:29:00 2026-07-11 23:19:55 2026-07-11 23:20:54 2026-07-11 23:27:06 2026-07-25 22:00:00 FINALIZED No N/A Paddy Pimblett to win in Round 1 N/A True 0.010000000 Hot N/A
3 EC.KXUFCVICROUND-26JUL11SAIPIM-SAI3 EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT EC.KXUFCVICROUND.SERIES BINARY Will Benoit Saint-Denis win the Benoit Saint-Denis vs. Paddy Pimblett 329 fight in Round 3 N/A 2026-07-08 12:29:00 2026-07-11 23:19:55 2026-07-11 23:20:54 2026-07-11 23:27:06 2026-07-25 22:00:00 FINALIZED No N/A Paddy Pimblett to win in Round 1 N/A True 0.010000000 Hot N/A
4 EC.KXUFCVICROUND-26JUL11SAIPIM-PIM1 EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT EC.KXUFCVICROUND.SERIES BINARY Will Paddy Pimblett win the Benoit Saint-Denis vs. Paddy Pimblett 329 fight in Round 1 N/A 2026-07-08 12:29:00 2026-07-11 23:19:55 2026-07-11 23:20:54 2026-07-11 23:27:06 2026-07-25 22:00:00 FINALIZED Yes 1.000000000 Paddy Pimblett to win in Round 1 N/A True 0.010000000 Hot N/A
推荐合约: [{'contract_code': 'EC.KXUFCVICROUND-26JUL11SAIPIM-SAI1'}, {'contract_code': 'EC.KXUFCVICROUND-26JUL11SAIPIM-PIM2'}, {'contract_code': 'EC.KXUFCVICROUND-26JUL11SAIPIM-PIM3'}]
next_page: 5
2
3
4
5
6
7
8
# Qot_GetEventContract.proto
Description
Get the Event Contract list under an Event code.
Parameters
// Contract item
message ContractItem {
// ===== Identity =====
required Qot_Common.Security contractSecurity = 1; // Contract security
optional Qot_Common.Security eventSecurity = 2; // Owning Event
optional Qot_Common.Security seriesSecurity = 3; // Owning Series
optional Qot_Common.EC_ContractType contractType = 4; // Contract type (Binary/Scalar)
// ===== Name =====
optional string title = 5; // Contract title (localized)
optional string yesSubTitle = 6; // YES sub-title (localized)
// ===== Time (UTC ISO8601 string, e.g. 2025-09-26T18:30:00Z) =====
optional string openTime = 7; // Contract open time
optional string closeTime = 8; // Contract close time
optional string determinationTime = 9; // Determination time
optional string settledTime = 10; // Settled time
optional string latestExpirationTime = 11; // Latest expiration time
// ===== Status and result =====
optional Qot_Common.EC_Status status = 12; // Contract status
optional string result = 13; // Contract result
optional string settlementValue = 14; // Contract settlement value
optional string expirationValue = 15; // Contract expiration value
// ===== Trading attributes =====
optional string notionalValue = 16; // Contract notional value
optional string liquidity = 17; // Contract liquidity
optional string volume = 18; // Contract volume
optional bool canCloseEarly = 19; // Whether early close is allowed
optional string tickSize = 20; // Tick size
// ===== Category =====
optional string category = 21; // Top-level category identifier
optional string tag = 22; // Sub-category identifier
}
// Recommended contract
message RecommendContract {
required Qot_Common.Security contractSecurity = 1;
}
message C2S {
required Qot_Common.Security event = 1; // Event security
optional string nextPage = 2; // Pagination marker (omit on first page)
optional int32 count = 3; // Max items per page (default 100, max 1000)
}
message Request {
required C2S c2s = 1;
}
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
- For stock structure, refer to Security
- For Event Contract type, refer to EC_ContractType
- Return
message S2C {
repeated ContractItem contractList = 1; // Contract list
repeated RecommendContract recommendContracts = 2; // Recommended contract
optional string nextPage = 3; // Empty means no next page
}
message Response {
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
Protocol ID
3438
Data Type
- For stock structure, refer to Security
- For Event Contract type, refer to EC_ContractType
- For Event Contract status, refer to EC_Status
uint GetEventContract(GetEventContract.Request req);
virtual void OnReply_GetEventContract(FTAPI_Conn client, uint nSerialNo, GetEventContract.Response rsp);
Description
Get the Event Contract list under an Event code.
Parameters
message ContractItem {
required Qot_Common.Security contractSecurity = 1;
optional Qot_Common.Security eventSecurity = 2;
optional Qot_Common.Security seriesSecurity = 3;
optional Qot_Common.EC_ContractType contractType = 4;
optional string title = 5;
optional string yesSubTitle = 6;
optional string openTime = 7;
optional string closeTime = 8;
optional string determinationTime = 9;
optional string settledTime = 10;
optional string latestExpirationTime = 11;
optional Qot_Common.EC_Status status = 12;
optional string result = 13;
optional string settlementValue = 14;
optional string expirationValue = 15;
optional string notionalValue = 16;
optional string liquidity = 17;
optional string volume = 18;
optional bool canCloseEarly = 19;
optional string tickSize = 20;
optional string category = 21;
optional string tag = 22;
}
message RecommendContract {
required Qot_Common.Security contractSecurity = 1;
}
message C2S {
required Qot_Common.Security event = 1;
optional string nextPage = 2;
optional int32 count = 3;
}
message Request {
required C2S c2s = 1;
}
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
- For stock structure, refer to Security
- Return
message S2C {
repeated ContractItem contractList = 1;
repeated RecommendContract recommendContracts = 2;
optional string nextPage = 3;
}
message Response {
required int32 retType = 1 [default = -400];
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
- For API call result, refer to 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)
{
if (errCode != 0) return;
QotCommon.Security evt = QotCommon.Security.CreateBuilder()
.SetMarket((int)QotCommon.QotMarket.QotMarket_EventContract)
.SetCode("EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT").Build();
var c2s = GetEventContract.C2S.CreateBuilder()
.SetEvent(evt).SetCount(5).Build();
var req = GetEventContract.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetEventContract(req);
Console.Write("Send GetEventContract: {0}\n", seqNo);
}
public void OnReply_GetEventContract(FTAPI_Conn client, uint nSerialNo, GetEventContract.Response rsp)
{
Console.Write("Reply: {0} {1}\n", nSerialNo, rsp.ToString());
}
public static void Main(String[] args)
{
FTAPI.Init();
new Program().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
int getEventContract(QotGetEventContract.Request req);
void onReply_GetEventContract(FTAPI_Conn client, int nSerialNo, QotGetEventContract.Response rsp);
Description
Get the Event Contract list under an Event code.
Parameters
message C2S {
required Qot_Common.Security event = 1;
optional string nextPage = 2;
optional int32 count = 3;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
- For stock structure, refer to Security
- Return
message ContractItem {
required Qot_Common.Security contractSecurity = 1;
optional Qot_Common.Security eventSecurity = 2;
optional Qot_Common.Security seriesSecurity = 3;
optional Qot_Common.EC_ContractType contractType = 4;
optional string title = 5;
optional string yesSubTitle = 6;
optional string openTime = 7;
optional string closeTime = 8;
optional string determinationTime = 9;
optional string settledTime = 10;
optional string latestExpirationTime = 11;
optional Qot_Common.EC_Status status = 12;
optional string result = 13;
optional string settlementValue = 14;
optional string expirationValue = 15;
optional string notionalValue = 16;
optional string liquidity = 17;
optional string volume = 18;
optional bool canCloseEarly = 19;
optional string tickSize = 20;
optional string category = 21;
optional string tag = 22;
}
message RecommendContract {
required Qot_Common.Security contractSecurity = 1;
}
message S2C {
repeated ContractItem contractList = 1;
repeated RecommendContract recommendContracts = 2;
optional string nextPage = 3;
}
message Response {
required int32 retType = 1 [default = -400];
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
39
40
41
- For API call result, refer to RetType
- Example
public class Program implements FTSPI_Qot, FTSPI_Conn {
private FTAPI_Conn_Qot qot = new FTAPI_Conn_Qot();
public Program() {
qot.setClientInfo("java", 1);
qot.setConnCallback(this);
qot.setQotCallback(this);
}
public void start() {
qot.initConnect("127.0.0.1", (short) 11111, false);
}
@Override
public void onInitConnect(FTAPI_Conn client, long errCode, String desc) {
if (errCode != 0) return;
QotCommon.Security evt = QotCommon.Security.newBuilder()
.setMarket(QotCommon.QotMarket.QotMarket_EventContract_VALUE)
.setCode("EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT").build();
QotGetEventContract.C2S c2s = QotGetEventContract.C2S.newBuilder()
.setEvent(evt).setCount(5).build();
QotGetEventContract.Request req = QotGetEventContract.Request.newBuilder()
.setC2S(c2s).build();
int seqNo = qot.getEventContract(req);
System.out.println("Send GetEventContract: " + seqNo);
}
@Override
public void onReply_GetEventContract(FTAPI_Conn client, int nSerialNo, QotGetEventContract.Response rsp) {
System.out.println("Reply: " + nSerialNo + " " + rsp.toString());
}
public static void main(String[] args) {
FTAPI.init();
new Program().start();
while (true) {
try { Thread.sleep(1000 * 600); } catch (InterruptedException e) {}
}
}
}
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
Futu::u32_t GetEventContract(const Qot_GetEventContract::Request &stReq);
virtual void OnReply_GetEventContract(Futu::u32_t nSerialNo, const Qot_GetEventContract::Response &stRsp) = 0;
Description
Get the Event Contract list under an Event code.
Parameters
// Contract item
message ContractItem {
// ===== Identity =====
required Qot_Common.Security contractSecurity = 1; // Contract security
optional Qot_Common.Security eventSecurity = 2; // Owning Event
optional Qot_Common.Security seriesSecurity = 3; // Owning Series
optional Qot_Common.EC_ContractType contractType = 4; // Contract type (Binary/Scalar)
// ===== Name =====
optional string title = 5; // Contract title (localized)
optional string yesSubTitle = 6; // YES sub-title (localized)
// ===== Time (UTC ISO8601 string, e.g. 2025-09-26T18:30:00Z) =====
optional string openTime = 7; // Contract open time
optional string closeTime = 8; // Contract close time
optional string determinationTime = 9; // Determination time
optional string settledTime = 10; // Settled time
optional string latestExpirationTime = 11; // Latest expiration time
// ===== Status and result =====
optional Qot_Common.EC_Status status = 12; // Contract status
optional string result = 13; // Contract result
optional string settlementValue = 14; // Contract settlement value
optional string expirationValue = 15; // Contract expiration value
// ===== Trading attributes =====
optional string notionalValue = 16; // Contract notional value
optional string liquidity = 17; // Contract liquidity
optional string volume = 18; // Contract volume
optional bool canCloseEarly = 19; // Whether early close is allowed
optional string tickSize = 20; // Tick size
// ===== Category =====
optional string category = 21; // Top-level category identifier
optional string tag = 22; // Sub-category identifier
}
// Recommended contract
message RecommendContract {
required Qot_Common.Security contractSecurity = 1;
}
message C2S {
required Qot_Common.Security event = 1; // Event security
optional string nextPage = 2; // Pagination marker (omit on first page)
optional int32 count = 3; // Max items per page (default 100, max 1000)
}
message Request {
required C2S c2s = 1;
}
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
- For stock structure, refer to Security
- For Event Contract type, refer to EC_ContractType
- Return
message S2C {
repeated ContractItem contractList = 1; // Contract list
repeated RecommendContract recommendContracts = 2; // Recommended contract
optional string nextPage = 3; // Empty means no next page
}
message Response {
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
- 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_GetEventContract::Request req;
Qot_GetEventContract::C2S *c2s = req.mutable_c2s();
Qot_Common::Security *evt = c2s->mutable_event();
evt->set_code("EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT");
evt->set_market(Qot_Common::QotMarket::QotMarket_EventContract);
c2s->set_count(5);
m_GetEventContractSerialNo = m_pQotApi->GetEventContract(req);
cout << "Request GetEventContract SerialNo: " << m_GetEventContractSerialNo << endl;
}
virtual void OnReply_GetEventContract(Futu::u32_t nSerialNo, const Qot_GetEventContract::Response &stRsp) {
if (nSerialNo == m_GetEventContractSerialNo)
{
cout << "OnReply_GetEventContract SerialNo: " << nSerialNo << endl;
// parse the internal structure and print it
// 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;
Futu::u32_t m_GetEventContractSerialNo;
};
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
66
67
68
69
70
71
- Output
connect
Request GetEventContract SerialNo: 1
OnReply_GetEventContract SerialNo: 1
{
"retType": 0,
"retMsg": "",
"errCode": 0,
"s2c": {
"contractList": [
{
"contractSecurity": {"market": 101, "code": "EC.KXUFCVICROUND-26JUL11SAIPIM-SAI1"},
"eventSecurity": {"market": 101, "code": "EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT"},
"seriesSecurity": {"market": 101, "code": "EC.KXUFCVICROUND.SERIES"},
"contractType": 1,
"title": "Will Benoit Saint-Denis win the Benoit Saint-Denis vs. Paddy Pimblett 329 fight in Round 1",
"yesSubTitle": "N/A",
"openTime": "2026-07-08T12:29:00Z",
"closeTime": "2026-07-11T23:19:55Z",
"determinationTime": "2026-07-11T23:20:54Z",
"settledTime": "2026-07-11T23:27:06Z",
"latestExpirationTime": "2026-07-25T22:00:00Z",
"status": 9,
"result": "No",
"settlementValue": "N/A",
"expirationValue": "Paddy Pimblett to win in Round 1",
"notionalValue": "N/A",
"liquidity": "N/A",
"volume": "N/A",
"canCloseEarly": true,
"tickSize": "0.010000000",
"category": "Hot",
"tag": "N/A"
}
],
"recommendContracts": [
{"contractSecurity": {"market": 101, "code": "EC.KXUFCVICROUND-26JUL11SAIPIM-SAI1"}},
{"contractSecurity": {"market": 101, "code": "EC.KXUFCVICROUND-26JUL11SAIPIM-PIM2"}},
{"contractSecurity": {"market": 101, "code": "EC.KXUFCVICROUND-26JUL11SAIPIM-PIM3"}}
],
"nextPage": "5"
}
}
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
GetEventContract(req);
Description
Get the Event Contract list under an Event code, with pagination.
Parameters
// Contract item
message ContractItem {
// ===== Identity =====
required Qot_Common.Security contractSecurity = 1; // Contract security
optional Qot_Common.Security eventSecurity = 2; // Owning Event
optional Qot_Common.Security seriesSecurity = 3; // Owning Series
optional Qot_Common.EC_ContractType contractType = 4; // Contract type (Binary/Scalar)
// ===== Name =====
optional string title = 5; // Contract title (localized)
optional string yesSubTitle = 6; // YES sub-title (localized)
// ===== Time (UTC ISO8601 string, e.g. 2025-09-26T18:30:00Z) =====
optional string openTime = 7; // Contract open time
optional string closeTime = 8; // Contract close time
optional string determinationTime = 9; // Determination time
optional string settledTime = 10; // Settled time
optional string latestExpirationTime = 11; // Latest expiration time
// ===== Status and result =====
optional Qot_Common.EC_Status status = 12; // Contract status
optional string result = 13; // Contract result
optional string settlementValue = 14; // Contract settlement value
optional string expirationValue = 15; // Contract expiration value
// ===== Trading attributes =====
optional string notionalValue = 16; // Contract notional value
optional string liquidity = 17; // Contract liquidity
optional string volume = 18; // Contract volume
optional bool canCloseEarly = 19; // Whether early close is allowed
optional string tickSize = 20; // Tick size
// ===== Category =====
optional string category = 21; // Top-level category identifier
optional string tag = 22; // Sub-category identifier
}
// Recommended contract
message RecommendContract {
required Qot_Common.Security contractSecurity = 1;
}
message C2S {
required Qot_Common.Security event = 1; // Event security
optional string nextPage = 2; // Pagination marker (omit on first page)
optional int32 count = 3; // Max items per page (default 100, max 1000)
}
message Request {
required C2S c2s = 1;
}
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
- Return
message S2C {
repeated ContractItem contractList = 1; // Contract list
repeated RecommendContract recommendContracts = 2; // Recommended contract
optional string nextPage = 3; // Empty means no next page
}
message Response {
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
- For API call result, refer to RetType
- Example
import ftWebsocket from "futu-api";
import { Common, Qot_Common } from "futu-api/proto";
import beautify from "js-beautify";
function GetEventContract() {
const { RetType } = Common;
let [addr, port, enable_ssl, key] = ["127.0.0.1", 11111, false, ""];
let websocket = new ftWebsocket();
websocket.onlogin = async (ret, msg) => {
if (!ret) { console.log("start error", msg); return; }
try {
const req = { c2s: { event: { market: QotMarket.QotMarket_EventContract, code: "EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT" }, count: 5 } };
let { errCode, retMsg, retType, s2c } = await websocket.GetEventContract(req);
console.log("GetEventContract: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);
if (retType == RetType.RetType_Succeed) {
console.log(beautify(JSON.stringify(s2c), { indent_size: 2, space_in_empty_paren: true }));
}
} catch (error) {
console.log("error:", error);
}
};
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
- Output
GetEventContract: errCode 0, retMsg , retType 0
{
"contractList": [{
"contractSecurity": {
"market": 101,
"code": "EC.KXUFCVICROUND-26JUL11SAIPIM-SAI1"
},
"eventSecurity": {
"market": 101,
"code": "EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT"
},
"seriesSecurity": {
"market": 101,
"code": "EC.KXUFCVICROUND.SERIES"
},
"contractType": 1,
"title": "Will Benoit Saint-Denis win the Benoit Saint-Denis vs. Paddy Pimblett 329 fight in Round 1",
"status": 9,
"result": "No",
"volume": "N/A",
"canCloseEarly": true,
"tickSize": "0.010000000",
"category": "Hot",
"tag": "N/A"
}],
"recommendContracts": [{
"contractSecurity": {
"market": 101,
"code": "EC.KXUFCVICROUND-26JUL11SAIPIM-SAI1"
}
}, {
"contractSecurity": {
"market": 101,
"code": "EC.KXUFCVICROUND-26JUL11SAIPIM-PIM2"
}
}, {
"contractSecurity": {
"market": 101,
"code": "EC.KXUFCVICROUND-26JUL11SAIPIM-PIM3"
}
}],
"nextPage": "5"
}
stop
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
Interface Limitations
- A maximum of 10 requests per 30 seconds for the Get Event Contract interface
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_event_contract(event_code, next_page=None, count=None)
Description
Get the Event Contract list under an Event code, including complete information such as contract type, time, status, result, and trading attributes, and return recommended contracts. Supports pagination.
Parameters
Parameter Type Description event_code str Event code, e.g. 'EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT'next_page str Pagination marker, omit on the first page count int Maximum number of items returned per page, default 100, maximum 1000 Return
Parameter Type Description ret RET_CODE API call result data dict When ret == RET_OK, returns Event Contract data, containing contract_list and recommend_contracts str When ret != RET_OK, returns error description next_page str Pagination marker, empty means no next page The dict structure of data is as follows:
Key Type Description contract_list pd.DataFrame Event Contract list (fields below) recommend_contracts list[dict] Recommended contract list, each item contains contract_code The DataFrame fields of contract_list are as follows:
Field Type Description contract_code str Contract code event_code str Owning Event code series_code str Owning Series code contract_type str Contract type, see ECContractType title str Contract title (localized) yes_sub_title str YES sub-title (localized) open_time str Contract open time (UTC ISO8601) close_time str Contract close time (UTC ISO8601) determination_time str Determination time settled_time str Settled time latest_expiration_time str Latest expiration time status str Contract status, see ECStatus result str Contract result settlement_value str Contract settlement value expiration_value str Contract expiration value volume str Contract volume can_close_early bool Whether early close is allowed tick_size str Tick size category str Top-level category identifier tag str Sub-category identifier Example
from moomoo import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data, next_page = quote_ctx.get_event_contract(
'EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT', count=5
)
if ret == RET_OK:
print(data['contract_list'])
print('推荐合约:', data['recommend_contracts'])
print('next_page:', next_page)
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
12
13
- Output
contract_code event_code series_code contract_type title yes_sub_title open_time close_time determination_time settled_time latest_expiration_time status result settlement_value expiration_value volume can_close_early tick_size category tag
0 EC.KXUFCVICROUND-26JUL11SAIPIM-SAI1 EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT EC.KXUFCVICROUND.SERIES BINARY Will Benoit Saint-Denis win the Benoit Saint-Denis vs. Paddy Pimblett 329 fight in Round 1 N/A 2026-07-08 12:29:00 2026-07-11 23:19:55 2026-07-11 23:20:54 2026-07-11 23:27:06 2026-07-25 22:00:00 FINALIZED No N/A Paddy Pimblett to win in Round 1 N/A True 0.010000000 Hot N/A
1 EC.KXUFCVICROUND-26JUL11SAIPIM-PIM2 EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT EC.KXUFCVICROUND.SERIES BINARY Will Paddy Pimblett win the Benoit Saint-Denis vs. Paddy Pimblett 329 fight in Round 2 N/A 2026-07-08 12:29:00 2026-07-11 23:19:55 2026-07-11 23:20:54 2026-07-11 23:27:06 2026-07-25 22:00:00 FINALIZED No N/A Paddy Pimblett to win in Round 1 N/A True 0.010000000 Hot N/A
2 EC.KXUFCVICROUND-26JUL11SAIPIM-PIM3 EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT EC.KXUFCVICROUND.SERIES BINARY Will Paddy Pimblett win the Benoit Saint-Denis vs. Paddy Pimblett 329 fight in Round 3 N/A 2026-07-08 12:29:00 2026-07-11 23:19:55 2026-07-11 23:20:54 2026-07-11 23:27:06 2026-07-25 22:00:00 FINALIZED No N/A Paddy Pimblett to win in Round 1 N/A True 0.010000000 Hot N/A
3 EC.KXUFCVICROUND-26JUL11SAIPIM-SAI3 EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT EC.KXUFCVICROUND.SERIES BINARY Will Benoit Saint-Denis win the Benoit Saint-Denis vs. Paddy Pimblett 329 fight in Round 3 N/A 2026-07-08 12:29:00 2026-07-11 23:19:55 2026-07-11 23:20:54 2026-07-11 23:27:06 2026-07-25 22:00:00 FINALIZED No N/A Paddy Pimblett to win in Round 1 N/A True 0.010000000 Hot N/A
4 EC.KXUFCVICROUND-26JUL11SAIPIM-PIM1 EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT EC.KXUFCVICROUND.SERIES BINARY Will Paddy Pimblett win the Benoit Saint-Denis vs. Paddy Pimblett 329 fight in Round 1 N/A 2026-07-08 12:29:00 2026-07-11 23:19:55 2026-07-11 23:20:54 2026-07-11 23:27:06 2026-07-25 22:00:00 FINALIZED Yes 1.000000000 Paddy Pimblett to win in Round 1 N/A True 0.010000000 Hot N/A
推荐合约: [{'contract_code': 'EC.KXUFCVICROUND-26JUL11SAIPIM-SAI1'}, {'contract_code': 'EC.KXUFCVICROUND-26JUL11SAIPIM-PIM2'}, {'contract_code': 'EC.KXUFCVICROUND-26JUL11SAIPIM-PIM3'}]
next_page: 5
2
3
4
5
6
7
8
# Qot_GetEventContract.proto
Description
Get the Event Contract list under an Event code.
Parameters
// Contract item
message ContractItem {
// ===== Identity =====
required Qot_Common.Security contractSecurity = 1; // Contract security
optional Qot_Common.Security eventSecurity = 2; // Owning Event
optional Qot_Common.Security seriesSecurity = 3; // Owning Series
optional Qot_Common.EC_ContractType contractType = 4; // Contract type (Binary/Scalar)
// ===== Name =====
optional string title = 5; // Contract title (localized)
optional string yesSubTitle = 6; // YES sub-title (localized)
// ===== Time (UTC ISO8601 string, e.g. 2025-09-26T18:30:00Z) =====
optional string openTime = 7; // Contract open time
optional string closeTime = 8; // Contract close time
optional string determinationTime = 9; // Determination time
optional string settledTime = 10; // Settled time
optional string latestExpirationTime = 11; // Latest expiration time
// ===== Status and result =====
optional Qot_Common.EC_Status status = 12; // Contract status
optional string result = 13; // Contract result
optional string settlementValue = 14; // Contract settlement value
optional string expirationValue = 15; // Contract expiration value
// ===== Trading attributes =====
optional string notionalValue = 16; // Contract notional value
optional string liquidity = 17; // Contract liquidity
optional string volume = 18; // Contract volume
optional bool canCloseEarly = 19; // Whether early close is allowed
optional string tickSize = 20; // Tick size
// ===== Category =====
optional string category = 21; // Top-level category identifier
optional string tag = 22; // Sub-category identifier
}
// Recommended contract
message RecommendContract {
required Qot_Common.Security contractSecurity = 1;
}
message C2S {
required Qot_Common.Security event = 1; // Event security
optional string nextPage = 2; // Pagination marker (omit on first page)
optional int32 count = 3; // Max items per page (default 100, max 1000)
}
message Request {
required C2S c2s = 1;
}
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
- For stock structure, refer to Security
- For Event Contract type, refer to EC_ContractType
- Return
message S2C {
repeated ContractItem contractList = 1; // Contract list
repeated RecommendContract recommendContracts = 2; // Recommended contract
optional string nextPage = 3; // Empty means no next page
}
message Response {
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
Protocol ID
3438
Data Type
- For stock structure, refer to Security
- For Event Contract type, refer to EC_ContractType
- For Event Contract status, refer to EC_Status
uint GetEventContract(GetEventContract.Request req);
virtual void OnReply_GetEventContract(MMAPI_Conn client, uint nSerialNo, GetEventContract.Response rsp);
Description
Get the Event Contract list under an Event code.
Parameters
message ContractItem {
required Qot_Common.Security contractSecurity = 1;
optional Qot_Common.Security eventSecurity = 2;
optional Qot_Common.Security seriesSecurity = 3;
optional Qot_Common.EC_ContractType contractType = 4;
optional string title = 5;
optional string yesSubTitle = 6;
optional string openTime = 7;
optional string closeTime = 8;
optional string determinationTime = 9;
optional string settledTime = 10;
optional string latestExpirationTime = 11;
optional Qot_Common.EC_Status status = 12;
optional string result = 13;
optional string settlementValue = 14;
optional string expirationValue = 15;
optional string notionalValue = 16;
optional string liquidity = 17;
optional string volume = 18;
optional bool canCloseEarly = 19;
optional string tickSize = 20;
optional string category = 21;
optional string tag = 22;
}
message RecommendContract {
required Qot_Common.Security contractSecurity = 1;
}
message C2S {
required Qot_Common.Security event = 1;
optional string nextPage = 2;
optional int32 count = 3;
}
message Request {
required C2S c2s = 1;
}
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
- For stock structure, refer to Security
- Return
message S2C {
repeated ContractItem contractList = 1;
repeated RecommendContract recommendContracts = 2;
optional string nextPage = 3;
}
message Response {
required int32 retType = 1 [default = -400];
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
- For API call result, refer to 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)
{
if (errCode != 0) return;
QotCommon.Security evt = QotCommon.Security.CreateBuilder()
.SetMarket((int)QotCommon.QotMarket.QotMarket_EventContract)
.SetCode("EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT").Build();
var c2s = GetEventContract.C2S.CreateBuilder()
.SetEvent(evt).SetCount(5).Build();
var req = GetEventContract.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetEventContract(req);
Console.Write("Send GetEventContract: {0}\n", seqNo);
}
public void OnReply_GetEventContract(MMAPI_Conn client, uint nSerialNo, GetEventContract.Response rsp)
{
Console.Write("Reply: {0} {1}\n", nSerialNo, rsp.ToString());
}
public static void Main(String[] args)
{
MMAPI.Init();
new Program().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
int getEventContract(QotGetEventContract.Request req);
void onReply_GetEventContract(MMAPI_Conn client, int nSerialNo, QotGetEventContract.Response rsp);
Description
Get the Event Contract list under an Event code.
Parameters
message C2S {
required Qot_Common.Security event = 1;
optional string nextPage = 2;
optional int32 count = 3;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
- For stock structure, refer to Security
- Return
message ContractItem {
required Qot_Common.Security contractSecurity = 1;
optional Qot_Common.Security eventSecurity = 2;
optional Qot_Common.Security seriesSecurity = 3;
optional Qot_Common.EC_ContractType contractType = 4;
optional string title = 5;
optional string yesSubTitle = 6;
optional string openTime = 7;
optional string closeTime = 8;
optional string determinationTime = 9;
optional string settledTime = 10;
optional string latestExpirationTime = 11;
optional Qot_Common.EC_Status status = 12;
optional string result = 13;
optional string settlementValue = 14;
optional string expirationValue = 15;
optional string notionalValue = 16;
optional string liquidity = 17;
optional string volume = 18;
optional bool canCloseEarly = 19;
optional string tickSize = 20;
optional string category = 21;
optional string tag = 22;
}
message RecommendContract {
required Qot_Common.Security contractSecurity = 1;
}
message S2C {
repeated ContractItem contractList = 1;
repeated RecommendContract recommendContracts = 2;
optional string nextPage = 3;
}
message Response {
required int32 retType = 1 [default = -400];
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
39
40
41
- For API call result, refer to RetType
- Example
public class Program implements MMSPI_Qot, MMSPI_Conn {
private MMAPI_Conn_Qot qot = new MMAPI_Conn_Qot();
public Program() {
qot.setClientInfo("java", 1);
qot.setConnCallback(this);
qot.setQotCallback(this);
}
public void start() {
qot.initConnect("127.0.0.1", (short) 11111, false);
}
@Override
public void onInitConnect(MMAPI_Conn client, long errCode, String desc) {
if (errCode != 0) return;
QotCommon.Security evt = QotCommon.Security.newBuilder()
.setMarket(QotCommon.QotMarket.QotMarket_EventContract_VALUE)
.setCode("EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT").build();
QotGetEventContract.C2S c2s = QotGetEventContract.C2S.newBuilder()
.setEvent(evt).setCount(5).build();
QotGetEventContract.Request req = QotGetEventContract.Request.newBuilder()
.setC2S(c2s).build();
int seqNo = qot.getEventContract(req);
System.out.println("Send GetEventContract: " + seqNo);
}
@Override
public void onReply_GetEventContract(MMAPI_Conn client, int nSerialNo, QotGetEventContract.Response rsp) {
System.out.println("Reply: " + nSerialNo + " " + rsp.toString());
}
public static void main(String[] args) {
MMAPI.init();
new Program().start();
while (true) {
try { Thread.sleep(1000 * 600); } catch (InterruptedException e) {}
}
}
}
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
moomoo::u32_t GetEventContract(const Qot_GetEventContract::Request &stReq);
virtual void OnReply_GetEventContract(moomoo::u32_t nSerialNo, const Qot_GetEventContract::Response &stRsp) = 0;
Description
Get the Event Contract list under an Event code.
Parameters
// Contract item
message ContractItem {
// ===== Identity =====
required Qot_Common.Security contractSecurity = 1; // Contract security
optional Qot_Common.Security eventSecurity = 2; // Owning Event
optional Qot_Common.Security seriesSecurity = 3; // Owning Series
optional Qot_Common.EC_ContractType contractType = 4; // Contract type (Binary/Scalar)
// ===== Name =====
optional string title = 5; // Contract title (localized)
optional string yesSubTitle = 6; // YES sub-title (localized)
// ===== Time (UTC ISO8601 string, e.g. 2025-09-26T18:30:00Z) =====
optional string openTime = 7; // Contract open time
optional string closeTime = 8; // Contract close time
optional string determinationTime = 9; // Determination time
optional string settledTime = 10; // Settled time
optional string latestExpirationTime = 11; // Latest expiration time
// ===== Status and result =====
optional Qot_Common.EC_Status status = 12; // Contract status
optional string result = 13; // Contract result
optional string settlementValue = 14; // Contract settlement value
optional string expirationValue = 15; // Contract expiration value
// ===== Trading attributes =====
optional string notionalValue = 16; // Contract notional value
optional string liquidity = 17; // Contract liquidity
optional string volume = 18; // Contract volume
optional bool canCloseEarly = 19; // Whether early close is allowed
optional string tickSize = 20; // Tick size
// ===== Category =====
optional string category = 21; // Top-level category identifier
optional string tag = 22; // Sub-category identifier
}
// Recommended contract
message RecommendContract {
required Qot_Common.Security contractSecurity = 1;
}
message C2S {
required Qot_Common.Security event = 1; // Event security
optional string nextPage = 2; // Pagination marker (omit on first page)
optional int32 count = 3; // Max items per page (default 100, max 1000)
}
message Request {
required C2S c2s = 1;
}
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
- For stock structure, refer to Security
- For Event Contract type, refer to EC_ContractType
- Return
message S2C {
repeated ContractItem contractList = 1; // Contract list
repeated RecommendContract recommendContracts = 2; // Recommended contract
optional string nextPage = 3; // Empty means no next page
}
message Response {
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
- 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_GetEventContract::Request req;
Qot_GetEventContract::C2S *c2s = req.mutable_c2s();
Qot_Common::Security *evt = c2s->mutable_event();
evt->set_code("EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT");
evt->set_market(Qot_Common::QotMarket::QotMarket_EventContract);
c2s->set_count(5);
m_GetEventContractSerialNo = m_pQotApi->GetEventContract(req);
cout << "Request GetEventContract SerialNo: " << m_GetEventContractSerialNo << endl;
}
virtual void OnReply_GetEventContract(moomoo::u32_t nSerialNo, const Qot_GetEventContract::Response &stRsp) {
if (nSerialNo == m_GetEventContractSerialNo)
{
cout << "OnReply_GetEventContract SerialNo: " << nSerialNo << endl;
// parse the internal structure and print it
// 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;
moomoo::u32_t m_GetEventContractSerialNo;
};
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
66
67
68
69
70
71
- Output
connect
Request GetEventContract SerialNo: 1
OnReply_GetEventContract SerialNo: 1
{
"retType": 0,
"retMsg": "",
"errCode": 0,
"s2c": {
"contractList": [
{
"contractSecurity": {"market": 101, "code": "EC.KXUFCVICROUND-26JUL11SAIPIM-SAI1"},
"eventSecurity": {"market": 101, "code": "EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT"},
"seriesSecurity": {"market": 101, "code": "EC.KXUFCVICROUND.SERIES"},
"contractType": 1,
"title": "Will Benoit Saint-Denis win the Benoit Saint-Denis vs. Paddy Pimblett 329 fight in Round 1",
"yesSubTitle": "N/A",
"openTime": "2026-07-08T12:29:00Z",
"closeTime": "2026-07-11T23:19:55Z",
"determinationTime": "2026-07-11T23:20:54Z",
"settledTime": "2026-07-11T23:27:06Z",
"latestExpirationTime": "2026-07-25T22:00:00Z",
"status": 9,
"result": "No",
"settlementValue": "N/A",
"expirationValue": "Paddy Pimblett to win in Round 1",
"notionalValue": "N/A",
"liquidity": "N/A",
"volume": "N/A",
"canCloseEarly": true,
"tickSize": "0.010000000",
"category": "Hot",
"tag": "N/A"
}
],
"recommendContracts": [
{"contractSecurity": {"market": 101, "code": "EC.KXUFCVICROUND-26JUL11SAIPIM-SAI1"}},
{"contractSecurity": {"market": 101, "code": "EC.KXUFCVICROUND-26JUL11SAIPIM-PIM2"}},
{"contractSecurity": {"market": 101, "code": "EC.KXUFCVICROUND-26JUL11SAIPIM-PIM3"}}
],
"nextPage": "5"
}
}
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
GetEventContract(req);
Description
Get the Event Contract list under an Event code, with pagination.
Parameters
// Contract item
message ContractItem {
// ===== Identity =====
required Qot_Common.Security contractSecurity = 1; // Contract security
optional Qot_Common.Security eventSecurity = 2; // Owning Event
optional Qot_Common.Security seriesSecurity = 3; // Owning Series
optional Qot_Common.EC_ContractType contractType = 4; // Contract type (Binary/Scalar)
// ===== Name =====
optional string title = 5; // Contract title (localized)
optional string yesSubTitle = 6; // YES sub-title (localized)
// ===== Time (UTC ISO8601 string, e.g. 2025-09-26T18:30:00Z) =====
optional string openTime = 7; // Contract open time
optional string closeTime = 8; // Contract close time
optional string determinationTime = 9; // Determination time
optional string settledTime = 10; // Settled time
optional string latestExpirationTime = 11; // Latest expiration time
// ===== Status and result =====
optional Qot_Common.EC_Status status = 12; // Contract status
optional string result = 13; // Contract result
optional string settlementValue = 14; // Contract settlement value
optional string expirationValue = 15; // Contract expiration value
// ===== Trading attributes =====
optional string notionalValue = 16; // Contract notional value
optional string liquidity = 17; // Contract liquidity
optional string volume = 18; // Contract volume
optional bool canCloseEarly = 19; // Whether early close is allowed
optional string tickSize = 20; // Tick size
// ===== Category =====
optional string category = 21; // Top-level category identifier
optional string tag = 22; // Sub-category identifier
}
// Recommended contract
message RecommendContract {
required Qot_Common.Security contractSecurity = 1;
}
message C2S {
required Qot_Common.Security event = 1; // Event security
optional string nextPage = 2; // Pagination marker (omit on first page)
optional int32 count = 3; // Max items per page (default 100, max 1000)
}
message Request {
required C2S c2s = 1;
}
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
- Return
message S2C {
repeated ContractItem contractList = 1; // Contract list
repeated RecommendContract recommendContracts = 2; // Recommended contract
optional string nextPage = 3; // Empty means no next page
}
message Response {
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
- For API call result, refer to RetType
- Example
import mmWebsocket from "moomoo-api";
import { Common, Qot_Common } from "moomoo-api/proto";
import beautify from "js-beautify";
function GetEventContract() {
const { RetType } = Common;
let [addr, port, enable_ssl, key] = ["127.0.0.1", 11111, false, ""];
let websocket = new mmWebsocket();
websocket.onlogin = async (ret, msg) => {
if (!ret) { console.log("start error", msg); return; }
try {
const req = { c2s: { event: { market: QotMarket.QotMarket_EventContract, code: "EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT" }, count: 5 } };
let { errCode, retMsg, retType, s2c } = await websocket.GetEventContract(req);
console.log("GetEventContract: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);
if (retType == RetType.RetType_Succeed) {
console.log(beautify(JSON.stringify(s2c), { indent_size: 2, space_in_empty_paren: true }));
}
} catch (error) {
console.log("error:", error);
}
};
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
- Output
GetEventContract: errCode 0, retMsg , retType 0
{
"contractList": [{
"contractSecurity": {
"market": 101,
"code": "EC.KXUFCVICROUND-26JUL11SAIPIM-SAI1"
},
"eventSecurity": {
"market": 101,
"code": "EC.KXUFCVICROUND-26JUL11SAIPIM.EVENT"
},
"seriesSecurity": {
"market": 101,
"code": "EC.KXUFCVICROUND.SERIES"
},
"contractType": 1,
"title": "Will Benoit Saint-Denis win the Benoit Saint-Denis vs. Paddy Pimblett 329 fight in Round 1",
"status": 9,
"result": "No",
"volume": "N/A",
"canCloseEarly": true,
"tickSize": "0.010000000",
"category": "Hot",
"tag": "N/A"
}],
"recommendContracts": [{
"contractSecurity": {
"market": 101,
"code": "EC.KXUFCVICROUND-26JUL11SAIPIM-SAI1"
}
}, {
"contractSecurity": {
"market": 101,
"code": "EC.KXUFCVICROUND-26JUL11SAIPIM-PIM2"
}
}, {
"contractSecurity": {
"market": 101,
"code": "EC.KXUFCVICROUND-26JUL11SAIPIM-PIM3"
}
}],
"nextPage": "5"
}
stop
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
Interface Limitations
- A maximum of 10 requests per 30 seconds for the Get Event Contract interface