# Get Research Analyst Consensus

get_research_analyst_consensus(code)

  • Description

    Get the analyst consensus rating, target price range and rating distribution for the specified stock over the past 3 months

  • Parameters

    Parameter Type Description
    code str Stock code
  • Return

    Parameter Type Description
    ret RET_CODE API call result
    data dict If ret == RET_OK, returns analyst consensus data dict
    str If ret != RET_OK, returns error description
    • The returned dict contains the following fields:

      Field Type Description
      highest float Highest target price
      average float Average target price
      lowest float Lowest target price
      rating ResearchRatingType Consensus rating
      total int Total analyst count
      update_time int Update timestamp
      update_time_str str Update date
      buy float Buy rating ratio
      hold float Hold rating ratio
      sell float Sell rating ratio
      strong_buy float Strong Buy ratio
      underperform float Underperform ratio
  • Example

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

ret, data = quote_ctx.get_research_analyst_consensus("HK.00700")
if ret == RET_OK:
    print(json.dumps(data, indent=2, ensure_ascii=False))
else:
    print('error:', data)
quote_ctx.close()
1
2
3
4
5
6
7
8
9
10
  • Output
{
  "highest": 820.0,
  "average": 716.0,
  "lowest": 579.51,
  "rating": 5,
  "total": 44,
  "update_time": 1778469178,
  "update_time_str": "2026-05-11",
  "buy": 22.727,
  "hold": 0.0,
  "sell": 0.0,
  "strong_buy": 77.273,
  "underperform": 0.0
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14

API Limitations

  • Maximum 30 requests per 30 seconds.
  • Supports common stocks and REITs.