title: Request failed with status code 429 Axios
body: <p>I am trying to parse lots of data from external API endpoint to my Database, I keep getting error 429.</p>
  <p>I've tried timeout and sleep lib but it doesn't work for some reason.</p>
  <p>Here is the code :</p>
  <pre class="lang-js prettyprint-override"><code>async function(req, res) {
      console.log(&quot;usa sam&quot;);
      try {
          let count = await Subjekti.estimatedDocumentCount();
          let response = await axios.get(`x.com/?offset=${count}&amp;limit=5000`, {
              timeout: 5800,
              headers: {
                  &quot;Key&quot;: &quot;x&quot;
              }
          });
          const subjects = response.data;
          for (let subject of subjects) {
              let companyDetails = await axios.get(`https://x.com=${subject.mbs}&amp;expand_relations=true`, {
                  headers: {
                      &quot;Key&quot;: &quot;x&quot;
                  }
              });
              await Subjekti({
                  mbs: subject.mbs,
                  sud_id_nadlezan: subject.sud_id_nadlezan,
                  sud_id_sluzba: subject.sud_id_sluzba,
                  oib: subject.oib,
                  ino_podruznica: subject.ino_podruznica,
                  stecajna_masa: subject.stecajna_masa,
                  datum_osnivanja: subject.datum_osnivanja,
                  postupak: subject.postupak,
                  likvidacijska_masa: subject.likvidacijska_masa,
                  skracene_tvrtke: companyDetails.data.skracene_tvrtke &amp;&amp; companyDetails.data.skracene_tvrtke.length &gt; 0 ? companyDetails.data.skracene_tvrtke[0].ime : null,
                  ulica: companyDetails.data.sjedista &amp;&amp; companyDetails.data.sjedista.length &gt; 0 ? companyDetails.data.sjedista[0].ulica : null,
                  kucni_broj: companyDetails.data.sjedista &amp;&amp; companyDetails.data.sjedista.length &gt; 0 ? companyDetails.data.sjedista[0].kucni_broj : null,
                  naziv_naselja: companyDetails.data.sjedista &amp;&amp; companyDetails.data.sjedista.length &gt; 0 ? companyDetails.data.sjedista[0].naziv_naselja : null,
                  naziv_zupanije: companyDetails.data.sjedista &amp;&amp; companyDetails.data.sjedista.length &gt; 0 ? companyDetails.data.sjedista[0].naziv_zupanije : null,
              }).save();
              console.log(&quot;spremija i cekam&quot;);
  
          }
      } catch (err) {
          //Baci error 500...
          return apiResponse.ErrorResponse(res, err);
      }
  }
  </code></pre>
  <p>Looking forward to your reply.</p>