0

I need to download NSE Futures data since 2012 for my strategy backtesting. I tried NSEpy and jugaad-data libraries but they are giving one day's data at a time.

I tried Getbhavcopy as well but the data is not accurate there.

Is there any other free source to download the same.

Thanks, Mohit

Mohit Garg
  • 61
  • 5

2 Answers2

0

I've used NSEpy, this is basically scraping from the NSE website, better to use some API which actually has the right to provide the data. e.g: Samco, angel one APIs.

they are free as well.

keerthan kumar
  • 332
  • 7
  • 25
0

You can get as follows .....

from datetime import timedelta, date
from nsepy import get_history

def importdata(stock):
    stock_fut = get_history(symbol=stock,
           start=date.today() - timedelta(days = 14),           end=date.today(),
           futures=True,
           expiry_date=date(2022,11,24)) 
                              
    #print(stock_fut.columns)
    print(stock_fut[["Open","Close","Change in OI","Open Interest"]])
        
a = ["AARTIIND","ABB","ABBOTINDIA","ABCAPITAL","ABFRL","ACC","ADANIENT"]
    
for i in range(0,len(a)):
        print(a[i])
        importdata(a[i])