---
title: "Discussion on \"How to Download End-of-Day Stock Prices for the National Stock Exchange of India using Python?\" | Hashnode"
description: "Discussion on \"How to Download End-of-Day Stock Prices for the National Stock Exchange of India using Python?\". Learn to download End-of-Day stock prices for India's National Stock Exchange using Python. Master NSE Bhavcopy files and access data with ease"
url: "https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Download End-of-Day Stock Prices for the National Stock Exchange of India using Python?](https://tradewithpython.hashnode.dev/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python?utm_source=hashnode&utm_medium=feed)

Learn to download End-of-Day stock prices for India's National Stock Exchange using Python. Master NSE Bhavcopy files and access data with ease

Feb 26, 2021 · 8 min read · tradewithpython.hashnode.dev  
Updated Sep 2, 2023  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#python3](https://hashnode.com/tag/python3)
-   [#python-beginner](https://hashnode.com/tag/python-beginner)
-   [#python-projects](https://hashnode.com/tag/python-projects)
-   [#coding](https://hashnode.com/tag/coding)

## Written by

[Yash Roongta](https://hashnode.com/@yash12392)

@yash12392 · London, United Kingdom

  
[View profile](https://hashnode.com/@yash12392)

Finance & Coding Enthusiast

I am a CFA and FRM Charterholder. I used to work as a Portfolio Implementation Manager for Aviva Investors managing £3bn+in Assets Under Management in the UK. I am very passionate about educating people on how they can make more money with their existing investments sustainably.

## Responses 10

Markdown supported · ⌘↵ to post

[Jayesh Shah](https://hashnode.com/@jayhyd)

[Nov 23, 2023](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/655f5e8e5df79790e2b06b1e)

Hi Yash,

Just getting started with Python and came to your site via via... Many thanks. Managed to download for 2020 but have got some errors which I will figure out. This popped up and I thought of saying both a hello and offering my thanks.

Are you still in London? My son is studying at SOAS, Economics. Maybe I can get you to meet up and he can buy you the coffee or better a dinner!!

Let me know. He is doing his under-grad so probably much younger to you but you can always inspire.

Jayesh

[Yash Roongta](https://hashnode.com/@yash12392)

[Nov 27, 2023](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/655f5e8e5df79790e2b06b1e#reply-65645b1ad36816f46a03021d)

Hello [Jayesh Shah](https://hashnode.com/@jayhyd) thanks very much for your comment. Yes I am still in London for another 20 days before I move back permanently to India.

Happy to speak/meet with your son if it will be helpful for him. Please can you reach out at yash12392@gmail.com so I can share my number.

[Kannan Sampath](https://hashnode.com/@kann87)

[Oct 5, 2022](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/633d61f012186eae2bef83d8)

Hey [Yash Roongta](https://hashnode.com/@yash12392), Nice article with the needed details, kudos man.

As far as I checked ur articles, mentioned all about to fetch the EOD data, Is there any way to fetch the data for the particular date / week with the duration of minute / hour?

[Yash Roongta](https://hashnode.com/@yash12392)

[Oct 5, 2022](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/633d61f012186eae2bef83d8#reply-633d6378b7a1dcae0588d032)

Hi [Kannan Sampath](https://hashnode.com/@kann87)that data is not publicly available and sold by enterprise vendors like TrueData, etc.

[Kannan Sampath](https://hashnode.com/@kann87)

[Oct 8, 2022](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/633d61f012186eae2bef83d8#reply-63417ec8250857e669efc446)

Thanks for the prompt answer [Yash Roongta](https://hashnode.com/@yash12392) . I don't see any way to connect / text you except this comment section. I would like to discuss with you on this API trading as you have much experience in this side. You can text me here [linkedin.com/in/kannansampath](https://www.linkedin.com/in/kannansampath/)

[Srinivas Maheedhar](https://hashnode.com/@Mahi9)

[Sep 6, 2022](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/6316a8a2360c57fcaa77ce0d)

After downloading few files (17) get a timeout error or ConnectionError: HTTPSConnectionPool(host='www.nseindia.com', port=443): Read timed out.

I have tried increasing sleep intervals between requests, still could not workaround...any thoughts or ideas to overcome this issue?

[Srinivas Maheedhar](https://hashnode.com/@Mahi9)

[Sep 6, 2022](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/6316a8a2360c57fcaa77ce0d#reply-63179c3c961d2507e75fc3fa)

This was happening with wrong holiday year specified. issue is resolved now.

Ex: wrong code date\_range = pd.bdate\_range(start='01/01/2022', end = '09/06/2022', freq='C', holidays = holidays(2020))

Year mentioned as 2020(incorrect) leading to above error

[Rakesh](https://hashnode.com/@ryadav)

[Aug 12, 2022](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/62f632a8fffdab933bde427b)

Hi Yash,

Thank you for writing this nice article.

When I try to download the data for the below date range, code is breaking with bad zip file error., any idea how to fix it?

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1660301961451/-FGAZmLXC.png)

date\_range = pd.bdate\_range(start='01/03/2014', end = '12/31/2015', freq='C', holidays = holidays\_all)

[Yash Roongta](https://hashnode.com/@yash12392)

[Oct 5, 2022](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/62f632a8fffdab933bde427b#reply-633d63beb7a1dcae0588d03f)

That data is not available on NSE public servers.

[God\_Aech H](https://hashnode.com/@soham736)

[Jul 11, 2022](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/62cc06d7bffc4694f5bc72d2)

date\_range = pd.bdate\_range(start='01/01/2010', end = '01/07/2022', freq='C', holidays = holidays()) for dates in date\_range: bhavcopy\_save(dates,savepath)

#gives me a error saying "BadZipFile: File is not a zip file" Will you please help figure out this??

[Yash Roongta](https://hashnode.com/@yash12392)

[Oct 5, 2022](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/62cc06d7bffc4694f5bc72d2#reply-633d63e7b7a1dcae0588d045)

Try minimizing your date ranges to minimize so many requests in one go and old data 2010-2015 is not available at NSE.

[Aswin K](https://hashnode.com/@twelveyards)

[May 8, 2022](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/6277cdedc2a8c278735c799a)

When I tried to intsall jugaad-data it is showing the error given below. Please help me.

WARNING: Ignoring invalid distribution -ick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -lick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -ick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution - (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -ick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -lick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -ick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution - (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -ick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -lick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -ick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution - (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -ick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -lick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -ick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution - (c:\\programdata\\anaconda3\\lib\\site-packages) ERROR: Could not install packages due to an OSError: \[WinError 5\] Access is denied: 'c:\\programdata\\anaconda3\\lib\\site-packages\\click-8.0.3-py3.10.egg-info\\dependency\_links.txt' Consider using the `--user` option or check the permissions.

WARNING: Ignoring invalid distribution -ick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -lick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -ick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution - (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -ick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -lick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -ick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution - (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -ick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -lick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution -ick (c:\\programdata\\anaconda3\\lib\\site-packages) WARNING: Ignoring invalid distribution - (c:\\programdata\\anaconda3\\lib\\site-packages) ​

[Yash Roongta](https://hashnode.com/@yash12392)

[May 8, 2022](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/6277cdedc2a8c278735c799a#reply-6277cfb1c2a8c278735c79e1)

Hi [Aswin K](https://hashnode.com/@twelveyards) something is wrong with your Python installation, I would recommend doing a fresh one or install in a new virtual environment.

[stackoverflow.com/questions/67442661/warning-igno…](https://stackoverflow.com/questions/67442661/warning-ignoring-invalid-distribution-ip-c-python39-lib-site-packages-how-d)

[Kapil Agrawal](https://hashnode.com/@kapilagrawal2305)

[Feb 3, 2022](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/61fc2219fd8b083e5728941b)

Great post! Clear, thorough and very lucid. I actually came across this webpage while browsing a related problem of trying to find some sort of Indian Equity Tickers to their respective Sector and Industry level mapping. Any thoughts or suggestions? TIA

[Rakesh](https://hashnode.com/@ryadav)

[Jun 22, 2021](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/60d1dbfdd857e96b65ee5b2f)

Hi Yash,

Nice article. I am a newbie to python and was trying to download the data for 4/19/2021 and 6/21/2021, but it is just downloading the files for 19 and 20 April and then the code stops working and throws an error. except (ConnectionError, ReadTimeoutError) as e: NameError: name 'ReadTimeoutError' is not defined

[Yash Roongta](https://hashnode.com/@yash12392)

[Jun 22, 2021](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/60d1dbfdd857e96b65ee5b2f#reply-60d1ddefd857e96b65ee5b6d)

Hi Rakesh, Thank You for reading the articles, can you please put all your code in Google Colab notebook and share it with me on yash@tradewithpython.com, I will have a look!

[Rakesh](https://hashnode.com/@ryadav)

[Jun 22, 2021](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/60d1dbfdd857e96b65ee5b2f#reply-60d1f8ec0b02046ca1fabf33)

Hi Yash, Somehow some magic happened :) and now it works, thank you for such a nice article and for extending your help.[Yash Roongta](https://hashnode.com/@yash12392)

[Yash Roongta](https://hashnode.com/@yash12392)

[Jul 3, 2021](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/60d1dbfdd857e96b65ee5b2f#reply-60e086c14f8e376422a77bef)

Glad to know [Rakesh](https://hashnode.com/@ryadav) that your problem is solved. Do spare a moment to share this platform with your friends and colleagues!

[Ulises Dakari](https://hashnode.com/@ulisesdakari48)

[May 11, 2021](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/609a605d1ea29f2c341e4892)

With the help of python, users can download End-of-Day stock prices for the Indian national stock exchange. The Exchange Data International National Stock Exchange of India data feed give users with end-of-day unadjusted and planned prices for all stocks traded on the National Stock Exchange of India (NSE), such as delisted stocks. Open, high, low, close prices, traded volume, adjustment reason and factor are added in it. Here unadjusted figures show you the price/volume of a stock on that day, with the adjustments being exchange corrections. All of them can have [stock market books](https://www.amakella.com/stock-market-books-learn-how-to-make-money-in-stocks/) for us. On the other hand, adjusted figures show you the price/volume of stock with adjustments because of the corporate actions that are implemented. In case the corporate action impacts the volume of shares of a stock, all previous volume values prior to the ex-date will be multiplied by the inverse of the adjustment element.

[Yash Roongta](https://hashnode.com/@yash12392)

[May 11, 2021](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/609a605d1ea29f2c341e4892#reply-609a610e21068818a5c65b52)

Hi [Ulises Dakari](https://hashnode.com/@ulisesdakari48) you are correct.

[Ulises Dakari](https://hashnode.com/@ulisesdakari48)

[May 5, 2021](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/60926e4b07137f7244ebd6a4)

nice post like it

[Yash Roongta](https://hashnode.com/@yash12392)

[May 11, 2021](https://hashnode.com/posts/download-end-of-day-stock-prices-for-national-stock-exchange-of-india-using-python/6038f5aa1d789c61c39cd51f/comment/60926e4b07137f7244ebd6a4#reply-609a611d1ea29f2c341e48a0)

Thanks [Ulises Dakari](https://hashnode.com/@ulisesdakari48)
