# Get Macro Indicator History

get_macro_indicator_history(indicator_id, time=None, max_count=None)

  • Description

    Get macro indicator history. Returns the historical data point list of the specified macro indicator, including data date, release date, actual value, forecast value, previous value, etc., sorted by time in descending order.

  • Parameters

    Parameter Type Description
    indicator_id int Macro indicator ID (from get_macro_indicator_list return) (required)
    time str Time point, format "yyyy-MM-dd", pulls data before this time; defaults to current time if not provided
    max_count int Number of records to pull, default 100, maximum 1000
  • 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
      data_time str Data date ("yyyy-MM-dd")
      release_time str Release date ("yyyy-MM-dd HH:mm:ss")
      value float Actual value (restored to original value)
      predict_value float Forecast value (restored)
      previous_value float Previous value (restored)
      unit_type str Unit type (PERCENT=percentage / VALUE=value / INDEX=index)
  • Example

from futu import *

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

# First get indicator ID
ret, indicators = quote_ctx.get_macro_indicator_list(region=MacroRegion.US)
if ret == RET_OK:
    indicator_id = indicators.iloc[0]['indicator_id']

    # Query historical data
    ret, data = quote_ctx.get_macro_indicator_history(indicator_id=indicator_id, max_count=2)
    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
data_time         release_time   value predict_value  previous_value unit_type
0  2026-05-01  2026-06-11 20:34:01  0.0642           N/A          0.0566   PERCENT
1  2026-04-01  2026-05-13 20:31:01  0.0566           N/A          0.0427   PERCENT
1
2
3

API Limits

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