The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: cookies/authorisation to access google trends csv
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Adam Chapman

Posts: 172
Registered: 1/12/09
cookies/authorisation to access google trends csv
Posted: Jun 6, 2013 12:00 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I'm trying to download a csv of google trend data, as was done at in February 2012.

My existing code looks like this:


keyWord='mickey mouse'


url = ['' USERNAME '&Passwd=' PASSWORD '&service=trendspro&source=test-test-v1';
durl = System.String(strcat('', keyWord, '&date=all&geo=all&graph=all_csv&sort=0&scale=1&sa=N'));

if exist('googleWebClient','var')
client = googleWebClient;
client = System.Net.WebClient;

response = client.DownloadString(url);
sid = char(response.ToString);
sid = regexp(sid, '\n', 'split'); %sid = sid(1,1);

client.Headers.Add('Cookie', char(sid(1)));


saveFilePath = System.String(strcat('C:\Dropbox\PROJECTS\', keyWord, '.csv'))



If anybody runs this they will see that the returned csv file contains nothing useful.

I have found something that may be a bit sompler to access:

although I think this wants some authentication data for access.

I did notice in the original code above that the variable "response" contains 3 pieces of information (SID, LSID & AUTH)

Is anybody able to access either a csv or json formatted data from matlab alone?
Both urls are accessible through any web browser I've used, but matlab is struggling.

Any help is massively appreciated

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.