Free NSE EOD Data

#1
Guys,

Use this python script to get the EOD data for yourself.
csv format data, you can use it for your analysis/back testing.
I think you can import it into amiborker and plot charts and analyse.

There are lot of options available out there to pull forex data, crypto currency data, technical indicators data.

Features:
* Get data as long as a particular stock exists(you need to change start date).
* csv file for each stock seperately.
* When you run again, it will append data in the same file.(if earlier data collected till Apr-7, when you run again, it will collect starting for apr-8)
* If you are python aware, you can tweak it as per your requirement/stocks.
* Don't run it on market hours, it might get stuck, also it might get only till earlier day.
* For minor modifications, reach out to me.
* if the script is stuck, give ctl+c once, so it moves to next stock

Here is the script attached.

Steps to execute
1. Install python (free)
2. cmd prompt (all packages free)
pip install pandas
pip install nsetools
pip install nsepy
3. run -> python nseEOD.py <output directory>
sample : python nseEOD.py 'C:\Users\Kamal\Documents\StockData\EOD'
4. You will start seeing the files in the given directory
 

Attachments

#3
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x03367AD8>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))': /simple/pandas/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x03367040>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))': /simple/pandas/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x03367940>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))': /simple/pandas/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x033679E8>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))': /simple/pandas/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x033677F0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))': /simple/pandas/
ERROR: Could not find a version that satisfies the requirement pandas (from versions: none)
ERROR: No matching distribution found for pandas
 

mastermind007

Well-Known Member
#10
curl -O https://www1.nseindia.com/content/historical/DERIVATIVES/2016/JAN/fo28JAN2016bhav.csv.zip
just execute this in ur cmd prompt, this bhav copy will get downloaded.
If you closely note, the file name at the end will have the date, which we can automatically generate and put in a loop and download the entire history, I have done it in python.
Hello Pythonguy

This used to work when server was http but does not work anymore. Sooner or later, NSE

Code:
C:\temp>curl -O https://www1.nseindia.com/content/historical/DERIVATIVES/2016/JAN/fo28JAN2016bhav.csv.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

I have tried curl with several command line switches, tried wget with and without browser emulation switches and
even downloaded code of curl to compile it into my own utility.
 

Similar threads

Zerodha – Open Paperless Account

Open online account with Zerodha. Free delivery trading and Max Rs 20 for Intraday, F&O, Currency and Commodity Trading. Intraday High leverage with MIS, CO and BO.

Name:Phone:
Email:City:
State:
Are you a day trader?