GeneralMills / pytrends

Pseudo API for Google Trends
Other
3.12k stars 798 forks source link

MaxRetryErr #601

Open zhajingwen opened 8 months ago

zhajingwen commented 8 months ago

Why is this error appearing in large numbers today?

jackkwokwai commented 8 months ago

i encounter the similar situation. getting 429 error easily

zhajingwen commented 8 months ago

File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 489, in send resp = conn.urlopen( File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 878, in urlopen return self.urlopen( File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 878, in urlopen return self.urlopen( File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 878, in urlopen return self.urlopen( [Previous line repeated 7 more times] File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 868, in urlopen retries = retries.increment(method, url, response=response, _pool=self) File "/usr/local/lib/python3.8/dist-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='trends.google.com', port=443): Max retries exceeded with url: /trends/api/widgetdata/relatedsearches?req=%7B%22restriction%22%3A+%7B%22geo%22%3A+%7B%22country%22%3A+%22KR%22%7D%2C+%22time%22%3A+%222023-10-17T07%5C%5C%3A38%5C%5C%3A29+2023-10-18T07%5C%5C%3A38%5C%5C%3A29%22%2C+%22originalTimeRangeForExploreUrl%22%3A+%22now+1-d%22%2C+%22complexKeywordsRestriction%22%3A+%7B%22keyword%22%3A+%5B%7B%22type%22%3A+%22BROAD%22%2C+%22value%22%3A+%22Crypto%22%7D%5D%7D%7D%2C+%22keywordType%22%3A+%22QUERY%22%2C+%22metric%22%3A+%5B%22TOP%22%2C+%22RISING%22%5D%2C+%22trendinessSettings%22%3A+%7B%22compareTime%22%3A+%222023-10-16T07%5C%5C%3A38%5C%5C%3A29+2023-10-17T07%5C%5C%3A38%5C%5C%3A29%22%7D%2C+%22requestOptions%22%3A+%7B%22property%22%3A+%22%22%2C+%22backend%22%3A+%22CM%22%2C+%22category%22%3A+0%7D%2C+%22language%22%3A+%22en%22%2C+%22userCountryCode%22%3A+%22JP%22%2C+%22userConfig%22%3A+%7B%22userType%22%3A+%22USER_TYPE_SCRAPER%22%7D%7D&token=APP6_UEAAAAAZTDc9coUQKqhxAV91bxYZWHWvJbybfdX&tz=360 (Caused by ResponseError('too many 429 error responses'))

zhajingwen commented 8 months ago

i encounter the similar situation. getting 429 error easily

I'm looking for a solution and haven't found one yet. 😭

davidgaut commented 8 months ago

same issue for a couple of days, 429 even at first try

zhajingwen commented 8 months ago

I find the problem is that the proxy ips are banned

zhajingwen commented 8 months ago

It will be fine after I switch the proxy IP.

jackkwokwai commented 8 months ago

i didnt use proxy and i get 429 error at first try.

pytrends = TrendReq(tz=281, timeout=(10,25), retries=2)

which proxy ip you are using ?

zhajingwen commented 8 months ago

i didnt use proxy and i get 429 error at first try.

pytrends = TrendReq(tz=281, timeout=(10,25), retries=2)

which proxy ip you are using ?

Hey, I’m really disappointed. I switched the proxy the day before yesterday and it was temporarily available, but today 429 appeared again.