Unable to download financial data with getFin() in R - HTTP status is '403 Forbidden'

625 views Asked by At

I am trying to download financial data of companies. I have used getFin() quite a lot without encountering any problem.

Right now, I am unable to download any data and when I use e.g. this code (and basically any other valid symbol instead of "AAPL"):

getFin("AAPL")

I get the following error message:

Error in download.file(paste(google.fin, Symbol, sep = ""), quiet = TRUE,  : 
cannot open URL 'http://finance.google.com/finance?fstype=ii&q=AAPL'
In addition: Warning message:
In download.file(paste(google.fin, Symbol, sep = ""), quiet = TRUE,  :
cannot open URL 'http://finance.google.com/finance?fstype=ii&q=AAPL': HTTP status was '403 Forbidden'

However, if I try to access the website http://finance.google.com/finance?fstype=ii&q=AAPL via a browser, I have no problem with accessing the website.

So why am I unable to download data with getFin() in RStudio all of the sudden?

1

There are 1 answers

6
Harry-Robinson On

Have you tried clearing your cache or going incognito and accessing the URL?

Assuming you are on a linux server and using PHP you could try updating your PHP version it should be on the Google finance api documentation