GeneralMills / pytrends

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

Too many 429 error responses. Max retries exceeded. #578 #622

Open MohammedN-hash opened 1 month ago

MohammedN-hash commented 1 month ago

related keywords:An error occurred while fetching related queries: The request failed: Google returned a response with code 429

john-m24 commented 1 month ago

Are you using proxies? I'm starting to think that this issue only occurs when you use proxies. I wonder if it has something to do with the way we're using cookies for each proxy

MohammedN-hash commented 1 month ago

I am not using any proxies, this is the code I have:

pytrend = TrendReq()

def related_suggestions_queries(term,language):

    pytrend = TrendReq(hl=language)

    pytrend.build_payload(kw_list=[term])

    related_terms = pytrend.related_queries()

    return related_terms 

could it be a problem with the rate limit? because sometimes it works sometimes not? is there a way to avoid the rate limit if it is the issue here?