Skip to content

Knehal07/nse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š NSE Data Fetcher (Python)

Fetch real-time stock, index, and option chain data from the NSE India website using Python.

πŸš€ Features

βœ… Fetch stock quote data (e.g., RELIANCE, TCS, INFY)

βœ… Fetch index data (e.g., NIFTY 50, BANKNIFTY)

βœ… Fetch option chain data (indices & stocks)

βœ… Save results to CSV/JSON for analysis

βœ… Ready-to-use Jupyter notebook demo

πŸ“‚ Project Structure nse-data-fetcher/ │── README.md │── requirements.txt │── .gitignore │── src/ β”‚ β”œβ”€β”€ utils.py # Session + headers for NSE API β”‚ β”œβ”€β”€ nse_stocks.py # Fetch stock data β”‚ β”œβ”€β”€ nse_indices.py # Fetch index data β”‚ β”œβ”€β”€ nse_options.py # Fetch option chain │── notebooks/ β”‚ β”œβ”€β”€ demo.ipynb # Example usage │── data/ β”‚ β”œβ”€β”€ reliance.csv β”‚ β”œβ”€β”€ nifty50.csv β”‚ β”œβ”€β”€ nifty_options.csv

πŸ”§ Installation

Clone the repo and install dependencies:

git clone https://github.com//nse-data-fetcher.git cd nse-data-fetcher pip install -r requirements.txt

πŸ“Œ Usage

Fetch Stock Data python src/nse_stocks.py

Fetch Index Data python src/nse_indices.py

Fetch Option Chain python src/nse_options.py

Jupyter Notebook Demo jupyter notebook notebooks/demo.ipynb

πŸ“ Requirements

Python 3.8+

Libraries:

requests

pandas

jupyter (optional, for notebooks)

Install with:

pip install -r requirements.txt

⚠️ Notes

NSE APIs sometimes block frequent requests β†’ add delays if needed.

Always warm up the session by hitting https://www.nseindia.com before API calls.

Data is for educational and research purposes only (not for commercial trading).

About

ALl the Application for NSE

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages