[R] R program google search

Duncan Temple Lang duncan at wald.ucdavis.edu
Sat Sep 4 12:29:49 CEST 2010


Hi there

One way to use Google's search service from R is

libary(RCurl)
library(RJSONIO)  # or library(rjson)

val = getForm("http://ajax.googleapis.com/ajax/services/search/web", q = "Google search AJAX ", v = "1.0")
results = fromJSONIO(val)

Google requests that you provide your GoogleAPI key

  val = getForm("http://ajax.googleapis.com/ajax/services/search/web", q = "Google search AJAX ", v = "1.0",
                  k= "my google api key")

Similarly, you should provide header information to identify your application, e.g

xx = getForm("http://ajax.googleapis.com/ajax/services/search/web", q = "Google search AJAX ", v = "1.0",
                 .opts = list(useragen = "RGoogleSearch", verbose = TRUE))




  D.

On 9/3/10 10:33 PM, Waverley @ Palo Alto wrote:
> My question is how to use R to program google search.
> I found this information:
> "The SOAP Search API was created for developers and researchers
> interested in using Google Search as a resource in their
> applications."  Unfortunately google no longer supports that.  They
> are supporting the AJAX Search API.  What about R?
> 
> Thanks.
> 
> 
> 
> On Fri, Sep 3, 2010 at 2:23 PM, Waverley @ Palo Alto
> <waverley.paloalto at gmail.com> wrote:
>> Hi,
>>
>> Can someone help as how to use R to program google search in the R
>> code?  I know that other languages can allow or have the google search
>> API
>>
>> If someone can give me some links or sample code I would greatly appreciate.
>>
>> Thanks.
>>
>> --
>> Waverley @ Palo Alto
>>
> 
> 
>



More information about the R-help mailing list