title: Dynamic request with node-fetch
body: <p>I need to obtain a value from an API which is actualized quickly. The problem is that the code I wrote bring me always the same value. I tried two ways:</p>
  
  <pre><code>var fetch = require("node-fetch");
  for(let i=0; i&lt;5; i++){
  setTimeout(function(){}, 3000);
  fetch('https://api.binance.com/api/v3/avgPrice?symbol=ETHBTC')
  .then(res =&gt; res.json())
  .then(data =&gt; {console.log(data.price)});
  }
  </code></pre>
  
  <p>and in a synchronous fashion:</p>
  
  <pre><code>var fetch = require("node-fetch");
  var request = async () =&gt; {
  var response = await fetch('https://api.binance.com/api/v3/avgPrice? 
  symbol=ETHBTC');
  var json = await response.json();
  console.log(json.price);
  }
  for(let i=0; i&lt;5; i++) {
  setTimeout(function(){request();}, 3000);
  }
  </code></pre>
  
  <p>but I always obtain something like this:</p>
  
  <pre><code>0.03244206
  0.03244206
  0.03244206
  0.03244206
  0.03244206
  </code></pre>
  
  <p>Any suggestion?</p>