API reference / Depository / Broker

Holdings

Normalized DEMAT holdings + P&L, same shape for every broker.

GET/v1/broker/holdings
Authentication
Bearer token
Scope
broker:read

Before you integrate

  • The result is a list. The shape is the same for every broker. Send connection_id, or broker for a quick sandbox test.

Query parameters

FieldTypeRequiredDescription
connection_idstringNoThe connection to use, as returned by connect (3 to 64 characters). Send this or broker.
brokerstringNoQuick sandbox test with no connection, by broker name (2 to 30 characters). One of: zerodha, angel, dhan, upstox, groww, motilal, fyers, shoonya, flattrade, xts, zebu, tradesmart, arrow. Send this or connection_id.

Sample code

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

curl -sS -X GET 'https://grappi.ai/v1/broker/holdings?broker=zerodha' \
  -H "Authorization: Bearer $GRAPPI_API_KEY"

Sample response

{
  "request_id": "req_01HZY3K8M2",
  "result": [
    {
      "isin": "INE123A01012",
      "symbol": "RELIANCE",
      "exchange": "NSE",
      "quantity": 10,
      "avg_cost_minor": 250000,
      "ltp_minor": 295000,
      "market_value_minor": 2950000,
      "pnl_minor": 450000
    }
  ]
}

Response fields

FieldTypeDescription
[].isinstringSecurity ISIN.
[].symbolstringTrading symbol.
[].exchangestringExchange.
[].quantitynumberUnits held.
[].avg_cost_minorintegerAverage cost per unit in paise.
[].ltp_minorintegerLatest price per unit in paise.
[].market_value_minorintegerCurrent value in paise.
[].pnl_minorintegerProfit or loss in paise.

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.