Holdings
Get portfolio holdings (delivery positions) with P&L information.
Endpoint URL
Local Host : POST http://127.0.0.1:5000/api/v1/holdings
Ngrok Domain : POST https://<your-ngrok-domain>.ngrok-free.app/api/v1/holdings
Custom Domain: POST https://<your-custom-domain>/api/v1/holdingsSample API Request
{
"apikey": "<your_app_apikey>"
}Sample cURL Request
curl -X POST http://127.0.0.1:5000/api/v1/holdings \
-H 'Content-Type: application/json' \
-d '{
"apikey": "<your_app_apikey>"
}'Sample API Response
Request Body
apikey
Your OpenAlgo API key
Mandatory
-
HoldingsSchema declares only apikey. Any other field returns HTTP 400.
Response Fields
status
string
"success" or "error"
data
object
Holdings data
Data Object Fields
holdings
array
Array of holding objects
statistics
object
Portfolio statistics
Holding Object Fields
symbol
string
Stock symbol
exchange
string
Exchange (NSE/BSE)
product
string
Product type (CNC)
quantity
number
Number of shares held
pnl
number
Profit/Loss in currency
pnlpercent
number
Profit/Loss percentage
Statistics Object Fields
totalholdingvalue
number
Current market value of holdings
totalinvvalue
number
Total investment value (cost)
totalprofitandloss
number
Total P&L in currency
totalpnlpercentage
number
Total P&L percentage
Notes
Holdings are delivery positions (CNC product type)
Different from PositionBook which shows intraday positions
pnl is calculated as: (Current Price - Average Buy Price) × Quantity
totalholdingvalue is the current market value of entire portfolio
Holdings persist across trading days (unlike MIS positions)
Use Cases
Portfolio tracking: View all delivery holdings
Wealth monitoring: Track total portfolio value
Performance analysis: Monitor overall P&L
Back to: API Documentation
Last updated
Was this helpful?