How to Rate Limit Async Requests in Python
Quick tutorial on how to limit asynchronous python connections when web scraping. This can reduce and balance out web scraping speed to avoid scraping pages too fast and blocking.
Response status code 429 generally means the client is making too many requests. In web scraping, this often happens when scraping too fast.
To avoid status code 429 we can either throttle our scraping speeds by rate limiting our connections (for that see our guide how to rate limit python requests) or we can distribute our connection through multiple clients using proxies. Alternatively, ScrapFly web scraping API can be used to automatically distribute connection to avoid low rate limits imposed by some websites.