# Get Event Contract

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()
1
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
1
2
3
4
5
6
7
8

Interface Limitations

  • A maximum of 10 requests per 30 seconds for the Get Event Contract interface