Skip to main content

Get Holdings

API to retrieve the long term holdings of the user. A Holding within a holdings portfolio remains in place without a predetermined time limit. It can only be withdrawn when it is divested, delisted, or subject to modifications dictated by the stock exchanges. In essence, the instruments housed in the portfolio are securely located within the user's DEMAT account, in strict compliance with the regulations.

Request

curl --location 'https://api.upstox.com/v2/portfolio/long-term-holdings' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'

For additional samples in various languages, please refer to the Sample code section on this page.

Responses

Response Body

{
"status": "success",
"data": [
{
"isin": "INE528G01035",
"cnc_used_quantity": 0,
"collateral_type": "WC",
"company_name": "YES BANK LTD.",
"haircut": 0.2,
"product": "D",
"quantity": 36,
"trading_symbol": "YESBANK",
"tradingsymbol": "YESBANK",
"last_price": 17.05,
"close_price": 17.05,
"pnl": -61.2,
"day_change": 0,
"day_change_percentage": 0,
"instrument_token": "NSE_EQ|INE528G01035",
"average_price": 18.75,
"collateral_quantity": 0,
"collateral_update_quantity": 0,
"t1_quantity": 0,
"exchange": "NSE"
},
{
"isin": "INE036A01016",
"cnc_used_quantity": 0,
"collateral_type": "WC",
"company_name": "RELIANCE INFRASTRUCTURE LTD.",
"haircut": 1,
"product": "D",
"quantity": 1,
"trading_symbol": "RELINFRA",
"tradingsymbol": "RELINFRA",
"last_price": 174.85,
"close_price": 169.2,
"pnl": -17.7,
"day_change": 0,
"day_change_percentage": 0,
"instrument_token": "NSE_EQ|INE036A01016",
"average_price": 192.55,
"collateral_quantity": 0,
"collateral_update_quantity": 0,
"t1_quantity": 0,
"exchange": "NSE"
}
]
}
NameTypeDescription
statusstringA string indicating the outcome of the request. Typically success for successful operations.
dataobject[]Response data for holdings
data[].isinstringThe standard ISIN representing stocks listed on multiple exchanges
data[].cnc_used_quantityint32Quantity either blocked towards open or completed order
data[].collateral_typestringCategory of collateral assigned by RMS
data[].company_namestringName of the company
data[].haircutfloatThis is the haircut percentage applied from RMS (applicable incase of collateral)
data[].productstringSignifies if the order was either Intraday, Delivery or CO.
Possible values: I, D, CO, MTF.
data[].quantityint32The total holding qty
data[].trading_symbolstringShows the trading symbol of the instrument
data[].last_pricefloatThe last traded price of the instrument
data[].close_pricefloatClosing price of the instrument from the last trading day
data[].pnlfloatProfit and Loss
data[].day_changefloatDay's change in absolute value for the stock
data[].day_change_percentagefloatDay's change in percentage for the stock
data[].instrument_tokenstringKey of the instrument. For the regex pattern applicable to this field, see the Field Pattern Appendix.
data[].average_pricefloatAverage price at which the net holding quantity was acquired
data[].collateral_quantityint32Quantity marked as collateral by RMS on users request
data[].collateral_update_quantityint32Updated collateral quantity
data[].t1_quantityint32Quantity on T+1 day after order execution
data[].exchangestringExchange to which the order is associated. Valid exchanges can be found in the Exchange Appendix

Sample Code

import requests

url = 'https://api.upstox.com/v2/portfolio/long-term-holdings'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
}

response = requests.get(url, headers=headers)

print(response.json())

Loading...