This will take some time, in fact I suggest you use rotating proxies and add multithreading. 10 threads will be executed. This way you can have 10 queries at a time. Using proxies will be slow, and add a timeout of at least 1.5 seconds each request, it will slow you down, but reduce the risk of getting a ban.
source share