Is it possible to update a .json file using functions every 24 hours?

I deployed a Nuxt3 web app on Netlify.

Right now I’m making API requests on the fly to fetch data.

Ideally, in my case I want the data to be updated in a .json file once every 24 hours to avoid too many API requests.

I’m new to Netlify, is it possible to achieve this?
If so, could someone please guide me in the right direction?

Hey @anirudhmaddy

Welcome to Netlify!

Using API requests to fetch data means the data is always current, so no need to rebuild. But if you would prefer to have a (semi-) static dataset to work from, rather than dynamic request on page load, then you will need to trigger a site rebuild in order to update that dataset (i.e. the .json file.)

You could do this manually via a build hook, using the Zapier Integration to trigger a rebuild daily, or use a scheduled function to trigger the rebuild.

1 Like

Thank you for the solutions.

I will explore and execute it.