title: Rate limiting yourself from overloading external API's
body: <p>I found a lot of information and script examples around that showed how to rate limit the users of an API but I wasn't able to find any examples of how to rate limit your own requests of an API when these limits are imposed.</p>
  
  <p>I've always rate limited my scripts with code such as <code>sleep</code> or <code>usleep</code> commands but it feels like an inefficient way of doing things, especially when the API endpoints have pretty high rate limits and hammering API's until you hit the limits is also inefficient.</p>
  
  <p>For example, Google's API limits vary based on the API you are using and can increase/decrease, in this case a fixed rate limit hard coded into the code just seems like primitive guess work!</p>
  
  <p>Have I missed something pretty obvious? Or is this just not as common as I expect it to be?</p>