Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Import Data from Google Insights for Search to stata

From   Stas Kolenikov <>
Subject   Re: st: Import Data from Google Insights for Search to stata
Date   Sun, 22 Jan 2012 11:37:49 -0500

While -use- or -infile- do not care whether you open a local file or a
remote file over http, I don't see any obvious way to supply the
username/password. You would probably have to use an intermediate
layer to download the report.csv and open it locally using say GNU's

foreach q in stata sas spss {
  capture erase report_`q'.csv
  !wget -O report_`q'.csv --user=blah --password=blahblah`q'&cmpt=q&content=1&export=1
  insheet <you need to know what the expected variables are> using
report_`q'.csv, clear
  save insight_`q', replace

I am sure the above won't run, but this may serve as a starting point :).

If you know http protocol in and out, you can write everything using
-file- commands (in Stata or Mata), although that will probably be a
lot of pain.

On Sun, Jan 22, 2012 at 10:52 AM, Ulrich Brandt
<> wrote:
> Hey,
> i am working on a paper where i want to use data downloaded from "Google
> Insights for Search" in Stata.
> It is possible to download a .csv File with the results when you log in with
> your google account.
> My question is if it is possible to automate login, search and data entry
> and download of the .csv file in Stata?
> Unfortunately at the moment there is no API for Google Insights for Search
> yet.
> I found some examples of a
> - R package
> and an
> - C# example
> for solving my problem.
> Do you think it is possible to program something like that in Stata or Mata?
> Thank You and best Regards
> Ulrich Brandt
> *
> *   For searches and help try:
> *
> *
> *

Stas Kolenikov, also found at
Small print: I use this email account for mailing lists only.

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index