Option Chain issue: Data not returning from

url = f"https://api.upstox.com/v2/option/chain"
params = {
    "instrument_key": instrument_key,
    "expiry_date": expiry_date
}
response = requests.get(url, headers=self.get_headers(), params=params)
response.raise_for_status()

Attaching the Result when called.

Request the team to look into it and reply asap,

@Anand_Sajankar

@Sonu_51669323 Try official code.

The same issue the API is giving the Option Contract in the 100t Steps.

{'data': [{'call_options': {'instrument_key': 'NSE_FO|62914',
                            'market_data': {'ask_price': 7454.15,
                                            'ask_qty': 75,
                                            'bid_price': 7360.05,
                                            'bid_qty': 75,
                                            'close_price': 7501.0,
                                            'ltp': 7389.0,
                                            'oi': 10875.0,
                                            'prev_oi': 6825.0,
                                            'volume': 4200},
                            'option_greeks': {'delta': 0.0,
                                              'gamma': 0.0,
                                              'iv': 0.0,
                                              'pop': 0.0,
                                              'theta': 0.0,
                                              'vega': 0.0}},
           'expiry': datetime.datetime(2026, 3, 31, 0, 0),
           'pcr': 2.069,
           'put_options': {'instrument_key': 'NSE_FO|62915',
                           'market_data': {'ask_price': 7.75,
                                           'ask_qty': 150,
                                           'bid_price': 6.75,
                                           'bid_qty': 450,
                                           'close_price': 9.05,
                                           'ltp': 6.75,
                                           'oi': 22500.0,
                                           'prev_oi': 20250.0,
                                           'volume': 3225},
                           'option_greeks': {'delta': 0.0,
                                             'gamma': 0.0,
                                             'iv': 0.0,
                                             'pop': 0.0,
                                             'theta': 0.0,
                                             'vega': 0.0}},
           'strike_price': 19000.0,
           'underlying_key': 'NSE_INDEX|Nifty 50',
           'underlying_spot_price': 23306.45},
          {'call_options': {'instrument_key': 'NSE_FO|62916',
                            'market_data': {'ask_price': 7110.0,
                                            'ask_qty': 150,
                                            'bid_price': 5433.5,
                                            'bid_qty': 75,
                                            'close_price': 0.0,
                                            'ltp': 0.0,
                                            'oi': 0.0,
                                            'prev_oi': 0.0,
                                            'volume': 0},
                            'option_greeks': {'delta': 0.0,
                                              'gamma': 0.0,
                                              'iv': 0.0,
                                              'pop': 0.0,
                                              'theta': 0.0,
                                              'vega': 0.0}},
           'expiry': datetime.datetime(2026, 3, 31, 0, 0),
           'pcr': None,
           'put_options': {'instrument_key': 'NSE_FO|62917',
                           'market_data': {'ask_price': 9.0,
                                           'ask_qty': 300,
                                           'bid_price': 8.65,
                                           'bid_qty': 75,
                                           'close_price': 8.2,
                                           'ltp': 9.0,
                                           'oi': 88350.0,
                                           'prev_oi': 88575.0,
                                           'volume': 12000},
                           'option_greeks': {'delta': 0.0,
                                             'gamma': 0.0,
                                             'iv': 0.0,
                                             'pop': 0.0,
                                             'theta': 0.0,
                                             'vega': 0.0}},
           'strike_price': 20000.0,
           'underlying_key': 'NSE_INDEX|Nifty 50',
           'underlying_spot_price': 23306.45},
          {'call_options': {'instrument_key': 'NSE_FO|62918',
                            'market_data': {'ask_price': 5485.95,
                                            'ask_qty': 75,
                                            'bid_price': 5460.2,
                                            'bid_qty': 75,
                                            'close_price': 5588.85,
                                            'ltp': 5480.0,
                                            'oi': 311175.0,
                                            'prev_oi': 277725.0,
                                            'volume': 46050},
                            'option_greeks': {'delta': 0.0,
                                              'gamma': 0.0,
                                              'iv': 0.0,
                                              'pop': 0.0,
                                              'theta': 0.0,
                                              'vega': 0.0}},
           'expiry': datetime.datetime(2026, 3, 31, 0, 0),
           'pcr': 1.4095,
           'put_options': {'instrument_key': 'NSE_FO|62919',
                           'market_data': {'ask_price': 8.9,
                                           'ask_qty': 300,
                                           'bid_price': 8.5,
                                           'bid_qty': 450,
                                           'close_price': 9.25,
                                           'ltp': 8.5,
                                           'oi': 438600.0,
                                           'prev_oi': 420975.0,
                                           'volume': 61500},
                           'option_greeks': {'delta': 0.0,
                                             'gamma': 0.0,
                                             'iv': 0.0,
                                             'pop': 0.0,
                                             'theta': 0.0,
                                             'vega': 0.0}},
           'strike_price': 21000.0,
           'underlying_key': 'NSE_INDEX|Nifty 50',
           'underlying_spot_price': 23306.45},
          {'call_options': {'instrument_key': 'NSE_FO|62920',
                            'market_data': {'ask_price': 4498.95,
                                            'ask_qty': 75,
                                            'bid_price': 4490.1,
                                            'bid_qty': 75,
                                            'close_price': 4602.6,
                                            'ltp': 4490.25,
                                            'oi': 225975.0,
                                            'prev_oi': 196875.0,
                                            'volume': 47100},
                            'option_greeks': {'delta': 0.0,
                                              'gamma': 0.0,
                                              'iv': 0.0,
                                              'pop': 0.0,
                                              'theta': 0.0,
                                              'vega': 0.0}},
           'expiry': datetime.datetime(2026, 3, 31, 0, 0),
           'pcr': 1.8334,
           'put_options': {'instrument_key': 'NSE_FO|62921',
                           'market_data': {'ask_price': 13.5,
                                           'ask_qty': 825,
                                           'bid_price': 13.4,
                                           'bid_qty': 300,
                                           'close_price': 13.55,
                                           'ltp': 13.5,
                                           'oi': 414300.0,
                                           'prev_oi': 394950.0,
                                           'volume': 91650},
                           'option_greeks': {'delta': 0.0,
                                             'gamma': 0.0,
                                             'iv': 0.0,
                                             'pop': 0.0,
                                             'theta': 0.0,
                                             'vega': 0.0}},
           'strike_price': 22000.0,
           'underlying_key': 'NSE_INDEX|Nifty 50',
           'underlying_spot_price': 23306.45},
          {'call_options': {'instrument_key': 'NSE_FO|62922',
                            'market_data': {'ask_price': 3518.55,
                                            'ask_qty': 150,
                                            'bid_price': 3502.4,
                                            'bid_qty': 450,
                                            'close_price': 3631.5,
                                            'ltp': 3521.9,
                                            'oi': 281400.0,
                                            'prev_oi': 224175.0,
                                            'volume': 98700},
                            'option_greeks': {'delta': 0.0,
                                              'gamma': 0.0,
                                              'iv': 0.0,
                                              'pop': 0.0,
                                              'theta': 0.0,
                                              'vega': 0.0}},
           'expiry': datetime.datetime(2026, 3, 31, 0, 0),
           'pcr': 3.0144,
           'put_options': {'instrument_key': 'NSE_FO|62923',
                           'market_data': {'ask_price': 24.45,
                                           'ask_qty': 225,
                                           'bid_price': 22.55,
                                           'bid_qty': 75,
                                           'close_price': 24.05,
                                           'ltp': 22.55,
                                           'oi': 848250.0,
                                           'prev_oi': 800625.0,
                                           'volume': 162000},
                           'option_greeks': {'delta': 0.0,
                                             'gamma': 0.0,
                                             'iv': 0.0,
                                             'pop': 0.0,
                                             'theta': 0.0,
                                             'vega': 0.0}},
           'strike_price': 23000.0,
           'underlying_key': 'NSE_INDEX|Nifty 50',
           'underlying_spot_price': 23306.45},
          {'call_options': {'instrument_key': 'NSE_FO|62924',
                            'market_data': {'ask_price': 2578.7,
                                            'ask_qty': 150,
                                            'bid_price': 2556.45,
                                            'bid_qty': 450,
                                            'close_price': 2685.05,
                                            'ltp': 2560.35,
                                            'oi': 182625.0,
                                            'prev_oi': 173850.0,
                                            'volume': 26925},
                            'option_greeks': {'delta': 0.0,
                                              'gamma': 0.0,
                                              'iv': 0.0,
                                              'pop': 0.0,
                                              'theta': 0.0,
                                              'vega': 0.0}},
           'expiry': datetime.datetime(2026, 3, 31, 0, 0),
           'pcr': 12.4205,
           'put_options': {'instrument_key': 'NSE_FO|62925',
                           'market_data': {'ask_price': 47.25,
                                           'ask_qty': 450,
                                           'bid_price': 46.0,
                                           'bid_qty': 75,
                                           'close_price': 45.4,
                                           'ltp': 47.0,
                                           'oi': 2268300.0,
                                           'prev_oi': 2274000.0,
                                           'volume': 168975},
                           'option_greeks': {'delta': 0.0,
                                             'gamma': 0.0,
                                             'iv': 0.0,
                                             'pop': 0.0,
                                             'theta': 0.0,
                                             'vega': 0.0}},
           'strike_price': 24000.0,
           'underlying_key': 'NSE_INDEX|Nifty 50',
           'underlying_spot_price': 23306.45},
          {'call_options': {'instrument_key': 'NSE_FO|62926',
                            'market_data': {'ask_price': 1677.0,
                                            'ask_qty': 75,
                                            'bid_price': 1657.4,
                                            'bid_qty': 75,
                                            'close_price': 1782.1,
                                            'ltp': 1660.85,
                                            'oi': 570600.0,
                                            'prev_oi': 564525.0,
                                            'volume': 91425},
                            'option_greeks': {'delta': 0.0,
                                              'gamma': 0.0,
                                              'iv': 0.0,
                                              'pop': 0.0,
                                              'theta': 0.0,
                                              'vega': 0.0}},
           'expiry': datetime.datetime(2026, 3, 31, 0, 0),
           'pcr': 3.1379,
           'put_options': {'instrument_key': 'NSE_FO|62927',
                           'market_data': {'ask_price': 116.5,
                                           'ask_qty': 51525,
                                           'bid_price': 116.0,
                                           'bid_qty': 300,
                                           'close_price': 107.5,
                                           'ltp': 116.5,
                                           'oi': 1790475.0,
                                           'prev_oi': 1752000.0,
                                           'volume': 260775},
                           'option_greeks': {'delta': 0.0,
                                             'gamma': 0.0,
                                             'iv': 0.0,
                                             'pop': 0.0,
                                             'theta': 0.0,
                                             'vega': 0.0}},
           'strike_price': 25000.0,
           'underlying_key': 'NSE_INDEX|Nifty 50',
           'underlying_spot_price': 23306.45},
          {'call_options': {'instrument_key': 'NSE_FO|62928',
                            'market_data': {'ask_price': 888.35,
                                            'ask_qty': 75,
                                            'bid_price': 882.1,
                                            'bid_qty': 75,
                                            'close_price': 980.0,
                                            'ltp': 883.35,
                                            'oi': 1263075.0,
                                            'prev_oi': 1185150.0,
                                            'volume': 216600},
                            'option_greeks': {'delta': 0.0,
                                              'gamma': 0.0,
                                              'iv': 0.0,
                                              'pop': 0.0,
                                              'theta': 0.0,
                                              'vega': 0.0}},
           'expiry': datetime.datetime(2026, 3, 31, 0, 0),
           'pcr': 1.4585,
           'put_options': {'instrument_key': 'NSE_FO|62929',
                           'market_data': {'ask_price': 313.0,
                                           'ask_qty': 75,
                                           'bid_price': 310.25,
                                           'bid_qty': 75,
                                           'close_price': 282.5,
                                           'ltp': 310.8,
                                           'oi': 1842225.0,
                                           'prev_oi': 1822725.0,
                                           'volume': 404625},
                           'option_greeks': {'delta': 0.0,
                                             'gamma': 0.0,
                                             'iv': 0.0,
                                             'pop': 0.0,
                                             'theta': 0.0,
                                             'vega': 0.0}},
           'strike_price': 26000.0,
           'underlying_key': 'NSE_INDEX|Nifty 50',
           'underlying_spot_price': 23306.45},
          {'call_options': {'instrument_key': 'NSE_FO|62930',
                            'market_data': {'ask_price': 346.0,
                                            'ask_qty': 75,
                                            'bid_price': 343.35,
                                            'bid_qty': 75,
                                            'close_price': 399.25,
                                            'ltp': 342.9,
                                            'oi': 2231175.0,
                                            'prev_oi': 1934925.0,
                                            'volume': 1030350},
                            'option_greeks': {'delta': 0.0,
                                              'gamma': 0.0,
                                              'iv': 0.0,
                                              'pop': 0.0,
                                              'theta': 0.0,
                                              'vega': 0.0}},
           'expiry': datetime.datetime(2026, 3, 31, 0, 0),
           'pcr': 0.5029,
           'put_options': {'instrument_key': 'NSE_FO|62931',
                           'market_data': {'ask_price': 748.3,
                                           'ask_qty': 75,
                                           'bid_price': 742.85,
                                           'bid_qty': 75,
                                           'close_price': 679.2,
                                           'ltp': 743.85,
                                           'oi': 1122150.0,
                                           'prev_oi': 807075.0,
                                           'volume': 524550},
                           'option_greeks': {'delta': 0.0,
                                             'gamma': 0.0,
                                             'iv': 0.0,
                                             'pop': 0.0,
                                             'theta': 0.0,
                                             'vega': 0.0}},
           'strike_price': 27000.0,
           'underlying_key': 'NSE_INDEX|Nifty 50',
           'underlying_spot_price': 23306.45},
          {'call_options': {'instrument_key': 'NSE_FO|62932',
                            'market_data': {'ask_price': 96.7,
                                            'ask_qty': 600,
                                            'bid_price': 96.5,
                                            'bid_qty': 825,
                                            'close_price': 114.85,
                                            'ltp': 96.6,
                                            'oi': 1246875.0,
                                            'prev_oi': 1254750.0,
                                            'volume': 239925},
                            'option_greeks': {'delta': 0.0,
                                              'gamma': 0.0,
                                              'iv': 0.0,
                                              'pop': 0.0,
                                              'theta': 0.0,
                                              'vega': 0.0}},
           'expiry': datetime.datetime(2026, 3, 31, 0, 0),
           'pcr': 0.3342,
           'put_options': {'instrument_key': 'NSE_FO|62933',
                           'market_data': {'ask_price': 1479.8,
                                           'ask_qty': 75,
                                           'bid_price': 1470.95,
                                           'bid_qty': 75,
                                           'close_price': 1373.85,
                                           'ltp': 1472.05,
                                           'oi': 416700.0,
                                           'prev_oi': 387225.0,
                                           'volume': 65325},
                           'option_greeks': {'delta': 0.0,
                                             'gamma': 0.0,
                                             'iv': 0.0,
                                             'pop': 0.0,
                                             'theta': 0.0,
                                             'vega': 0.0}},
           'strike_price': 28000.0,
           'underlying_key': 'NSE_INDEX|Nifty 50',
           'underlying_spot_price': 23306.45},
          {'call_options': {'instrument_key': 'NSE_FO|62935',
                            'market_data': {'ask_price': 25.6,
                                            'ask_qty': 525,
                                            'bid_price': 25.45,
                                            'bid_qty': 225,
                                            'close_price': 32.25,
                                            'ltp': 25.4,
                                            'oi': 773325.0,
                                            'prev_oi': 756750.0,
                                            'volume': 192075},
                            'option_greeks': {'delta': 0.0,
                                              'gamma': 0.0,
                                              'iv': 0.0,
                                              'pop': 0.0,
                                              'theta': 0.0,
                                              'vega': 0.0}},
           'expiry': datetime.datetime(2026, 3, 31, 0, 0),
           'pcr': 0.2332,
           'put_options': {'instrument_key': 'NSE_FO|62936',
                           'market_data': {'ask_price': 2384.4,
                                           'ask_qty': 75,
                                           'bid_price': 2364.35,
                                           'bid_qty': 300,
                                           'close_price': 2267.65,
                                           'ltp': 2379.3,
                                           'oi': 180375.0,
                                           'prev_oi': 160125.0,
                                           'volume': 61275},
                           'option_greeks': {'delta': 0.0,
                                             'gamma': 0.0,
                                             'iv': 0.0,
                                             'pop': 0.0,
                                             'theta': 0.0,
                                             'vega': 0.0}},
           'strike_price': 29000.0,
           'underlying_key': 'NSE_INDEX|Nifty 50',
           'underlying_spot_price': 23306.45},
          {'call_options': {'instrument_key': 'NSE_FO|62937',
                            'market_data': {'ask_price': 10.35,
                                            'ask_qty': 14925,
                                            'bid_price': 10.05,
                                            'bid_qty': 525,
                                            'close_price': 13.4,
                                            'ltp': 10.2,
                                            'oi': 507300.0,
                                            'prev_oi': 462225.0,
                                            'volume': 152100},
                            'option_greeks': {'delta': 0.0,
                                              'gamma': 0.0,
                                              'iv': 0.0,
                                              'pop': 0.0,
                                              'theta': 0.0,
                                              'vega': 0.0}},
           'expiry': datetime.datetime(2026, 3, 31, 0, 0),
           'pcr': 0.4191,
           'put_options': {'instrument_key': 'NSE_FO|62955',
                           'market_data': {'ask_price': 3344.9,
                                           'ask_qty': 75,
                                           'bid_price': 3335.95,
                                           'bid_qty': 300,
                                           'close_price': 3208.9,
                                           'ltp': 3325.95,
                                           'oi': 212625.0,
                                           'prev_oi': 155175.0,
                                           'volume': 118875},
                           'option_greeks': {'delta': 0.0,
                                             'gamma': 0.0,
                                             'iv': 0.0,
                                             'pop': 0.0,
                                             'theta': 0.0,
                                             'vega': 0.0}},
           'strike_price': 30000.0,
           'underlying_key': 'NSE_INDEX|Nifty 50',
           'underlying_spot_price': 23306.45},
          {'call_options': {'instrument_key': 'NSE_FO|62956',
                            'market_data': {'ask_price': 4.75,
                                            'ask_qty': 13725,
                                            'bid_price': 4.65,
                                            'bid_qty': 1200,
                                            'close_price': 5.7,
                                            'ltp': 4.65,
                                            'oi': 205875.0,
                                            'prev_oi': 179850.0,
                                            'volume': 57600},
                            'option_greeks': {'delta': 0.0,
                                              'gamma': 0.0,
                                              'iv': 0.0,
                                              'pop': 0.0,
                                              'theta': 0.0,
                                              'vega': 0.0}},
           'expiry': datetime.datetime(2026, 3, 31, 0, 0),
           'pcr': 0.8474,
           'put_options': {'instrument_key': 'NSE_FO|62964',
                           'market_data': {'ask_price': 4317.95,
                                           'ask_qty': 75,
                                           'bid_price': 4303.55,
                                           'bid_qty': 75,
                                           'close_price': 4184.25,
                                           'ltp': 4312.65,
                                           'oi': 174450.0,
                                           'prev_oi': 137700.0,
                                           'volume': 51825},
                           'option_greeks': {'delta': 0.0,
                                             'gamma': 0.0,
                                             'iv': 0.0,
                                             'pop': 0.0,
                                             'theta': 0.0,
                                             'vega': 0.0}},
           'strike_price': 31000.0,
           'underlying_key': 'NSE_INDEX|Nifty 50',
           'underlying_spot_price': 23306.45}],
 'status': 'success'}

19000, 20000, 21000, 22000 and so on

@Sonu_51669323

I got it , i was expecting it to return null or error if the date is holiday.

1 Like