API_RESPONSE values are not subscriptable how to convert them to pandas data frame?

api_response= api_instance.get_historical_candle_data(instrument_key, interval, to_date, api_version)
the above data is a nested Dictionary however when I tried to read the datatype of ‘api_response’ it simply shows some response json link, how can we make this response into a dataframe?

Can you provide the code you’re using to parse the API response? While we can look into issues related to pandas’ data frames, handling them should primarily be on your side.

Hi thank you for the response, I can handle everything once its converted to pandas dataframe, only the api response is not converting into a dataframe, or any other python object/data type will work. Right now when I check the type of response it is simply an upstox object. Please check the code below.

df = api_instance.get_historical_candle_data(instrument_key, interval, to_date, api_version)
df2= pd.DataFrame.from_dict(df[‘data’])

TypeError: ‘GetHistoricalCandleResponse’ object is not subscriptable

We’ll check this data frame issue internally and aim to develop a sample code snippet for GitHub to benefit others. Please note that we cannot guarantee a specific timeline for this, as the issue is not directly related to our core API platform.

okay thank you but at least can you tell me how to convert the historical candle data API response into any other python data object like dictionary or list or excel file

hi can you please reply to this?