Portfolio Analytics

Get Holding Analytics

Batch (1-20) hierarchical attribution trees over holdings snapshots, computed in parallel per fund.

post/api/portfolio/holding-analytics

Request

  • Base URL
    https://api.harmoney.in
  • URL
    https://api.harmoney.in/api/portfolio/holding-analytics
  • Auth
    API key in header x-api-key

Request body

instrument_idsstring[] required

1-20 fund / portfolio unique_id values. Each fund is attributed independently — the response carries one InstrumentHoldingAnalytics entry per requested id.

frequency'monthly' | 'annual' | 'MAX' required

The grid the window is measured on. MAX measures a single period, weighting every holding at the window's open — ask for monthly unless that is what you want.

rolling_window'3M' | '6M' | '1Y' | '3Y'

Trailing lookback for rolling_return and rolling_return_contribution at each period-end. Limited to 3M / 6M / 1Y / 3Y — YTD and MAX shrink at each period, which breaks the compound arithmetic used for rolling metrics. Required for frequency in {monthly, annual}; must be omitted when frequency="MAX" (only one period-end exists, so rolling metrics cannot be computed).

group_bystring[] required

The pivot the tree is built over. rating and tenor suit debt funds, sector / industry / market_cap_category suit equity funds.

modesstring[]

Optional filter: which PeriodMetrics fields to include on every cell. None (default) returns all fields — backward-compatible with clients that render multiple attribution views client-side. Pass a subset (e.g. ["return_contribution", "weight"]) to shrink the response when only specific views are needed.

portfolio_metricsstring[]

Optional list of portfolio-level valuation metrics to compute from holdings snapshots. Each metric is aggregated as Σ(weight_i × metric_i) / Σ(weight_i) across eligible positions at each period-end, with a constituents list of the individual instruments that contributed. Currently supported: ytm (portfolio-weighted yield-to-maturity, debt positions only).

as_ofstring date

Mode A: last period-end for the tree window

horizon'1M' | '3M' | '6M' | 'YTD' | '1Y' | '3Y' | '5Y' | '10Y' | 'MAX'

Mode A: outer-window size — as_of − horizon becomes the tree window start. Full HorizonToken set including YTD and MAX. Independent of rolling_window.

start_datestring date

Mode B: first period-end for the tree window

end_datestring date

Mode B: last period-end for the tree window

Example request

{
  "instrument_ids": [
    "INS-HAQO5J6GGY"
  ],
  "as_of": "2026-06-30",
  "horizon": "1Y",
  "start_date": "2025-06-30",
  "end_date": "2026-06-30"
}

Response

Successful Response

requested_startstring date required
requested_endstring date required
effective_startstring date
effective_endstring date
as_ofstring date
horizon'1M' | '3M' | '6M' | 'YTD' | '1Y' | '3Y' | '5Y' | '10Y' | 'MAX'
frequency'monthly' | 'annual' | 'MAX' required
rolling_window'3M' | '6M' | '1Y' | '3Y'
group_bystring[] required
modesstring[]
portfolio_metricsstring[]

Changes

No recorded changes to this operation across all 1 revision of this API.