# Get the List of Stocks in The Plate

get_plate_stock(plate_code, sort_field=SortField.CODE, ascend=True)

  • Description

    Get the list of stocks in the plate, or get the constituent stocks of the stock index

  • Parameters

    Parameter Type Description
    plate_code str Plate code.
    sort_field SortField Sort field.
    ascend bool Sort direction.
  • Return

    Field Type Description
    ret RET_CODE Interface result.
    data pd.DataFrame If ret == RET_OK, stock data of the plate is returned.
    str If ret != RET_OK, error description is returned.
    • Stock data of the plate format as follows:
      Field Type Description
      code str Stock code.
      lot_size int The number of shares per lot, or contract multiplier for futures.
      stock_name str Stock name.
      stock_type SecurityType Stock type.
      list_time str Time of listing.
      stock_id int Stock ID.
      main_contract bool Whether future main contract.
      last_trade_time str Last trading time.
  • Example

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

ret, data = quote_ctx.get_plate_stock('HK.BK1001')
if ret == RET_OK:
    print(data)
    print(data['stock_name'][0]) # Take the first stock name
    print(data['stock_name'].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  lot_size stock_name  stock_owner  stock_child_type stock_type   list_time        stock_id  main_contract last_trade_time
0   HK.00462      4000       Natural dairy          NaN               NaN      STOCK  2005-06-10  55589761712590          False                
..       ...       ...        ...          ...               ...        ...         ...             ...            ...             ...
9   HK.06186      1000           China Feihe Limited          NaN               NaN      STOCK  2019-11-13  78159814858794          False                

[10 rows x 10 columns]
Natural Dairy
['Natural Dairy', 'China Modern Dairy', 'Yashili International', 'YuanShengTai Dairy Farm', 'China Shengmu Organic Milk', 'China ZhongDi Dairy Holdings', 'Lanzhou Zhuangyuan Pasture', 'Ausnutria Dairy Corporation', 'China Mengniu Dairy', 'China Feihe Limited']
1
2
3
4
5
6
7
8

Interface Limitations

  • A maximum of 10 requests per 30 seconds
Commonly used sectors and index codes
Code Description
HK.HSI Constituent HSI constituent stocks
HK.HSCEI Stock HSCEI constituent stocks
HK.Motherboard Main Plate of Hong Kong Stocks
HK.GEM GEM(Growth Enterprise Market) Hong Kong Stocks
HK.LIST1910 All Hong Kong stocks
HK.LIST1911 Main Plate H shares
HK.LIST1912 GEM H shares
HK.Fund ETF (Hong Kong Stock Fund)
HK.LIST1600 Hot List (Hong Kong)
HK.LIST1921 Listed new shares-Hong Kong stocks
SH.LIST3000000 Shanghai Main Plate
SH.LIST0901 Shanghai Stock Exchange B shares
SH.LIST0902 Shenzhen Stock Exchange B shares
SH.LIST3000002 Shanghai and Shenzhen Index
SH.LIST3000005 All A-shares (Shanghai and Shenzhen)
SH.LIST0600 Hot List (Shanghai and Shenzhen)
SH.LIST0992 Science Innovation Plate
SH.LIST0921 Listed New Shares - A-shares
SZ.LIST3000001 SZSE Main Plate
SZ.LIST3000003 Small and Medium Plate
SZ.LIST3000004 The Growth Enterprise Market (Deep)
US.USAALL All US stocks