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
| Field | Type | Required | Description |
|---|---|---|---|
connection_ids | string | No | Comma-separated connection ids to include, such as bconn_a,bconn_b. Defaults to every active connection. |
include_cas | string | No | Send 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
| Field | Type | Description |
|---|---|---|
as_of | string | When the figures were taken, ISO 8601. |
total_value_minor | integer | Total market value in paise. |
by_asset_class | array | Weights by asset class. |
by_asset_class[].label | string | Asset class. |
by_asset_class[].value_minor | integer | Market value in paise. |
by_asset_class[].weight_percent | number | Share of the portfolio by value. |
by_asset_class[].holding_count | integer | Holdings in this class. |
by_source | array | Weights by broker connection or imported statement; same fields as by_asset_class. |
concentration | object | How concentrated the portfolio is. |
concentration.top_holding | object | The largest holding, with label, value_minor, weight_percent and holding_count; null when empty. |
concentration.top5_weight_percent | number | Combined weight of the five largest holdings. |
concentration.hhi | number | Herfindahl-Hirschman index from 0 to 10000; 10000 is a single holding and about 500 or less is well spread. |
concentration.effective_holdings | number | 10000 divided by hhi: the number of equally sized holdings that would be as concentrated. |
warnings | array | Non-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.