NSE get_history not returning historical data

Below code was working fine till last week. But now they are not working. I need to get the index close price data. Is there any work around for the same. Close price from the OHLC data which we get from kite historical doesn't match the actual market close price for the day. Can someone guide.

from nsepy import get_history
data = get_history(symbol="SBIN", start=date(2015,1,1), end=date(2015,1,5))

import nsepython as ns
dfnsehist=ns.index_history('NIFTY 50', '06/01/2023', '06/05/2023')
  • rakeshr
    from nsepy import get_history
    import nsepython as ns
    Not related to kiteconnect APIs. The official repository is mentioned here.
  • subha
    Is there a way to retrieve the open and close price for an index using any of the kite APIs.
  • sujith
    You may refer to the documentation here.
  • subha
    Thanks Sujith.
    I was able to get the close price of the day using Kite.historical_data API with "day" interval.
  • jngahr
    yes, don't try to take 1 day interval , try higher intervals
    it also works for aliceblue
    alice.get_historical(instrument, from_datetime, to_datetime, interval, indices)
    suddenly 1 day interval stopped working !
Sign In or Register to comment.