Skip to content

Capital Flow (History)

GET /v1/quote/{symbol}/capital-flow/history

Get historical capital flow in/out data at day/week/month level for an individual stock.

Parameters

NameTypeInRequiredDescription
symbolstringpathyesSymbol code, MARKET.CODE format, e.g. HK.00700 / US.AAPL / SZ.000001.
period_typestringquerynoAggregation period, default DAY. See Naming Dictionary.
startstringquerynoStart date yyyy-MM-dd (inclusive), omit for no lower bound.
endstringquerynoEnd date yyyy-MM-dd (inclusive), omit to use current date.
countintquerynoMaximum number of data points to return, range 1~1000, default 365.

Request Example

bash
curl '$ip/v1/quote/HK.00700/capital-flow/history?period_type=DAY&start=2026-04-23&end=2026-05-23' | jq

Response Fields

Top-level data:

FieldTypeDescription
flow_listarrayData point list, sorted by time ascending; empty array when symbol is valid but no data currently.

Top-level pagination:

FieldTypeDescription
has_moreboolWhether there is more earlier data available for pagination (paginate towards earlier dates).

flow_list[i]:

FieldTypeDescription
capital_flow_item_timeint64Data time point (millisecond timestamp, aligned to day / week / month per period_type).
in_flowdoubleOverall net inflow (in security's local currency; positive = net inflow, negative = net outflow).
main_in_flowdoubleMain force net inflow (super-large + large orders combined).
super_in_flowdoubleSuper-large orders net inflow.
big_in_flowdoubleLarge orders net inflow.
mid_in_flowdoubleMedium orders net inflow.
sml_in_flowdoubleSmall orders net inflow.
main_deal_ratiodoubleMain force transaction ratio (0.123 = 12.3%); provided by backend on demand, omitted when absent.
acc_main_in_flowdoubleAccumulated main force net inflow; provided by backend on demand, omitted when absent.

Supported Markets

DimensionSupportedNot Supported / No Data Currently
Market (Stocks / ETFs)HK · US · SH · SZ · SG · JP · CA · AUKR · MY · BJ (some codes parseable but no capital flow data currently)
CategoryStocks, ETFsIndices, warrants (valid symbol but flow_list always empty); options / futures / cryptocurrencies (not supported)
Time RangeDay / week / month aggregation, specify start / end rangeFor intraday minute-level data use Capital Flow (Intraday) API
PaginationVia pagination.has_more + adjusting end to paginate towards earlier dates

When a symbol is valid but has no capital flow data (warrants / indices / suspended / pre-listing / no trades in range), the API returns ret_code=0, flow_list=[], pagination.has_more=false.

Error Codes

ret_codeerror.codeTrigger ScenarioSuggested Handling
0Success (including valid symbol with no data, flow_list=[])Check flow_list length to determine if data exists
-3invalid_parametersymbol does not match MARKET.CODE format / period_type not in DAY/WEEK/MONTH / start or end not a valid calendar date / count out of rangeValidate parameters and retry
-7invalid_symbolSymbol format is valid but not found in security cache (does not exist / typo / unsupported market like KR / MY)Verify symbol actually exists
-8unsupportedBackend explicitly returns market does not support historical capital flowUse a symbol from a supported market

Response Example

json
{
  "ret_code": 0,
  "ret_msg": "success",
  "data": {
    "flow_list": [
      {
        "capital_flow_item_time": 1776873600000,
        "in_flow": 200218920,
        "main_in_flow": 24536730,
        "super_in_flow": 6079988.56,
        "big_in_flow": 23699631.17,
        "mid_in_flow": 21197077.81,
        "sml_in_flow": -11104470.93,
        "main_deal_ratio": 0.2259
      }
    ]
  },
  "pagination": {
    "has_more": false
  }
}