title: How to repeat a "request" until success? NODEJS
body: <p>I checked a few thread in StackOverflow, but nothing works for me.
  I have this request call and I need it to try to send the request until it succeed (but if it fails, it has to wait at least 3 seconds):</p>
  
  <pre><code>sortingKeywords.sortVerifiedPhrase = function(phrase) {
  
      var URL = "an API URL"+phrase; //&lt;== Obviously that in my program it has an actual API URL
      request(URL, function(error, response, body) {
          if(!error &amp;&amp; response.statusCode == 200) {
              var keyword = JSON.parse(body);
              if(sortingKeywords.isKeyMeetRequirements(keyword)){ //Check if the data is up to a certain criteria
                  sortingKeywords.addKeyToKeywordsCollection(keyword); //Adding to the DB
              } else {
                  console.log("doesn't meet rquirement");
              }
          } else {
              console.log(phrase);
              console.log("Error: "+ error);
          }
  
      });
  };
  </code></pre>
  
  <p>Here's the weird part, if I call the same phrases in a row from the browser, it works almost without errors (it usually states: rate limit time esceeded).</p>
  
  <p>Appreciate your help.
  Thanks in advance.</p>