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
| Field | Type | Required | Description |
|---|---|---|---|
connection_id | string | No | The connection to use, as returned by connect (3 to 64 characters). Send this or broker. |
broker | string | No | Quick 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
| Field | Type | Description |
|---|---|---|
[].isin | string | Security ISIN. |
[].symbol | string | Trading symbol. |
[].exchange | string | Exchange. |
[].quantity | number | Units held. |
[].avg_cost_minor | integer | Average cost per unit in paise. |
[].ltp_minor | integer | Latest price per unit in paise. |
[].market_value_minor | integer | Current value in paise. |
[].pnl_minor | integer | Profit 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.