title: What are common ways of implementing web API request throttling/rate-limiting?
body: <p>What are common ways of implementing web API request throttling? Are there any libraries for common web frameworks (Rails, Django, Java, etc.) that give you this along with temporary banning?</p>
  
  <p>A related question suggests that the rate limiting is done at the web server by limiting requests by IP, but that would mean that all requests are treated equally. It seems like throttling needs to be handled by the application because:</p>
  
  <ol>
  <li>Some API calls may have different rate limits (e.g. an autocompletion API would have a higher limit than other calls) </li>
  <li>Temporary banning by API key can't be handled by the web server</li>
  <li>Requests coming from behind a proxy are treated the same (?)</li>
  </ol>
  
  <p>related questions: <a href="https://stackoverflow.com/questions/1375501/how-do-i-throttle-my-sites-api-users">here</a>, <a href="https://stackoverflow.com/questions/1387937/django-simple-rate-limiting">here</a>, and <a href="https://stackoverflow.com/questions/614728/best-practice-for-rate-limiting-users-of-a-rest-api">here</a></p>