title: How to limit external API calls from PHP app
body: <p>I have a PHP app that is overloading an external API with too many calls per minute. I need to limit it to only 20 calls a minute, but I can't seem to figure it out. I have researched the issue and found <a href="https://stackoverflow.com/questions/31195934/rate-limiting-yourself-from-overloading-external-apis">this</a> and <a href="https://github.com/alexandrugaidei/ratelimit-codeigniter-filebased" rel="nofollow noreferrer">that</a>, but there is a lack of proper documentation and I don't know how it would work. I understand that this is called "rate limiting", but I guess I skipped that in school.</p>
  
  <p>My app is just sending cURL requests in a loop. I have several loops running in the program to gather all this information together. I could just limit the one loop with a timer for 20 per minute, but I have 17 loops running and I have loops within loops. Is it possible to just limit all the cURL requests within my PHP app with a single helper or something and not edit all my code?</p>