[R] Downloading Google finance data onto R

Duncan Murdoch murdoch.duncan at gmail.com
Tue Jan 26 13:36:26 CET 2016

On 26/01/2016 7:16 AM, Christofer Bogaso wrote:
> Hi dear,
> I was trying to download a Google TS data directly onto R from this link :
> https://www.google.com/finance?q=NSE%3ALIQUIDBEES&ei=xlGnVuiPJ9eDuQSZ05OICw
> Used following function, however R generates error.
>> library(quantmod)
>> getSymbols(Symbols = "LIQUIDBEES", src = "google")
> Error in download.file(paste(google.URL, "q=", Symbols.name, "&startdate=",  :
>    cannot open URL
> 'http://finance.google.com/finance/historical?q=LIQUIDBEES&startdate=Jan+01,+2007&enddate=Jan+26,+2016&output=csv'
> In addition: Warning message:
> In download.file(paste(google.URL, "q=", Symbols.name, "&startdate=",  :
>    cannot open: HTTP status was '404 Not Found'
> Could you please guide me how can I download that data directly to R?
> I have also tried with Yahoo finance data, but got the same error.

That symbol should be "LIQUIDBEES.BO" on Yahoo.  Google appears to have 
changed its interface, so src = "google" doesn't work.  You will 
probably have to manually download the Google history, or debug and fix 
getSymbols.google in quantmod.

Duncan Murdoch

More information about the R-help mailing list