Ari
Ari

Reputation: 55

Trying to download Google Trends data with multiple locations

I'm trying to automate the download of Google Trends csv files from searches like the following: http://www.google.com/trends/explore#q=%22volunteer%22%20%2B%22volunteer%201%22&geo=US-MO-604%2C%20US-MO-619&cmpt=geo

That is, I want to search for a term within multiple subnational locations, and pull down a csv that has one column of monthly search values for each of those places.

I've been using the code from here, and now have been trying to figure out how to add additional parameters.

Following the discussion on this other thread, I noticed that I could restrict the search by year if I include date="2011" in my call to getForm. Similarly, I can restrict the search to the US by including geo="US". But when I try to use the finer-grained geographic data that's in the URL above, such as geo="US-MO-604%2C%20US-MO-619" or even just "US-MO-604", it reverts back to just downloading the results of a worldwide search. Is there a way to include this in my query?

Upvotes: 0

Views: 1767

Answers (1)

Devon
Devon

Reputation: 690

To get data from these geo locations in, for example, the year 2012, I used this URL: http://www.google.com/trends/explore#q=%22volunteer%22%20%2B%22volunteer%201%22&geo=US-MO-604%2C%20US-MO-619&date=1%2F2012%2012m&cmpt=geo&export=1&content=1.

This provided a .csv file that had only monthly data (I think that's all the more fine-grained you can get on the time dimension) for both of two geo locations you specified (Columbia-Jefferson City MO and Springfield MO).

This query seems to provide exactly what you're looking for: it did not revert to back to a worldwide search, and the CSV file only contained information about these two locations in the 12 months in 2012.

Upvotes: 1

Related Questions