1 min historical data

sharma12lalit
Dear Sir
How can i download historical data for 1 min candles in excel for a particular stock and its future.

Thanks
  • rakeshr
    @sharma12lalit
    Historical data APIs response is in JSON format. You can dump it into excel file.Something like this in python:
    data=kite.historical_data(instrument_token=7458561,from_date='YYYY-MM-DD', to_date='YYYY-MM-DD', interval='minute')
    with open("historical_data.csv", "w",newline='') as output:
    writer = csv.writer(output)
    writer.writerow(['Date','open','High','Low','close'])
    for value in data:
    writer.writerow([value['date'],value['open'],value['high'],value['low'],value['close']])
Sign In or Register to comment.