Instrument key for puling option contract and chain

Hello Team,

I am trying to collect all option contracts and then the option chain, but as per curl query parameters I need to pass the instrument key to get the contract and chain,

For the index, I can find the instrument key as Nifty|Nifty 50, but for stock say ICICIBANK I could not find the instrument key in the instrument JSON file. All instrument keys in the JSON file are for either future or CE\PE,

So for pulling contracts, how do we find key for stocks?

@Jigar_Patel, you can find the instrument key by trading_symbol with other fields like segment and short_name.

Below is json for ICICIBANK

        "segment": "NSE_EQ",
        "name": "ICICI BANK LTD.",
        "exchange": "NSE",
        "isin": "INE090A01021",
        "instrument_type": "EQ",
        "instrument_key": "NSE_EQ|INE090A01021",
        "lot_size": 1,
        "freeze_quantity": 100000.0,
        "exchange_token": "4963",
        "tick_size": 5.0,
        "trading_symbol": "ICICIBANK",
        "short_name": "ICICI Bank",
        "security_type": "NORMAL"

Thank you Pradeep,

Option Contracts | Upstox Developer API

Can we apply a command-separated string to get all option contracts in one shot? Because getting all FnO option contracts one by one will create more API requests,
am I correct in getting option contracts or chain by sending only one instrument key? or can we get mutlple together?

At present, our system supports only a single instrument key. Please explain how you intend to display/use options contracts for multiple instrument keys in your application interface in your script. Retrieving multiple contracts could decelerate the API and become a constraint for the specific request, in addition to being expensive due to the data source.

However, we will review this matter internally and provide you with an update.

I just want to create bar chart with OI at different strike prices for different scripts.
While getting market quote, there was an option to send comma separated string, but now i realised that for one script there are 1000 contract :slight_smile: .
As there is limitation of API request per minute, so i thought to club all in one request.
Any way, i will modify my code to get one instrument key at a time.

BTW, is there anyway to see how many requests has been sent to API for minutes, hr. Or day?