Unable to get history data of commodity stock SILVER23JULFUT


  • Hi,
    I was using history api to get data of commodity stock from "MCX" exchange but recently i am not getting any data.

    Please help why

    I have collected token and exchange value from https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json
    website.

    token symbol name exch_seg
    244731 SILVER23JULFUT SILVER MCX

    try:
        historicParam = {
            "exchange": "MCX",
            "symboltoken": "244731",
            "interval": "FIVE_MINUTE",
            "fromdate": "2023-06-01 13:30",
            "todate":"2023-06-16 13:30"
        }
        historic_data = obj.getCandleData(historicParam)
    
        # Extract the candle data from the 'data' key
        candle_data = historic_data['data']
    
        # Create a DataFrame from the candle data
        df = pd.DataFrame(candle_data, columns=['timestamp', 'open', 'high', 'low', 'close', 'volume'])
    
    except Exception as e:
        print("Historic Api failed: {}".format(e.message))
    

    I am getting below output after running above code.

    Out put:

    Empty DataFrame
    Columns: [timestamp, open, high, low, close, volume]
    Index: []