I use Zerodha’s Kite Connect to fetch historical price data. It’s quite accurate and is adjusted for splits and bonuses.
Their API access along with historical price access costs 4000 / month.
Upstox also has an API and it’s much cheaper than Zerodha.