-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to avoid HTTP status 429 (too many requests)? #535
Comments
what function are you using? |
I think it does not mean. You execute a request and get 429 status |
@Rombersoft I was trying to understand how pytrends produces that result. But if your question is in general what to do with HTTPStatus 429 and how to get around that, stackoverflow is probably a better forum for you. |
I think I figured it out. By default, pytrends doesn't supply a user agent, so it uses the default one. This causes the request to be blocked. I propose allowing a user to pass a user-agent in via the Edit: 18f230d adds it You can then add a user agent like this: from pytrends.request import TrendReq
requests_args = {
'headers': {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36'
}
}
# Only need to run this once, the rest of requests will use the same session.
pytrend = TrendReq(requests_args=requests_args)
# Continue normally
... |
Fixed by #553. |
Who can share experiences about problems with HttpStatus 429 (Too many requests)?
I noticed that the developer thought about using the proxy server. Does it exist some statistics about what I must do in order to be banned by Google Corporation? Public API is missing and how much is legal to use google back end in order to show google trends results on my own site???
The text was updated successfully, but these errors were encountered: