321k / Google-Trends

Main functions are in the file Google Trends functions.
25 stars 84 forks source link

Scale Downloading of Data #2

Open digitaldavidg opened 9 years ago

digitaldavidg commented 9 years ago

Hey Erik, Great work here with being able to extract data from Google Trends. Is there a way to scale this if I wanted to see the trends for not just the entire US, but individual states and even metros, regions, or cities in every state?

For example, I am looking at the search term "Divorce" and when I look at Los Angeles I see cities which the term is popular like this https://www.google.com/trends/explore#q=divorce%20-kardashian&geo=US-CA-803&date=1%2F2014%203m&cmpt=q&tz=America%2FDawson . I would also negate popular celebrity divorces like -kardashian -affleck etc. This would tell me searchers in these cities were most interested in divorce and could possibly assume wanting to get a divorce rather than interested in celebrity divorces.

I want to be able to do the same for every major region as provided in the location dropdown in GT. How hard of a task would this be?

321k commented 8 years ago

Google gives you per state data if you specify the country as US. You could use that to scale per-state data. There's an option somewhere in the package for extracting state-level data.

To set it up, I'd download one csv for each state to get state level numbers. I'd also get one csv for the entire US, as this file will contain relative volumes per state.

Hope that helps, and let me know how it goes!