# Get Market Snapshot

get_market_snapshot(code_list)

  • Description

    Get market snapshot

  • Parameters

    Parameter Type Description
    code_list list Stock list
  • Return

    Field Type Description
    ret RET_CODE Interface result.
    data pd.DataFrame If ret == RET_OK, stock snapshot data is returned.
    str If ret != RET_OK, error description is returned.
    • Stock snapshot data format as follows:
      Field Type Description
      code str Stock code.
      name str Stock name.
      update_time str Current update time.
      last_price float Latest price.
      open_price float Open.
      high_price float High.
      low_price float Low.
      prev_close_price float Yesterday's close.
      volume int Volume.
      turnover float Turnover.
      turnover_rate float Turnover rate.
      suspension bool Is suspended or not.
      listing_date str Listing date.
      equity_valid bool Is stock or not.
      issued_shares int Total shares.
      total_market_val float Total market value.
      net_asset int Net asset value.
      net_profit int Net profit.
      earning_per_share float Earnings per share.
      outstanding_shares int Shares outstanding.
      net_asset_per_share float Net assets per share.
      circular_market_val float Circulation market value.
      ey_ratio float Yield rate.
      pe_ratio float P/E ratio.
      pb_ratio float P/B ratio.
      pe_ttm_ratio float P/E ratio TTM.
      dividend_ttm float Dividend TTM, dividend.
      dividend_ratio_ttm float Dividend rate TTM.
      dividend_lfy float Dividend LFY, dividend of the previous year.
      dividend_lfy_ratio float Dividend rate LFY.
      stock_owner str The code of the underlying stock to which the warrant belongs or the code of the underlying stock of the option.
      wrt_valid bool Is warrant or not.
      wrt_conversion_ratio float Conversion ratio.
      wrt_type WrtType Warrant type.
      wrt_strike_price float Strike price.
      wrt_maturity_date str Maturity date.
      wrt_end_trade str Last trading time.
      wrt_leverage float Leverage ratio.
      wrt_ipop float in/out of the money.
      wrt_break_even_point float Breakeven point.
      wrt_conversion_price float Conversion price.
      wrt_price_recovery_ratio float Price recovery ratio.
      wrt_score float Comprehensive score of warrant.
      wrt_code str The underlying stock of the warrant (This field has been deprecated and changed to stock_owner.).
      wrt_recovery_price float Warrant recovery price.
      wrt_street_vol float Warrant Outstanding quantity.
      wrt_issue_vol float Warrant issuance.
      wrt_street_ratio float Outstanding percentage.
      wrt_delta float Delta value of warrant.
      wrt_implied_volatility float Warrant implied volatility.
      wrt_premium float Warrant premium.
      wrt_upper_strike_price float Upper bound price.
      wrt_lower_strike_price float lower bound price.
      wrt_inline_price_status PriceType in/out of bounds
      wrt_issuer_code str Issuer code.
      option_valid bool Is option or not.
      option_type OptionType Option type.
      strike_time str The option exercise date.
      option_strike_price float Strike price.
      option_contract_size float Number of stocks per contract.
      option_open_interest int Total open contract number.
      option_implied_volatility float Implied volatility.
      option_premium float Premium.
      option_delta float Greek value Delta.
      option_gamma float Greek value Gamma.
      option_vega float Greek value Vega.
      option_theta float Greek value Theta.
      option_rho float Greek value Rho.
      index_option_type IndexOptionType Index option type.
      option_net_open_interest int Net open contract number.
      option_expiry_date_distance int The number of days from the expiry date, a negative number means it has expired.
      option_contract_nominal_value float Contract nominal amount.
      option_owner_lot_multiplier float Equal number of underlying stocks.
      option_area_type OptionAreaType Option type (by exercise time).
      option_contract_multiplier float Contract multiplier.
      plate_valid bool Is plate or not.
      plate_raise_count int Number of stocks that raises in the plate.
      plate_fall_count int Number of stocks that falls in the plate.
      plate_equal_count int Number of stocks that dose not change in price in the plate.
      index_valid bool Is index or not.
      index_raise_count int Number of stocks that raises in the plate.
      index_fall_count int Number of stocks that falls in the plate.
      index_equal_count int Number of stocks that dose not change in the plate.
      lot_size int The number of shares per lot, stock options represent the number of shares per contract
      , and futures represent contract multipliers.
      price_spread float The current upward price difference.
      ask_price float Ask price.
      bid_price float Bid price.
      ask_vol float Ask volume.
      bid_vol float Bid volume.
      enable_margin bool Whether financing is available (Deprecated).
      mortgage_ratio float Stock mortgage rate (Deprecated).
      long_margin_initial_ratio float The initial margin rate of financing (Deprecated).
      enable_short_sell bool Whether short-selling is available (Deprecated).
      short_sell_rate float Short-selling reference rate (Deprecated).
      short_available_volume int Remaining quantity that can be sold short (Deprecated).
      short_margin_initial_ratio float The initial margin rate for short selling (Deprecated).
      sec_status SecurityStatus Stock status.
      amplitude float Amplitude.
      avg_price float Average price.
      bid_ask_ratio float The Committee.
      volume_ratio float Volume ratio.
      highest52weeks_price float Highest price in 52 weeks.
      lowest52weeks_price float Lowest price in 52 weeks .
      highest_history_price float Highest historical price.
      lowest_history_price float Lowest historical price.
      pre_price float Pre-market price.
      pre_high_price float Highest pre-market price.
      pre_low_price float Lowest pre-market price.
      pre_volume int Pre-market volume.
      pre_turnover float Pre-market turnover.
      pre_change_val float Pre-market change.
      pre_change_rate float Pre-market change rate.
      pre_amplitude float Pre-market amplitude.
      after_price float After-hours price.
      after_high_price float Highest price after-hours.
      after_low_price float Lowest price after-hours.
      after_volume int After-hours trading volume.
      after_turnover float After-hours turnover.
      after_change_val float After-hours change.
      after_change_rate float After-hours change rate.
      after_amplitude float After-hours amplitude.
      overnight_price float Overnight price.
      overnight_high_price float Overnight high.
      overnight_low_price float Overnight low.
      overnight_volume int Overnight volume.
      overnight_turnover float Overnight turnover.
      overnight_change_val float Overnight change.
      overnight_change_rate float Overnight change rate.
      overnight_amplitude float Overnight amplitude.
      future_valid bool Is futures or not.
      future_last_settle_price float Yesterday's close.
      future_position float Holding position.
      future_position_change float Change in position.
      future_main_contract bool Is future main contract or not.
      future_last_trade_time str The last trading time.
      trust_valid bool Is fund or not.
      trust_dividend_yield float Dividend rate.
      trust_aum float Asset scale.
      trust_outstanding_units int Total circulation.
      trust_netAssetValue float Net asset value.
      trust_premium float Premium.
      trust_assetClass AssetClass Asset class.
  • Example

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

ret, data = quote_ctx.get_market_snapshot(['HK.00700', 'US.AAPL'])
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              update_time  last_price  open_price  high_price  low_price  prev_close_price     volume      turnover  turnover_rate  suspension listing_date  lot_size  price_spread  stock_owner  ask_price  bid_price  ask_vol  bid_vol  enable_margin  mortgage_ratio  long_margin_initial_ratio  enable_short_sell  short_sell_rate  short_available_volume  short_margin_initial_ratio  amplitude  avg_price  bid_ask_ratio  volume_ratio  highest52weeks_price  lowest52weeks_price  highest_history_price  lowest_history_price  close_price_5min  after_volume  after_turnover sec_status  equity_valid  issued_shares  total_market_val     net_asset    net_profit  earning_per_share  outstanding_shares  circular_market_val  net_asset_per_share  ey_ratio  pe_ratio  pb_ratio  pe_ttm_ratio  dividend_ttm  dividend_ratio_ttm  dividend_lfy  dividend_lfy_ratio  wrt_valid  wrt_conversion_ratio wrt_type  wrt_strike_price  wrt_maturity_date  wrt_end_trade  wrt_recovery_price  wrt_street_vol  \
0  HK.00700  TENCENT      2025-04-07 16:09:07      435.40      441.80      462.40     431.00            497.80  123364114  5.499476e+10          1.341       False   2004-06-16       100          0.20          NaN      435.4     435.20   281300    17300            NaN             NaN                        NaN                NaN              NaN                     NaN                         NaN      6.308    445.792        -68.499         5.627             547.00000           294.400000             706.100065            -13.202011            431.60             0    0.000000e+00     NORMAL          True     9202391012      4.006721e+12  1.051300e+12  2.095753e+11             22.774          9202391012         4.006721e+12              114.242     0.199    19.118     3.811        19.118          3.48                0.80          3.48               0.799      False                   NaN      N/A               NaN                NaN            NaN                 NaN             NaN   
1   US.AAPL    APPLE  2025-04-07 05:30:43.301      188.38      193.89      199.88     187.34            203.19  125910913  2.424473e+10          0.838       False   1980-12-12         1          0.01          NaN      180.8     180.48       29      400            NaN             NaN                        NaN                NaN              NaN                     NaN                         NaN      6.172    192.554         86.480         2.226             259.81389           163.300566             259.813890              0.053580            188.93       3151311    5.930968e+08     NORMAL          True    15022073000      2.829858e+12  6.675809e+10  9.133420e+10              6.080         15016677308         2.828842e+12                4.444     1.417    30.983    42.389        29.901          0.99                0.53          0.98               0.520      False                   NaN      N/A               NaN                NaN            NaN                 NaN             NaN   

   wrt_issue_vol  wrt_street_ratio  wrt_delta  wrt_implied_volatility  wrt_premium  wrt_leverage  wrt_ipop  wrt_break_even_point  wrt_conversion_price  wrt_price_recovery_ratio  wrt_score  wrt_upper_strike_price  wrt_lower_strike_price wrt_inline_price_status  wrt_issuer_code  option_valid option_type  strike_time  option_strike_price  option_contract_size  option_open_interest  option_implied_volatility  option_premium  option_delta  option_gamma  option_vega  option_theta  option_rho  option_net_open_interest  option_expiry_date_distance  option_contract_nominal_value  option_owner_lot_multiplier option_area_type  option_contract_multiplier index_option_type  index_valid  index_raise_count  index_fall_count  index_equal_count  plate_valid  plate_raise_count  plate_fall_count  plate_equal_count  future_valid  future_last_settle_price  future_position  future_position_change  future_main_contract  future_last_trade_time  trust_valid  trust_dividend_yield  trust_aum  \
0            NaN               NaN        NaN                     NaN          NaN           NaN       NaN                   NaN                   NaN                       NaN        NaN                     NaN                     NaN                     N/A              NaN         False         N/A          NaN                  NaN                   NaN                   NaN                        NaN             NaN           NaN           NaN          NaN           NaN         NaN                       NaN                          NaN                            NaN                          NaN              N/A                         NaN               N/A        False                NaN               NaN                NaN        False                NaN               NaN                NaN         False                       NaN              NaN                     NaN                   NaN                     NaN        False                   NaN        NaN   
1            NaN               NaN        NaN                     NaN          NaN           NaN       NaN                   NaN                   NaN                       NaN        NaN                     NaN                     NaN                     N/A              NaN         False         N/A          NaN                  NaN                   NaN                   NaN                        NaN             NaN           NaN           NaN          NaN           NaN         NaN                       NaN                          NaN                            NaN                          NaN              N/A                         NaN               N/A        False                NaN               NaN                NaN        False                NaN               NaN                NaN         False                       NaN              NaN                     NaN                   NaN                     NaN        False                   NaN        NaN   

   trust_outstanding_units  trust_netAssetValue  trust_premium trust_assetClass pre_price pre_high_price pre_low_price pre_volume pre_turnover pre_change_val pre_change_rate pre_amplitude after_price after_high_price after_low_price after_change_val after_change_rate after_amplitude overnight_price overnight_high_price overnight_low_price overnight_volume overnight_turnover overnight_change_val overnight_change_rate overnight_amplitude  
0                      NaN                  NaN            NaN              N/A       N/A            N/A           N/A        N/A          N/A            N/A             N/A           N/A         N/A              N/A             N/A              N/A               N/A             N/A             N/A                  N/A                 N/A              N/A                N/A                  N/A                   N/A                 N/A  
1                      NaN                  NaN            NaN              N/A    180.68         181.98        177.47     276016  49809244.83           -7.7          -4.087         2.394       186.6          188.639          186.44            -1.78            -0.944          1.1673          176.94                186.5               174.4           533115        94944250.56               -11.44                -6.072              6.4231  
HK.00700
['HK.00700', 'US.AAPL']
1
2
3
4
5
6
7
8
9
10
11
12
13

Interface Limitations

  • Request up to 60 snapshots every 30 seconds
  • For each request, the maximum number of stock codes supported by the parameter code_list is 400.
  • Under the authority of Hong Kong stock BMP, the maximum number of snapshots of Hong Kong securities (including warrants, CBBC, and Inline Warrants) for a single request is 20
  • Under the authority of Hong Kong futures and options BMP, the maximum number of snapshots of Hong Kong futures and options for a single request is 20