title: How to call an API every 5 minutes using React?
body: <p>I've been trying to call the API every 5 min but the limit for setInterval doesn't allow that.</p>
  <pre><code>useEffect(() =&gt; {
      setInterval(() =&gt; {
        (() =&gt; {
          const API_KEY = &quot;C5EQJXXXXXXXXXXXX&quot;;
          const name = &quot;FB&quot;;
          axios
            .get(
              `https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&amp;symbol=${name}&amp;interval=5min&amp;apikey=${API_KEY}`
            )
            .then(({ data }) =&gt; {
              console.log(data);
              console.log(data[&quot;Time Series (5min)&quot;]);
              for (let key in data[&quot;Time Series (5min)&quot;]) {
                setStocksX((prev) =&gt; [...prev, key]);
                setStocksY((prev) =&gt; [
                  ...prev,
                  data[&quot;Time Series (5min)&quot;][key][&quot;1. open&quot;]
                ]);
              }
              //console.log(stocksX, stocksY);
            });
        })();
      }, 30000);
    });
  </code></pre>
  <p>Any advice would be appreciated!
  Thanks</p>