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
| Name | Type | Required | Description |
|---|---|---|---|
exchange | string | false | Name 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. |
searchSymbolName | string | true | Trading Symbol of the scrip to be searched. |
expiryDate | string | false | expiryDate in yyyy-MM-dd format. |
strikePrice | string | false | The strike price is the predetermined price at which a put buyer can sell the underlying asset. |
optionType | string | false | Option 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
| Name | Type | Description |
|---|---|---|
serverTime | string | Time at Server. |
msgId | string | This 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. |
status | string | The status of the API response. It can be either 'Success' or 'Failure' |
statusMessage | string | A message describing the result of the API call. |
optionChainDetails | [object] | Scrips details available for the provided search text. |
tradingSymbol | string | Trading Symbol of the scrip. |
exchange | string | Name 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. |
symbol | string | Symbol Code of the trading Symbol. |
strikePrice | string | The strike price is the predetermined price at which a put buyer can sell the underlying asset. |
expiryDate | string | Shows expiry date of a trading symbol. |
instrument | string | Instrument Name. |
optionType | string | Option Type (PE/CE). |
underLyingSymbol | string | Root symbol of TradingSymbol. |
spotPrice | string | Spot price. Applicable in case of Futures and Options. |
lastTradedPrice | string | Price at which last transaction/trade is done. |
openInterest | string | Open interest is the number of existing contracts held by buyers or sellers for any market for any given day. |
openInterestChange | string | Shows the open interest change in number of contracts held for the market. |
oichangePer | string | Shows the percentage change based on open interest. |
volume | string | Limit amount of a security traded on the specific day. |
impliedVolatility | string | The market's expectation of future volatility of the underlying asset |
delta | string | Measures the sensitivity of the F&O’s price to changes in the price of the underlying asset. |
gamma | string | Measures the rate of change of delta with respect to changes in the underlying asset's price. |
theta | string | Measures the rate at which the F&O’s price decreases as it approaches expiration. |
vega | string | Measures 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. |
number | string | Sequence number for Bid/Ask. |
quantity | string | Quantity asked for trading. |
price | string | Price asked for trading. |
bestAsks | [object] | Most frequent trading asks for SELL. |
number | string | Sequence number for Bid/Ask. |
quantity | string | Quantity asked for trading. |
price | string | Price asked for trading. |