Skip to content
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

Can only pull 80 days worth of daily data. #21

Closed
abmathewks opened this issue Nov 11, 2015 · 3 comments
Closed

Can only pull 80 days worth of daily data. #21

abmathewks opened this issue Nov 11, 2015 · 3 comments

Comments

@abmathewks
Copy link

Every time I specify date="today 90-d", I don't get the fully ninety days of trend data for any term. Is this something to do with Google authentication or a bug in the library?

@abmathewks
Copy link
Author

Here's an example of how I'm using it. Keys is something like baseball or football.

def GT_Daily_Run(keys):
# connect to Google
connector = pyGTrends(google_username, google_password)
# make request
connector.request_report(keys, date="today 90-d", geo="US")
# wait a random amount of time between requests to avoid bot detection
time.sleep(randint(5, 10))
# download file
connector.save_csv(path, '' + "GT_Daily" + '' + keys)

@dreyco676
Copy link
Contributor

Hmm if I try different terms I get 88days. Still not 90. I'll look into this.

@dreyco676
Copy link
Contributor

Ok I think I figured this out. Today is March 7th. If I use 'today 90-d' it actually does 2015-12-10 to 2016-03-08 which is 90days inclusive. This might be because it is already the 8th in UTC time. Google does not respect the user timezone for the today #-d.

If you are referring to blanks for the last 1-3 days Google seems to hold off on reporting those. Not much I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants