Skip to content

Positions

Positions are your short to medium-term investments, including futures, options, and intraday stocks. You keep these positions until you sell them or they expire (usually about three months for derivatives).

If you hold stocks overnight, they move to your long-term holdings the next day. The API provides two sets of information: "open_positions" which shows your open position and "closed_positions" which shows your closed position. This helps you track profits and losses effectively.

Sample code

curl --location 'https://easeapi.venturasecurities.com/portfolio/v1/positions' \
--header 'x-client-id: AA0605' \
--header 'x-app-key: 8ab5rt7yp2lm9qw4s1ex' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...' 
import requests

url = "https://easeapi.venturasecurities.com/portfolio/v1/positions"

payload = {}
headers = {
  'x-app-key': '8ab5rt7yp2lm9qw4s1ex',
  'x-client-id': 'AA0605',
  'Content-Type': 'application/json',
  'Authorization': 'Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
const axios = require('axios');

let config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://easeapi.venturasecurities.com/portfolio/v1/positions',
  headers: { 
      'x-client-id': 'AA0605', 
      'x-app-key': '8ab5rt7yp2lm9qw4s1ex', 
      'Authorization': 'Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...'
  }
};

axios.request(config)
.then((response) => {
    console.log(JSON.stringify(response.data));
})
.catch((error) => {
    console.log(error);
});

Response

{
  "result": {
    "open_positions": [
      {
        "type": "Stock",
        "symbol": "ITC",
        "token": "1660",
        "last_traded_price": 438.15,
        "exchange": "NSE",
        "segment": "E",
        "action": "SELL",
        "product_type": "I",
        "average_traded_price": 440.7,
        "total_quantity": -5,
        "profit_loss": 12.75,
        "lot_size": 1,
        "instrument_type": "",
        "expiry_date": "",
        "expiry_type": "",
        "option_type": "",
        "strike_price": ""
      }
    ],
    "closed_positions": [
      {
        "type": "Stock",
        "symbol": "ADANIENT",
        "token": "25",
        "last_traded_price": 2399.00,
        "exchange": "NSE",
        "segment": "E",
        "action": "SELL",
        "product_type": "M",
        "average_traded_price": 0.0,
        "total_quantity": 0,
        "profit_loss": -16.1,
        "lot_size": 1,
        "instrument_type": "",
        "expiry_date": "",
        "expiry_type": "",
        "option_type": "",
        "strike_price": ""
      }
    ]
  },
  "error_message": ""
}

Response parameters

Parameter
Description
type It specifies the instrument type, either "Stock" for equity or "NFO" for derivatives
symbol It refers to the instrument name
token It is the unique token number assigned to each tradable instrument
last_traded_price It is the last traded price of the instrument
exchange The exchange where the instrument is traded, either "NSE" for National Stock Exchange or "BSE" for Bombay Stock Exchange
segment It indicates the segment of the exchange, "E" for equity or "D" for derivatives
action It specifies the type of transaction, "B" for Buy or "S" for Sell.
product_type Specifies the product type, such as intraday ("I"), margin ("M"), MTF ("F"), Cash and Carry ("C").
average_traded_price It gives the average price of an order when multiple quantities are executed at different prices
total_quantity It gives the total quantity of the order
profit_loss It indicates the profit and loss of the position
lot_size It gives the lot size of the instrument
instrument_type It is the instrument type if the instrument is of NFO type
expiry_date It shows the expiry date of the instrument if it's a derivative (NFO)
expiry_type Returns the expiry type of the derivative instrument
option_type It indicates the option type (Call or Put) if the instrument is a derivative option
strike_price It shows the strike price of the option instrument