How can we get the list of instrument keys for all FnO stocks
Hi @RAVI_5894658
You can obtain the list of instrument keys for all FnO stocks from the instrument JSON file available at this link. To filter the data, use the instrument_type
field, which can have the values FUT
, CE
, or PE
.
I hope this addresses your query.
Thanks!
This doesn’t adrress our query, still can find the instrument_key for the stocks, “FOR THE STOCKS individual stocks” that are also in FnO.
this filters out the json file and provde json file of 69000 line while i need instrument key for 215 stocks only
To retrieve the required data, first, identify the instrument key for the stock. Once you have the instrument key, apply a filter using underlying_key, exchange, and segment as NSE FO. You can also use the underlying_symbol of the stock.
For reference, see the example contract for Reliance:
{
"weekly": false,
"segment": "NSE_FO",
"name": "RELIANCE INDUSTRIES LTD",
"exchange": "NSE",
"expiry": 1743100199000,
"instrument_type": "CE",
"asset_symbol": "RELIANCE",
"underlying_symbol": "RELIANCE",
"instrument_key": "NSE_FO|141321",
"lot_size": 500,
"freeze_quantity": 20000.0,
"exchange_token": "141321",
"minimum_lot": 500,
"asset_key": "NSE_EQ|INE002A01018",
"underlying_key": "NSE_EQ|INE002A01018",
"tick_size": 5.0,
"asset_type": "EQUITY",
"underlying_type": "EQUITY",
"trading_symbol": "RELIANCE 1070 CE 27 MAR 25",
"strike_price": 1070.0,
"qty_multiplier": 1.0
}