Cant get historical data

kbhari90
Hi,

I am new to kite api(python). I am trying to get historical data for a list of equities. But getting an empty list instead.
Below is the sample code for one equity:
#3196417 is the isntrument_token for infosys as obtained from instrument list downloaded for NSE through API

historicalData = kite.historical("3196417", "2016-01-01", "2016-01-10", "minute")
#for test
print(historicalData[0])
json.dump(historicalData, open("../../../resource/historicalDemo.json", "w") )

#print statement is giving error :print(historicalData[0]) IndexError: list index out of range

Checked the file and it has an empty list. Am i doing anything wrong here?
Is this because i am trying it on weekend?

Note: I subscribed to historical api services today morning.
Also tried different intervals for the historical method argument , still no luck.


Thankyou
  • sujith
    Hi @kbhari90,
    Historical API is an add on subscription, you have to subscribe for it.
  • kbhari90
    kbhari90 edited February 2017
    Thanks for replying @sujith but I have already mentioned in the initial post that i have subscribed for historical api
  • kbhari90
    Hi @sujith ,

    Just checked by giving in recent dates 2015 and 2016 , and i am able to get the data for them.
    But earlier dates (2010, 2011..etc) are just returning empty lists :(. I thought we had last 10 years data?
  • sujith
    @kbhari90,
    Only for some scrips we have data till 2006 , but for INFY we have till OCT 2015 only. We are planning to populate data for old dates also, but can't guarantee timeline as of now.
  • kapilaggr
    @sujith whats the process & additional cost for subscribing to historical data?
  • sujith
    @kapilaggr, You can go to your app details page on developers console and subscribe for it. It will cost you 2k per month.
  • ankur0101
    You can get historical data for free from Quandl
Sign In or Register to comment.