API reference / Portfolio+

Allocation + concentration

Weights by asset class and by broker, plus the concentration a plain P&L screen hides: largest holding, top-5 weight, HHI and effective holdings.

GET/v1/portfolio/allocation
Authentication
Bearer token
Scope
portfolio:read

Query parameters

FieldTypeRequiredDescription
connection_idsstringNoComma-separated connection ids to include, such as bconn_a,bconn_b. Defaults to every active connection.
include_casstringNoSend false to leave the imported statement out and use broker accounts only. Defaults to true.

Sample code

Set your key in the GRAPPI_API_KEY environment variable. Sample values are placeholders.

curl -sS -X GET 'https://grappi.ai/v1/portfolio/allocation' \
  -H "Authorization: Bearer $GRAPPI_API_KEY"

Sample response

{
  "request_id": "req_01HZY3K8M2",
  "result": {
    "as_of": "2026-11-07T09:30:00.000Z",
    "total_value_minor": 8837035,
    "by_asset_class": [
      {
        "label": "equity",
        "value_minor": 4425000,
        "weight_percent": 50.07,
        "holding_count": 1
      },
      {
        "label": "mutual_fund",
        "value_minor": 4412035,
        "weight_percent": 49.93,
        "holding_count": 1
      }
    ],
    "by_source": [
      {
        "label": "zerodha (live)",
        "value_minor": 2950000,
        "weight_percent": 33.38,
        "holding_count": 1
      },
      {
        "label": "upstox (live)",
        "value_minor": 1475000,
        "weight_percent": 16.69,
        "holding_count": 1
      },
      {
        "label": "Imported statement",
        "value_minor": 4412035,
        "weight_percent": 49.93,
        "holding_count": 1
      }
    ],
    "concentration": {
      "top_holding": {
        "label": "RELIANCE",
        "value_minor": 4425000,
        "weight_percent": 50.07,
        "holding_count": 1
      },
      "top5_weight_percent": 100,
      "hhi": 5000,
      "effective_holdings": 2
    },
    "warnings": []
  }
}

Response fields

FieldTypeDescription
as_ofstringWhen the figures were taken, ISO 8601.
total_value_minorintegerTotal market value in paise.
by_asset_classarrayWeights by asset class.
by_asset_class[].labelstringAsset class.
by_asset_class[].value_minorintegerMarket value in paise.
by_asset_class[].weight_percentnumberShare of the portfolio by value.
by_asset_class[].holding_countintegerHoldings in this class.
by_sourcearrayWeights by broker connection or imported statement; same fields as by_asset_class.
concentrationobjectHow concentrated the portfolio is.
concentration.top_holdingobjectThe largest holding, with label, value_minor, weight_percent and holding_count; null when empty.
concentration.top5_weight_percentnumberCombined weight of the five largest holdings.
concentration.hhinumberHerfindahl-Hirschman index from 0 to 10000; 10000 is a single holding and about 500 or less is well spread.
concentration.effective_holdingsnumber10000 divided by hhi: the number of equally sized holdings that would be as concentrated.
warningsarrayNon-fatal problems, such as a broker that could not be read.

Errors

Every failure has the same shape. A call that fails on our side or at the data source is refunded to your wallet; a "no record found" answer is charged. See the error reference.