Skip to Main Content
POST/NorenWClientAPI/GetOptionChain

Option Chain

Fetch the full strike-wise option chain for an underlying and expiry, with LTP and OI per strike.

Overview

Option Chain returns calls and puts across a strike range for a given underlying and expiry in one call, instead of requiring a separate quote lookup per strike.

Purpose

Use this to build strike selection logic (e.g. nearest-to-ATM, delta-based) at strategy startup or on each expiry rollover. For live-updating chains, resolve the token list here once, then subscribe to those tokens on Subscribe to Market Feed rather than re-calling this endpoint in a loop.

Parameters

FieldTypeRequiredDescription
exchstringrequiredExchange segment, e.g. NFO.
tsymstringrequiredUnderlying trading symbol, e.g. NIFTY.
strprcnumberrequiredCenter strike price for the returned range.
cntintegeroptionalNumber of strikes above/below center to return. Default 10.

Request example

import requests

params = {"exch": "NFO", "tsym": "NIFTY", "strprc": "24000", "cnt": "10"}
headers = {"Authorization": f"Bearer {Acesstoken}"}
resp = requests.post("https://api.shoonya.com/NorenWClientAPI/GetOptionChain",
                      json=params, headers=headers)
print(resp.json())
const res = await fetch("https://api.shoonya.com/NorenWClientAPI/GetOptionChain", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: `Bearer ${Acesstoken}` },
  body: JSON.stringify({ exch: "NFO", tsym: "NIFTY", strprc: "24000", cnt: "10" }),
});
console.log(await res.json());
curl -X POST https://api.shoonya.com/NorenWClientAPI/GetOptionChain \
  -H "Authorization: Bearer $Acesstoken" \
  -H "Content-Type: application/json" \
  -d '{"exch":"NFO","tsym":"NIFTY","strprc":"24000","cnt":"10"}'

Response example

json
{
  "stat": "Ok",
  "values": [
    { "tsym": "NIFTY24DEC24000CE", "strprc": "24000", "optt": "CE", "token": "48291", "lp": "182.35", "oi": "1245600" },
    { "tsym": "NIFTY24DEC24000PE", "strprc": "24000", "optt": "PE", "token": "48292", "lp": "97.10",  "oi": "980200" }
  ]
}

Error handling

CodeMeaning
Invalid_InputUnderlying symbol not found, or no contracts exist near the given strike.

Best practices

  • Cache the chain per underlying+expiry for the session — strikes and tokens don't change intraday, only prices do.
  • Use Expiry Data first to confirm the exact expiry string format before requesting the chain.

Python example

python
from shoonya_api import ShoonyaClient

client = ShoonyaClient(session_token=Acesstoken)
chain = client.get_option_chain(exchange="NFO", symbol="NIFTY", strike=24000, count=10)
atm_ce = next(c for c in chain if c.strprc == 24000 and c.optt == "CE")
print(atm_ce.tsym, atm_ce.lp, atm_ce.oi)

Notes

oi (open interest) updates less frequently than lp — don't assume both fields refresh on the same cadence when building OI-based signals.