Historical stock composition of Nifty 50 and Nifty Next 50

I was trying to understand the historical stock composition of indices like Nifty50. I tried searching the data on the internet but couldn’t find anything. After posting my query on multiple forums, I got a direction from my query on Money StackExchange.

NSE provides the historical stock composition on Nifty 50 and Nifty Next 50 indices on Nifty Indices by selecting “Archive of Daily/Monthly Reports → Market Capitalisation, Weightage, Beta for Nifty 50 and Nifty Next 50”. However, the data is shared month-wise and not consolidated. I wrote some quick and dirty utilities to scrape off data and consolidated it in a Google Sheet.

In the ‘Nifty 50’ and ‘Nifty Next 50’ worksheets, you can see when a stock entered and exited the index (e.g., Axis Bank joined the Nifty 50 in March 2009). The ‘Nifty 50 Data’ and ‘Nifty Next 50 Data’ worksheets contain the raw data downloaded from the website.

NSE Index Data Google Sheet