@Aditi Limaye I would also recommend going with the second approach coz,
if you find a bug or you want to make some changes to search functionality , you can do it any time and deploy your apis but if you have that client code in frontend you have to create a version and then publishing it to appstore/play store is a tedious process
moreover, you can do rate limiting and stuff with the second approach