How to change data using an API cal on Netlify Frontend?

How to change data using an API call on Netlify Frontend ?

I have a single page static page which has a dynamic data which changes with an API call once a day. How to i achieve this to build on Netlify using github ?

Thanks.

@madjoe Your question is a little unclear.

Are you trying to trigger a rebuild once a day so the site is built with fresh data from the API?

Are you trying to update the data?

Can you more detail for what you’re trying to do?

I have a very basic static page with HTML/CSS. I want to show some data pulled from a public API in this page . That data changes every day. How can i add that data to the webpage, keep it updated automatically ? I dont want to trigger a rebuild as that will cost me minutes. Is there way to do this with plain JS ?

@madjoe Yes, you could use ‘plain JS’ to achieve this.

If you wanted it to load the data fresh on each page load, you could write some JavaScript to load the data either from the public API directly, or by calling your own Serverless Function (also written with JavaScript) which in turn calls the public API.

Your JavaScript would then manipulate the page to display whatever it needed to.