Not able to fetch the MCX GOLD, NATURALGAS, CRUDEOIL using openalgo

Hi Team,
Trying to fetch the future contracts so that i can construct the option symbols but when try to fetch the details usign this code:
import pandas as pd

import requests, gzip, io

print(“:repeat_button: OpenAlgo Python Bot is running.”)

UPSTOX_INSTRUMENT_URL = (

"https://assets.upstox.com/market-quote/instruments/exchange/complete.csv.gz"

)

def load_instruments():

r = requests.get(UPSTOX_INSTRUMENT_URL)

r.raise_for_status()

with gzip.open(io.BytesIO(r.content), "rt") as f:

    df = pd.read_csv(f)

print("Loaded instruments:", len(df))

return df

df_instruments = load_instruments()

mcx_all = df_instruments[df_instruments[“exchange”] == “MCX”]

print(“Total MCX rows:”, len(mcx_all))

print(“\nUnique instrument_type values in MCX:”)

print(mcx_all[“instrument_type”].value_counts())

print(“\nSample MCX rows (10):”)

print(

mcx_all\[

    \["tradingsymbol", "instrument_type", "expiry", "strike", "option_type"\]

\].head(10)

)

print(“\nSample MCX FUT-like rows (contains ‘FUT’):”)

print(

mcx_all\[

    mcx_all\["tradingsymbol"\].str.contains("FUT", case=False, na=False)

\]\[

    \["tradingsymbol", "instrument_type", "expiry"\]

\].head(20)

)

Gettign below message:
Loaded instruments: 133702
Total MCX rows: 0

Unique instrument_type values in MCX:
Series(, Name: count, dtype: int64)

Sample MCX rows (10):
Empty DataFrame
Columns: [tradingsymbol, instrument_type, expiry, strike, option_type]
Index:

Sample MCX FUT-like rows (contains ‘FUT’):
Empty DataFrame
Columns: [tradingsymbol, instrument_type, expiry]
Index:

so it snot able to fidn the future contracts.
I searched on google and found this:
Upstox API support for MCX trading is often disabled by default for many accounts, even if it is enabled in the standard trading terminal

can anyone please help.

The issue is not related to MCX access being disabled on your account.

The CSV instrument files are deprecated and may not contain the latest or complete data, which is why you are unable to find the futures contracts there.

Please use the Instruments JSON files, which are actively maintained and contain the most up-to-date information for all supported instruments, including futures contracts:

Once you switch to the JSON files, you should be able to find the required futures contracts without any issues.

Thank you @Ketan ,
I will try and keep you posted how it goes.

Thanks

Sangeeta