GeneralMills / pytrends

Pseudo API for Google Trends
Other
3.21k stars 813 forks source link

Pytrends code returns 400 error #394

Open phoebeqqe opened 4 years ago

phoebeqqe commented 4 years ago

Hi everyone, I am trying to use pytrends to pull search interest for a list of keyword. My codes worked a couple of times when I only included 5 keywords on that list. Once I added a bunch more, it shows 'Google returned a response with code 400". Can anyone look at my codes and let me know if you see any issues? import pytrends from pytrends.request import TrendReq import pandas as pd import time import datetime from datetime import datetime, date, time pytrend = TrendReq(hl='en') pytrend.build_payload([searches], timeframe='today 5-y', geo = 'US', gprop='')

flaxsh commented 4 years ago

There is a maximum number of words allowed per such request which seems to be 5.

andreian02 commented 4 years ago

Hello Phoebeqqe,

To confirm awfuluncrn, 5 keywords is the limit. Recreate an example similar for your reference. Didnt run into any issues,

image