# Google Trend Input/Output



## DeepState (22 February 2015)

CALLING GURU CODERS:

This is what I want to do:

I want to enter a strings like: "Greece Varoufakis Idiot"; or
a list of strings representing separate search terms like:  "Greece", "Varoufakis", "Idiot"

...into Google Trends.  Then I want the output scraped out and placed into something I can use.

Ultimately, I want this in MatLab so I can process it via AI algo.  In the ideal, I want to ping it via APL from within Matlab.

If all I manage to do is create a VBA script to pull it out into excel, that would be sufficiently awesome.

Has anyone got VBA code or, even better, MatLab Code that allows me to do this?

Would be much obliged if someone has the script available.  It's got to be a cinch for someone out there.  TIA.


----------



## picarus (25 April 2015)

DeepState said:


> CALLING GURU CODERS:
> 
> Then I want the output scraped out and placed into something I can use.
> 
> ...




This AI algorithm that you mention, is it already implemented? The point is what information does your algorithm to be scraped from Google Trends? 
Can you provide a format template?


----------



## DeepState (26 April 2015)

picarus said:


> This AI algorithm that you mention, is it already implemented? The point is what information does your algorithm to be scraped from Google Trends?
> Can you provide a format template?




Hi.  Never managed to get this done.  Various resources led to some code which just never functioned.  Though I got some assistance from Mathworks on some Matlab calls, I just dropped it for other priorities.

The file format that gets extracted is essentially the .csv file that can be downloaded from Google Trends (eg. http://www.google.com.au/trends/explore#q=aussie stock forums) when you enter a search phrase.  You should be able to toggle things like region, time frame, category and web search type when making the call.

My ideal outcome is to make a call from Matlab to Google via some magic call structure whose contents I do not know.  I believe it is achievable.  I would like to bring back the file contents automatically into Matlab for further use.

If you have something, that would be appreciated.


----------



## WillyWonka (27 April 2015)

DeepState said:


> Hi.  Never managed to get this done.  Various resources led to some code which just never functioned.  Though I got some assistance from Mathworks on some Matlab calls, I just dropped it for other priorities.
> 
> The file format that gets extracted is essentially the .csv file that can be downloaded from Google Trends (eg. http://www.google.com.au/trends/explore#q=aussie stock forums) when you enter a search phrase.  You should be able to toggle things like region, time frame, category and web search type when making the call.
> 
> ...




There is a solution to this written in python. https://github.com/suryasev/unofficial-google-trends-api/tree/master This might not be the most efficient way of doing things however this script will download to a csv which can be easily imported with a simple vba or matlab script. 

Another solution might be to use the code that I used in my asx excel sheet. That vba code downloads data from yahoo finance into an excel sheet. The code would need some tweaking mainly by writing an authentication into Google function.


----------



## StockTrader010 (12 May 2015)

Would be cool to see whether this data has any predictive value. I read some years ago that some HFs were using this type of data, which was provided to them by companies processing big data.


----------

