Skip to content

Option Chain

GET /option/optionChain

This API is used to search OptionChain for equity, derivatives and commodity scrips based on user provided search symbol and exchange name.

Parameters

NameTypeRequiredDescription
exchangestringfalseName of the exchange. Valid exchange values (NFO/ BFO/ MCX/ CDS/ MFO). If the user does not provide an exchange name, it is considered as NFO by default. For trading with BFO, MFO, CDS, and MCX, the exchange is mandatory.
searchSymbolNamestringtrueTrading Symbol of the scrip to be searched.
expiryDatestringfalseexpiryDate in yyyy-MM-dd format.
strikePricestringfalseThe strike price is the predetermined price at which a put buyer can sell the underlying asset.
optionTypestringfalseOption Type (PE/CE).

Sample Request Body

bash
curl -X GET 'https://tradeapi.samco.in/option/optionChain?exchange=NFO&searchSymbolName=NIFTY&strikePrice=25500&optionType=PE&expiryDate=2024-10-03' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-session-token: <SESSION_TOKEN>'
java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Sample {
  public static void main(String[] args) throws Exception {
    HttpClient client = HttpClient.newHttpClient();

    HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://tradeapi.samco.in/option/optionChain?exchange=NFO&searchSymbolName=NIFTY&strikePrice=25500&optionType=PE&expiryDate=2024-10-03"))
        .header("Content-Type", "application/json")
        .header("Accept", "application/json")
        .header("x-session-token", "<SESSION_TOKEN>")
        .GET()
        .build();

    HttpResponse<String> response =
        client.send(request, HttpResponse.BodyHandlers.ofString());
    System.out.println(response.body());
  }
}
js
(async () => {
  const headers = {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'x-session-token': '<SESSION_TOKEN>',
  };

  const response = await fetch('https://tradeapi.samco.in/option/optionChain?exchange=NFO&searchSymbolName=NIFTY&strikePrice=25500&optionType=PE&expiryDate=2024-10-03', {
    method: 'GET',
    headers,
  });

  const data = await response.json();
  console.log(data);
})();
py
import requests
import json

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-session-token': '<SESSION_TOKEN>',
}

r = requests.get('https://tradeapi.samco.in/option/optionChain?exchange=NFO&searchSymbolName=NIFTY&strikePrice=25500&optionType=PE&expiryDate=2024-10-03',
  headers=headers)

print(r.json())

Sample Responses

json
{
    "serverTime": "25/09/24 12:23:57",
    "msgId": "e2a12d98-3c93-4773-84a8-c82c722a9a6b",
    "status": "Success",
    "statusMessage": "OptionChain details retrived successfully. ",
    "optionChainDetails": [
        {
            "tradingSymbol": "NIFTY03OCT2425500PE",
            "exchange": "NFO",
            "symbol": "58534_NFO",
            "strikePrice": "25500.0000",
            "expiryDate": "2024-10-03",
            "instrument": "OPTIDX",
            "optionType": "PE",
            "underLyingSymbol": "NIFTY",
            "spotPrice": "25884.10",
            "lastTradedPrice": 52.55,
            "openInterest": 1312350,
            "openInterestInLot": 52494,
            "openInterestChange": 94825,
            "openInterestChangeInLot": 3793,
            "oichangePer": "7.79",
            "volume": 1620250,
            "impliedVolatility": "13.1337",
            "delta": "-0.187226",
            "gamma": "0.000530033",
            "theta": "-7.04959",
            "vega": "10.3883",
            "bestBids": [
                {
                    "number": 1,
                    "quantity": "200",
                    "price": "52.40"
                },
                {
                    "number": 2,
                    "quantity": "175",
                    "price": "52.35"
                },
                {
                    "number": 3,
                    "quantity": "600",
                    "price": "52.30"
                },
                {
                    "number": 4,
                    "quantity": "675",
                    "price": "52.25"
                },
                {
                    "number": 5,
                    "quantity": "2700",
                    "price": "52.20"
                }
            ],
            "bestAsks": [
                {
                    "number": 1,
                    "quantity": "250",
                    "price": "52.55"
                },
                {
                    "number": 2,
                    "quantity": "2275",
                    "price": "52.60"
                },
                {
                    "number": 3,
                    "quantity": "1650",
                    "price": "52.65"
                },
                {
                    "number": 4,
                    "quantity": "575",
                    "price": "52.70"
                },
                {
                    "number": 5,
                    "quantity": "550",
                    "price": "52.75"
                }
            ]
        }
    ]
}

Response Schema

Status Code 200

NameTypeDescription
serverTimestringTime at Server.
msgIdstringThis is a unique identifier for every request into the system. Please quote this identifier to the support team if you face issues with the API request.
statusstringThe status of the API response. It can be either 'Success' or 'Failure'
statusMessagestringA message describing the result of the API call.
optionChainDetails[object]Scrips details available for the provided search text.
tradingSymbolstringTrading Symbol of the scrip.
exchangestringName of the exchange. Valid exchanges values (BSE/ NSE/ NFO/ MCX/ CDS). If the user does not provide an exchange name, by default considered as NSE. For trading with BSE, NFO, CDS, and MCX, exchange is mandatory.
symbolstringSymbol Code of the trading Symbol.
strikePricestringThe strike price is the predetermined price at which a put buyer can sell the underlying asset.
expiryDatestringShows expiry date of a trading symbol.
instrumentstringInstrument Name.
optionTypestringOption Type (PE/CE).
underLyingSymbolstringRoot symbol of TradingSymbol.
spotPricestringSpot price. Applicable in case of Futures and Options.
lastTradedPricestringPrice at which last transaction/trade is done.
openIntereststringOpen interest is the number of existing contracts held by buyers or sellers for any market for any given day.
openInterestChangestringShows the open interest change in number of contracts held for the market.
oichangePerstringShows the percentage change based on open interest.
volumestringLimit amount of a security traded on the specific day.
impliedVolatilitystringThe market's expectation of future volatility of the underlying asset
deltastringMeasures the sensitivity of the F&O’s price to changes in the price of the underlying asset.
gammastringMeasures the rate of change of delta with respect to changes in the underlying asset's price.
thetastringMeasures the rate at which the F&O’s price decreases as it approaches expiration.
vegastringMeasures the sensitivity of the F&O’s price to changes in the volatility of the underlying asset.
bestBids[object]Most frequent trading bids for BUY.
numberstringSequence number for Bid/Ask.
quantitystringQuantity asked for trading.
pricestringPrice asked for trading.
bestAsks[object]Most frequent trading asks for SELL.
numberstringSequence number for Bid/Ask.
quantitystringQuantity asked for trading.
pricestringPrice asked for trading.