A Python Library to download publicly available data on the NSE website for stocks as pandas dataframe. For a detailed usage : Documentation
git clone https://github.com/NSEDownload/NSEDownload
pip3 install NSEDownload/dist/*
from NSEDownload import stocks
# Gets data without adjustment for events
df = stocks.get_data(stock_symbol="RELIANCE", start_date='15-9-2021', end_date='1-10-2021')
Sample Output as a pandas dataframe :
Date | Symbol | Series | High Prices | Low Prices | Open Prices | Close Prices | Last Prices | Prec Close Price | Total Traded Quantity | Total Traded Value | 52 Week High Price | 52 Week Low Price |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2021-08-11T18:30:00.000Z | HDFC | EQ | 2675.25 | 2646.6 | 2656.6 | 2668.75 | 2666.0 | 2658.5 | 1702479 | 4532596291.9 | 2896 | 1623 |
2021-08-12T18:30:00.000Z | HDFC | EQ | 2715.0 | 2662.0 | 2662.0 | 2704.15 | 2702.1 | 2668.75 | 3248615 | 8774705017.55 | 2896 | 1623 |
2021-08-15T18:30:00.000Z | HDFC | EQ | 2734.45 | 2693.8 | 2696.8 | 2731.15 | 2732.7 | 2704.15 | 2465887 | 6709996706.95 | 2896 | 1623 |
2021-08-16T18:30:00.000Z | HDFC | EQ | 2750.0 | 2707.15 | 2729.95 | 2738.4 | 2745.6 | 2731.15 | 2795510 | 7620988084.3 | 2896 | 1623 |
2021-08-17T18:30:00.000Z | HDFC | EQ | 2770.3 | 2698.0 | 2750.0 | 2710.75 | 2710.0 | 2738.4 | 2501410 | 6828940469.75 | 2896 | 1623 |
- You might run into access issues due to requests per second exceeding the permissible threshold. Add a delay of 5-10 seconds between multiple symbols to resolve the issue. (Discussion)
- Removed indices, returns, and adjusted stocks.
- Made changes to use the new NSE site and cookies.
Your feedback matters! If you come across any bugs or issues, don't hesitate to raise them. Feel free to share your ideas for exciting new features
If you've found my work helpful and appreciate the effort, consider supporting me with a coffee! Your contribution goes a long way!