# Get Institution Distribution

get_institution_distribution(market, institution_id)

  • Description

    Get institution distribution, returning the specified institution's position value and percentage data by industry classification.

  • Parameters

    Parameter Type Description
    market Market Market type (HK/US) (required)
    institution_id int Institution ID (obtained from get_institution_list) (required)
  • Return

    Parameter Type Description
    ret RET_CODE API call result
    data pd.DataFrame When ret == RET_OK, returns data
    str When ret != RET_OK, returns error description
    • Data format:
      Field Type Description
      industry_id int Industry ID
      industry_name str Industry name
      position_value float Holding market value
      portfolio_pct float Industry proportion (%)
  • Example

from futu import *

quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)

# First get institution ID
ret, data, _, _ = quote_ctx.get_institution_list(market=Market.US, count=1)
if ret == RET_OK and len(data) > 0:
    inst_id = data.iloc[0]['institution_id']

    # Query industry distribution
    ret, data = quote_ctx.get_institution_distribution(market=Market.US, institution_id=inst_id)
    if ret == RET_OK:
        print(data)
    else:
        print('error:', data)

quote_ctx.close()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  • Output
industry_id industry_name        position_value  portfolio_pct
0           6            电子  1319006433351.533936        19.8494
1          26           计算机   992844462205.649048        14.9411
2          12          医药生物   633746255374.343994         9.5371
3          27        互联网与传媒   484195469416.382996         7.2865
4          19          非银金融   481223610387.026001         7.2418
5         N/A            其他                   N/A        41.1441
1
2
3
4
5
6
7

API Limits

  • Maximum 60 requests within 30 seconds
  • Only the first page of paginated requests counts towards rate limiting