# Get Futures Contract Information

get_future_info(code_list)

  • Description

    Get futures contract information

  • Parameters

    Parameter Type Description
    code_list list Futures code list. Data type of elements in the list is str.
  • Return

    Field Type Description
    ret RET_CODE Interface result.
    data pd.DataFrame If ret == RET_OK, futures contract data is returned.
    str If ret != RET_OK, error description is returned.
    • Futures contract data format as follows:
      Field Type Description
      code str Future code.
      name str Future name.
      owner str Subject.
      exchange str Exchange.
      type str Contract type.
      size float Contract size.
      size_unit str Contract size unit.
      price_currency str Quote currency.
      price_unit str Price unit.
      min_change float Price change step.
      min_change_unit str Unit of price change step.
      trade_time str Trading time.
      time_zone str Time zone.
      last_trade_time str The last trading time.
      exchange_format_url str Exchange format url address.
      origin_code str Original future code.
  • Example

from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)

ret, data = quote_ctx.get_future_info(["HK.MPImain", "HK.HAImain"])
if ret == RET_OK:
    print(data)
    print(data['code'][0]) # Take the first stock code
    print(data['code'].values.tolist()) # Convert to list
else:
    print('error:', data)
quote_ctx.close() # After using the connection, remember to close it to prevent the number of connections from running out
1
2
3
4
5
6
7
8
9
10
11
  • Output
    code      name       owner exchange  type     size size_unit price_currency price_unit  min_change min_change_unit                        trade_time time_zone last_trade_time                                exchange_format_url           origin_code
0  HK.MPImain  MPI Future Main(NOV0)    Hang Seng Mainland Properties Index     HKEX  Equity Index     50.0  Index Points×HKD            HKD  Index Point        0.50     Index Point  (09:15 - 12:00), (13:00 - 16:30)       CCT                  https://www.hkex.com.hk/Products/Listed-Deriva...           HK.MPI2112
1  HK.HAImain  HAI Future Main(NOV0)    HK.06837     HKEX  Single Stock  10000.0            shares            HKD  1 share/HKD        0.01             HKD  (09:30 - 12:00), (13:00 - 16:00)       CCT                  https://www.hkex.com.hk/Products/Listed-Deriva...           HK.HAI2112
HK.MPImain
['HK.MPImain', 'HK.HAImain']
1
2
3
4
5

Interface Limitations

  • A maximum of 30 requests for obtaining futures contract data interface every 30 seconds
  • The maximum number of futures is 200, in the code list for each request.