Corporate actions like Bonus Issues, Stock Splits, Dividends, and Buybacks play a crucial role in stock market movements. For traders, especially algo traders, having access to this data in a structured format can provide a strategic advantage.
In this article, I introduce a simple yet powerful Python utility that automates the extraction of corporate action data directly from the NSE (National Stock Exchange of India) website. If you’re an algorithmic trader looking to integrate this data into your trading models, this guide will help you get started.
Why Corporate Actions Matter for Traders?
Corporate actions significantly impact stock prices and market sentiment. Here’s why tracking them is essential:
- Bonus Issues: Increase the number of shares in circulation, impacting supply-demand dynamics.
- Stock Splits: Affect stock liquidity and investor perception.
- Dividends: Provide insights into a company’s financial health and stability.
- Buybacks: Indicate confidence from the company in its own stock value.
For algo traders, integrating corporate action data into their models ensures backtesting accuracy, event-driven trading strategies, and better risk management.
Fetching NSE Corporate Actions with Python
We have developed a Python utility that downloads corporate action data from the NSE and presents it in a structured pandas DataFrame. This allows for easy analysis and integration into trading algorithms.
How the Utility Works?
- The output is returned as a pandas DataFrame, making it easy to analyze and store.
- The utility fetches data from the NSE corporate actions webpage.
- Users can specify a date range to extract historical corporate actions.
- The data is categorized into different types: Bonus, Dividend, Split, Buyback.
Python Utility and Code Usage
The Python code of the full Utility (NseUtility) can be downloaded from the article >> HERE
Here’s how you can use the utility to fetch different types of corporate actions:
import NseUtility # Create an instance of NSEUtility nse = NseUtility.NseUtils() # Fetch corporate actions for the last one month print(nse.get_corporate_action().head()) # Fetch corporate actions for a specific date range print(nse.get_corporate_action('01-01-2025', '31-01-2025').head()) # Fetch only Bonus data print(nse.get_corporate_action('01-01-2025', '31-01-2025', "Bonus")) # Fetch only Dividend data print(nse.get_corporate_action('01-01-2025', '31-01-2025', "Dividend")) # Fetch only Split data print(nse.get_corporate_action('01-01-2025', '31-01-2025', "Split")) # Fetch only Buyback data print(nse.get_corporate_action('01-01-2025', '31-03-2025', "Buy Back"))

Final Thoughts
With algorithmic trading gaining traction, the need for high-quality, real-time corporate action data is more important than ever. This Python utility simplifies the process, enabling traders to fetch, analyze, and act on key stock market events effortlessly.
If you’re an algo trader, consider integrating this data into your trading models to stay ahead of the curve.
📌 Try it out and let me know how it enhances your trading strategies! 🚀
Support this community : FabTrader.in is a one-person initiative dedicated to helping individuals on their F.I.R.E. journey. Running and maintaining this community takes time, effort, and resources. If you’ve found value in the content, consider making a donation to support this mission.
Disclaimer: The information provided in this article is for educational and informational purposes only and should not be construed as financial, investment, or legal advice. The content is based on publicly available information and personal opinions and may not be suitable for all investors. Investing involves risks, including the loss of principal. Always conduct your own research and consult a qualified financial advisor before making any investment decisions. The author and website assume no liability for any financial losses or decisions made based on the information presented.