For the complete documentation index, see llms.txt. This page is also available as Markdown.

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/holdings

Sample 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

Parameter
Description
Mandatory/Optional
Default Value

apikey

Your OpenAlgo API key

Mandatory

-

Response Fields

Field
Type
Description

status

string

"success" or "error"

data

object

Holdings data

Data Object Fields

Field
Type
Description

holdings

array

Array of holding objects

statistics

object

Portfolio statistics

Holding Object Fields

Field
Type
Description

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

Field
Type
Description

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