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
RateLimitError #66
Comments
Actually, I tried again, now it gives the same traceback plus the following message: I was using your old version of pytrends several months back. During that time, letting it sleep for 5-10 seconds worked well for me. Has Google increased the limit recently? If you know what the limit is, it would be very helpful for me. Thank you! |
I've been successful with 6 seconds. I think they allow 10/min On Tue, Sep 20, 2016 at 10:06 PM, sarahjohns notifications@github.com
|
How many requests do you generally have? I remember that it used to be 1500 downloads per 24 hrs. Now it seems to be much lower. How many requests are you able to download with the 6 seconds wait in between? Thank you! |
I still experience the RateLimitError after 10 downloads even when I put time.sleep(30). One of the previous posts mentioned that they needed a cookie in the browser called PREF. Do you know how to add it? I could not figure out a way to add it... I would really appreciate it if you could help me figure out this issue. |
And you are for sure logged into your Gmail account? I'm able to chug along On Wed, Sep 21, 2016 at 11:16 AM, sarahjohns notifications@github.com
|
I have a loop that goes down a list of inputs. Is it important that I call TrendReq(google_username, google_password, custom_useragent=None) inside the loop, i.e., before every request? |
No I don't think you would need to relogin each time. I just tested as was
|
I see. Thank you a lot! |
I used time.sleep(randint(20, 30)) and I got Rate Limit error after 10 request. That seems weird or google change the rate limit again? |
I've found that I'm limited to 12 requests per hour. |
Yes, I too saw this response, when I was trying to run the "https://www.google.com/trends/fetchComponent" URL with its required query parameters from the browser. Though it was working normally from the Google Trends URL, for the same URL/IP combination. |
I'm receiving the same error, funnily enough when scraping the data only. I could still download reports manually without issues even after I hit a suspected rate limit. I also agree with urataj, the rate limit, if that's what's causing this, must be much lower than 200/hr. Could there be some 24hr limit as well? I've also noticed that some of the data seems to be compromised. By that I don't mean the occasional sampling error but large parts of the data having zero values or being otherwise completely spurious. |
I'm guessing that the library has a bug that is not correctly passing the session/cookies to google and hits an extremely low rate limit. I will look into it when I've got time. Until then if this is a showstopper check out a version before v3.0 it has a clunkier method to get the data. |
For all I know it is a showstopper for now as the URL used to scrape has changed completely. There is now a token added to the end, which looks very much like the session id's used in the developer platform for the official google api's (at least that's the way it works for maps apparently). And I believe this token hasn't been there before. I wonder if this means that we might get an official trends api soon though? I believe it was planned originally but pretty much forgotten for years. Let's hope the guys at google caught up with that now. |
I have been struggling for two days on the rate limit. I should have read this thread before starting. I also found that the rate limit is very low: After 12 calls (with 30-second intervals), I got a rate limit error. I wish Google supports official API soon... |
Getting this error again... Can you help us to solve it soon? Thanks! |
Getting similar error... but it worked for the first maybe 4 queries. |
Hi, I have a similar problem here. Can anyone help us out to resolve this issue? Thanks. |
I spent some time investigating today. It looks like they changed the API and perhaps throttled the old one. https://www.google.com/trends/api/widgetdata/multiline? It looks like it has a ton more parameters that I'll have to wade through but hopefully using that I can resolve this. |
URL decodes to:
|
Looks like you can maybe get the the Token from this url request
which decodes to
Cool we might have something to work with.... |
I'm able to pull back data this way but it is not a trivial fix and will take some time. |
@dreyco676 absolutely fantastic, thanks for discovering that. |
In case people are curious as to how I'm doing this. I'm using Fiddler to inspect the web requests that go across when using my browser. From there its all about making PyTrends mimic those requests. |
@dreyco676 Awesome !!! Thanks a lot. |
@dreyco676 How did you get the url where I can find the token ? I would like to select a specific country. |
Fiddler Just look for a URL that starts with You can specify the country with the |
Alright I was able to test that I have request limit that is in the 100's. I will close this issue as it will be fixed in the next release. |
Hi!
Thank you for the updates of the code. I tried to run the new updated version. After about 10 downloads, I receive the following traceback:
Traceback (most recent call last):
File "C:/Users/Documents/Python Scripts/collect_gtrends.py", line 34, in
trend=pytrend.trend(trend_payload, return_type='dataframe')
File "C:\Users\AppData\Roaming\Python\Python27\site-packages\pytrends\request.py", line 62, in trend
raise RateLimitError
pytrends.request.RateLimitError
I don't think this is the quota limit problem. Maybe I was downloading too frequently? How may seconds do you guys wait in between requests? My current program lets it sleep for 5-10 seconds. Is that not enough? Thank you!
The text was updated successfully, but these errors were encountered: