nsepy icon indicating copy to clipboard operation
nsepy copied to clipboard

get_history command returns empty datasets

Open Mrinal-Mahajan opened this issue 5 years ago • 4 comments

I am trying to get historical data from 2019-03-07 to 2019-04-16 for nifty 50 stocks and some indices. However each time it's returning just an empty dataframe. Any particular reasons why is it behaving so. My whole code is bulid up on this as a base , so its a bit urgent . Please fix it asap.

Mrinal-Mahajan avatar Apr 16 '19 02:04 Mrinal-Mahajan

I tried to debug it, and get_history is not returning anything after "2019-01-28".

himanshuchawla8 avatar Apr 21 '19 02:04 himanshuchawla8

In my experience it returns empty dataframe only if NSE has blocked your IP because of multiple hits. Can you check if they blocked your IP ? Can you open the website on a browser ? If no, then reboot your modem, perhaps your ip will get refreshed. A few recommendations to avoid this. Try adding a delay in every hit if you are running loops. Prevent duplicate hits if your code has it by downloading one scrip data and keeping the data in temp folders, etc etc.

sanjoyforever avatar May 01 '19 05:05 sanjoyforever

@sanjoyforever Do you know when NSE gonna block the IP. I am planning to download daily EOD price data of more than 400 stocks from there. Do you have any recommendations?

fightthepower avatar Jun 04 '19 11:06 fightthepower

@sanjoyforever . Please advise how much seconds time delay to be added if EQ data is fetched through the for loop to avoid IP block by NSEINDIA

a3111 avatar Jul 25 '19 17:07 a3111