Sometimes API data loaded, sometimes 0, sometime original value

Here is the website.

Down lower, the website grads data from an endpoint and produces the amount of divi donated. I would like this number to update when the page is loaded and every 5 seconds.

However, when page loads I get 1 of three answers: the amount that was there the first time I previewed the page (29938), zero, and the correct number (currently 30106). The “every 5 seconds” never works.

The way the flow goes, is that I load in data into a state that is associated with the index page. Then I use that state to display what I need.

This is from a template, so there is also some JS that happens. I have no idea what it does

So here are the two steps from the “when page loads”

Here it is again on the “every 5 seconds”

Why cant I get it to load reliably, correctly and frequently?

OK, I narrowed down the issue. Its when bubble calls the API. In postman, the response is reliably, “instant”. In bubble I am getting timeouts.

This is taken from inside the API plugin when I “initialize call”. Sometimes its basically instant, most of the time it timesout.

what would cause that? Here is how the API connector is set up.

And you can see that the call in postman is the same, basically as simple as possible

I see some headers in postman and I turned them off, which lead to the call not working Seems like the minimum headers is as follows:

OK, will more use of postman… the issue is the API, not bubble. It doesnt return reliable information. In fact it returns exactly as the title of this post describes. :frowning: