HII FRIENDS,
can any one share with me code to download indain stocks data from quandl .
i am being able to downoad foreign stock with below code but not indian stock.
code: data = quandl.get('EOD/AAPL',start_date = start , end_date = end , api_key = api_key)
CODE IS WRITTEN IN PYTHON.
STOCK TO DOWNLOAD EXAMPLE : SBIN OR YESBANK
Hi Nilesh,
To download Indian stock data from Quandl you need to replace EOD with NSE.
data = quandl.get('NSE/SBIN',start_date = start , end_date = end , api_key = api_key)
Thank you!
Ty quantinsti it worked
Alternatively, you can use the NSEpy package for Indian stocks. First, you got to do "pip install nsepy" in your command prompt or terminal in case of mac.
Once you're done with that you can use the below code:
from nsepy import get_history
from datetime import date
sbi= get_history(symbol="SBIN", start=date(2016,1,1), end=date(2018,7,31))
This will get you the data in the form of a dataframe from 1st Jan, 2016 to 31st July, 2018.
To convert to csv,
sbi.to_csv('sbindata.csv')
For further read, please go through https://media.readthedocs.org/pdf/nsepy/latest/nsepy.pdf
hii vishnu , problem is that nsepy does not provide adjusted close in data .above code mentioned by quantinsti worked!!