I am very new to coding and Zerodha API, I subscribed to it in the evening. First of all, Iearnt from the internet that I could fetch the historical data for as long as I wanted, but when I tried to fetch 2yr long data for 15 minute candle. My IDE showed an error that it can't exceed 200 days.
Second, I don't know why how much I am changing my code, the symbol, the dates or the interval. My code is returning everytime an empty dataset. Following is a slice of my coding logic and the output. Please explain.
if response.status_code == 200: return response.json()['data'] else: print(f"Failed to fetch data for symbol {symbol}. Status code: {response.status_code}, Response: {response.text}") return None
symbol = '605697' historical_data = fetch_historical_data(symbol)
And paste the complete stack trace here. Make sure to remove app and client specific tokens.
THANK YOU FOR YOUR RESPONSE @sujith
And can you please guide me about how old the data can be extracted for different timeframes?