GeneralMills / pytrends

Pseudo API for Google Trends
Other
3.28k stars 821 forks source link

Fetching 61months of data gives weekly stats #29

Closed nwillems closed 8 years ago

nwillems commented 8 years ago

Hi there.

With regards to the date parameters, I think the documentation should be updated. I have just fetched a good portion of keywords, and it seems that the "API" is not consistent :-(. I don't know what to write, and I unfortunately don't have the time to investigate further.

def download_report(words, downloader):
    default_date = "1/2011 61m"
    default_geo = "DK"

    terms = ', '.join(words)

    downloader.request_report(terms, geo=default_geo, date=default_date)
    downloader.save_csv('./queries/', terms.replace(", ", "_"))

See the two attached files as an example, both files are produced from the above code. 11_beskyttelse_1_indført.txt tilfælde_hpv-vaccine_doser_stivkrampe.txt

dreyco676 commented 8 years ago

It looks like the search volume for some of those terms is really tiny. I think rather than report all zeros google tries to help by showing the weeks in which they peak. My suggestion would be to add a term that you know will have a large search volume and use it to help 'force' it to months.

dreyco676 commented 8 years ago

I'll put a disclaimer up in the documentation. Sorry for the issue.