It looks like you're new here. If you want to get involved, click one of these buttons!
df = pd.read_csv("INSTRUMENT_FILE_NAME", low_memory = False)fno_nearest_expiry = sorted(df[(df.segment == 'NFO-FUT')].expiry)[0]
https://kite.trade/docs/connect/v3/market-quotes/#instruments
it is in curl for python how to convert the same
In past I wrote this to find the nearest expiry programmatically