Read Holdings
Read live holdings for any supported broker account, in a broker independent format.
https://apix.stocksdeveloper.in/trading/readPlatformHoldings Read Holdings returns the live holdings for the trading account mapped to a pseudo account. The same call works across every client language and supported broker. Each holding includes quantity, average price, P&L, ISIN and collateral details. Cache the result and reuse it to stay within the rate limits.
This call reads holdings from your trading platform. It returns data for the trading account linked to the pseudo account you pass in.
The same call is available across all supported brokers, so your code stays broker independent. See API functions for the full list.
Code samples
HTTP
Example
curl https://apix.stocksdeveloper.in/trading/readPlatformHoldings \
-H "api-key: <your-api-key>" \
-d "pseudoAccount=ACC_NAME"The response is JSON, in the format shown under Response. Each holding carries the Holding fields listed below.
Python
Signature
def read_platform_holdings(self, pseudo_account):Example
response = autotrader.read_platform_holdings('XX1234')
if response.success():
# response.result is a list of PlatformHolding objects
for h in response.result:
print(h.symbol, h.quantity, h.pnl, h.isin)
else:
print("Message: {0}".format(response.message))response.result is a list of holding objects. Read each field with object.property notation — every field is listed under Holding fields.
Java
Signature
/**
* Read holdings from the trading account mapped to the given pseudo account.
*
* @param pseudoAccount pseudo account id
* @return trading platform holdings
*/
IOperationResponse<Set<PlatformHolding>>
readPlatformHoldings(final String pseudoAccount);Example
IOperationResponse<Set<PlatformHolding>> response =
this.autotrader.readPlatformHoldings("ACC_NAME");
Set<PlatformHolding> holdings = null;
if (response.success()) {
holdings = response.getResult();
}Use getResult() to get the set of holdings. Each PlatformHolding exposes the Holding fields below through getters such as getQuantity().
C#
Signature
/// <summary>
/// Read holdings from the trading account mapped to the given pseudo account.
/// </summary>
/// <param name="pseudoAccount"> pseudo account id </param>
/// <returns> trading platform holdings </returns>
IOperationResponse<ISet<PlatformHolding>> ReadPlatformHoldings(
string pseudoAccount);Example
IOperationResponse<ISet<PlatformHolding>> response =
autoTrader.ReadPlatformHoldings("XX1234");
foreach (PlatformHolding h in response.Result)
Console.WriteLine("{0}", h);Use the Result property to get the set of holdings. Each PlatformHolding exposes the Holding fields below as properties such as Quantity.
Excel
Signature
Excel exposes one function per field. They all take the same arguments:
Public Function GetHoldingQuantity(pseudoAccount As String, _
symbol As String) As LongEvery field in Holding fields has a matching GetHolding<Field> function (for example GetHoldingPnl, GetHoldingLtp, GetHoldingAvgPrice).
AmiBroker
Signature
AmiBroker exposes one function per field. They all take the same arguments:
function getHoldingQuantity(pseudoAccount, symbol)Example
quantity = getHoldingQuantity(AT_ACCOUNT, "WIPRO");
pnl = getHoldingPnl(AT_ACCOUNT, "WIPRO");
avgPrice = getHoldingAvgPrice(AT_ACCOUNT, "WIPRO");Every field in Holding fields has a matching getHolding<Field> function.
MetaTrader
Signature
MetaTrader exposes one function per field. They all take the same arguments:
long getHoldingQuantity(string pseudoAccount, string symbol)Example
long quantity = getHoldingQuantity(AT_ACCOUNT, "WIPRO");
double pnl = getHoldingPnl(AT_ACCOUNT, "WIPRO");
double avgPrice = getHoldingAvgPrice(AT_ACCOUNT, "WIPRO");Every field in Holding fields has a matching getHolding<Field> function.
Response
The call returns an array of holdings in JSON.
{
"result":[
{
"isin":"INE075A01022",
"collateralType":"--",
"instrumentToken":"3787",
"product":"CNC",
"quantity":0,
"collateralQty":0,
"t1Qty":1,
"pnl":null,
"haircut":0.0,
"avgPrice":0.0,
"pseudoAccount":"XX9999",
"tradingAccount":"XX9999",
"stockBroker":"YOUR_BROKER",
"exchange":"<exchange>",
"symbol":"WIPRO-EQ",
"platform":"PLATFORM",
"day":[2021,2,24]
}
],
"message":null,
"status":true,
"commandId":"2335425e-da65-462b-a898-6c139833bb9b"
}
status is true on success. On error it is false, and message holds the error text.
Holding fields
Each holding carries the fields below. They are the same across every language: the libraries expose them as object properties (Python, Java, C#) or as a getHolding<Field> function (Excel, AmiBroker, MetaTrader), and the HTTP response returns them as JSON keys.
| Field | Type | Description |
|---|---|---|
pseudoAccount | string | The pseudo account the holding belongs to. |
tradingAccount | string | The mapped trading account id. |
stockBroker | string | The stock broker for this account. |
exchange | string | Broker specific exchange. |
symbol | string | Broker specific symbol. |
isin | string | ISIN of the instrument. |
instrumentToken | string | Broker instrument token. |
product | string | Product type for the holding. |
quantity | int | Total holding quantity. |
t1Qty | int | T1 quantity (not yet settled). |
collateralType | string | Collateral type, if pledged. |
collateralQty | int | Quantity pledged as collateral. |
haircut | float | Collateral haircut. |
avgPrice | float | Average buy price. |
ltp | float | Last traded price. |
currentValue | float | Current market value of the holding. |
pnl | float | Net returns on the holding. |
day | date | Holding date. |
platform | enum | Trading platform the holding belongs to. |
Notes
It is recommended to download and cache holdings periodically, then look up the cached set, to avoid hitting the API rate limits.
P&L data is not available from certain brokers (see limitations). In those cases, the values you see are calculated by our system. If you notice any issue, please let us know.
Thanks for the feedback. Still stuck? Contact support.
Last updated 20 June 2026