title: How to throttle API requests using PHP
body: <p>We plan to use the SEMrush API, which allows access to SEO data relating to domain names and search keywords. Under their <a href="http://www.semrush.com/api.html" rel="nofollow">Terms of Use</a>, they limit their usage to avoid killing their servers:</p>
  
  <blockquote>
    <p>You may not perform more than 10 requests per second, nor more than 2 simultaneous requests.</p>
  </blockquote>
  
  <p>We are going to be building a simple tool in PHP that aggregates data based on a domain name and are looking for the basics on how to fulfill that requirement. We are planning for hundreds/thousands of potential simultaneous users.</p>
  
  <p>Maybe someone can provide some pseudo code in PHP that would let us do this - or is it really just as simple as forcing the actual API request function to sleep for 1 second in between each command? I don't have a lot of experience with APIs and large amounts of concurrent users so any help is appreciated.</p>