However, if you need a hammer to do the same thing, and restrict yourself to NSE, try a
bhavcopy viewer. Feed it any day's NSE bhavcopy, ensure that the % change column is visible, click on the column header to sort it, and you have the top N gainers / losers. The historical bhavcopy downloader is broken due to NSE changes, so you would have to download the PR.zips yourself.