Error 404 while access option chain API

I am trying to access the following url|129973/2024-04-25
This is for reliance 25 Apr expiry but I always get 404 error
I have already established all authentication needed to access my account.

I constructed the url based on following documentation from Upstox

You can find the information you need at the URL provided below. When accessing the option chain, it is necessary to include the instrument_key parameter, specifically underlying stock. Here’s an example:|INE002A01018&expiry_date=2024-04-25

Both instrument_key and expiry_date are essential query parameters. In future updates, we plan to incorporate an example of this in our documentation for the option chain to prevent similar issues for other users.

Thanks Pradeep, but if you look at my original comment the intrument key is part of the url.|129973/2024-04-25

Instrument key here is NSE_FO|129973. I got this instrument key from the .CSV file that you have provided with API documentation.

Also the expiry date given above is 2024-04-25.

So I am not missing any parameter.

Could you help me check if the URL is correct?

An underlying stock instrument key is required, but you are entering the option contract instrument key, as indicated below:

        "weekly": false,
        "segment": "NSE_FO",
        "name": "RELIANCE INDUSTRIES LTD",
        "exchange": "NSE",
        "expiry": 1714069799000,
        "instrument_type": "CE",
        "asset_symbol": "RELIANCE",
        "underlying_symbol": "RELIANCE",
        "instrument_key": "NSE_FO|129973",
        "lot_size": 250,
        "freeze_quantity": 7500.0,
        "exchange_token": "129973",
        "minimum_lot": 250,
        "asset_key": "NSE_EQ|INE002A01018",
        "underlying_key": "NSE_EQ|INE002A01018",
        "tick_size": 5.0,
        "asset_type": "EQUITY",
        "underlying_type": "EQUITY",
        "trading_symbol": "RELIANCE 2600 CE 25 APR 24",
        "strike_price": 2600.0

Refer to the underlying stock detailed below:

        "segment": "NSE_EQ",
        "name": "RELIANCE INDUSTRIES LTD",
        "exchange": "NSE",
        "isin": "INE002A01018",
        "instrument_type": "EQ",
        "instrument_key": "NSE_EQ|INE002A01018",
        "lot_size": 1,
        "freeze_quantity": 100000.0,
        "exchange_token": "2885",
        "tick_size": 5.0,
        "trading_symbol": "RELIANCE",
        "short_name": "Reliance Industries",
        "security_type": "NORMAL"

Use the following URL when you fetch the option for the trading symbol “RELIANCE”:|INE002A01018&expiry_date=2024-04-25

Thanks Pradeep. That was a very fundamental mistake I did,:joy:. Ofcourse the option chain will be of underlying.

Thanks it worked now

1 Like