Refer to my below code snippet based on python client ,
instruments_list = kite.instruments() instruments_list = [instrument for instrument in instruments_list if instrument['exchange'] == 'NFO']
# Filter NSE instruments with type 'CE' or 'PE' instruments_list_ce = [inst for inst in instruments_list if inst['exchange'] == 'NFO' and inst['instrument_type'] in ['CE']] instruments_list_pe = [inst for inst in instruments_list if inst['exchange'] == 'NFO' and inst['instrument_type'] in ['PE']]
In the above code all CE options would be listed in instruments_list_ce and similarly instruments_list_pe for PE options.
In the above code all CE options would be listed in instruments_list_ce and similarly instruments_list_pe for PE options.