Custom module that makes an API call to dynamically display data

I am trying to create a custom module that will use settings data values to make an API call that will dynamically change the frontend value displayed. There will be an id field in the settings, that value will be used to make the call and return a value that will be used in a switch statement to change the rendered buttons behavior. Is there an action I can hook into when the module gets rendered on the frontend? Ideally this would only get called once on render.

The frontend.php file is only called once when a module is rendered, you can make your API call there. Dont forget to store the fetched data in a WP transient so the API is not hammered every time the module is rendered