Skip to content

Yahoo data downloading problem

2 messages · Christofer Bogaso, Jeff Ryan

#
Hi,

I got some problems while was trying to download data from Yahoo using
yahoo.get.hist.quote() function. My script is as follows :

app <- yahoo.get.hist.quote("aapl", start="02/07/09", end="02/07/06",
quote="close")

However I got following error :

trying URL
'http://chart.yahoo.com/table.csv?s=aapl&a=6&b=09&c=0002&d=6&e=06&f=0002&g=d&q=q&y=0&z=aapl&x=.csv'
Error in download.file(url, destfile) : 
  cannot open URL
'http://chart.yahoo.com/table.csv?s=aapl&a=6&b=09&c=0002&d=6&e=06&f=0002&g=d&q=q&y=0&z=aapl&x=.csv'
In addition: Warning message:
In download.file(url, destfile) :
  cannot open: HTTP status was '404 Not Found'

I got a similar thread in
http://tolstoy.newcastle.edu.au/R/help/06/08/33770.html however, I could not
figure out exactly what to do. Can anybody please help me?

Regards,
#
I didn't look into the yahoo.get.hist.quote, but the quantmod package has a
working simple solution with getSymbols:

library(quantmod)
getSymbols("AAPL")
AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted
2007-01-03     86.29     86.58    81.90      83.80    44225700         83.80
2007-01-04     84.05     85.95    83.82      85.66    30259300         85.66
2007-01-05     85.77     86.20    84.40      85.05    29812200         85.05
2007-01-08     85.96     86.53    85.28      85.47    28468100         85.47
2007-01-09     86.45     92.98    85.15      92.57   119617800         92.57
2007-01-10     94.75     97.80    93.45      97.00   105460000         97.00

Examples of that and more (FX, FED/FRED, Financials(google),
Dividends(Yahoo), Quotes...) are at:

http://www.quantmod.com/examples http://www.quantmod.com/examples 

And
http://www.quantmod.com/examples/intro
http://www.quantmod.com/examples/intro 

HTH
Jeff
Bogaso wrote: