Can't download data from Yahoo Finance using Quantmod in R
The price history csv URL's appear to have changed
Oldhttps://chart.finance.yahoo.com/table.csv?s=AAPL&a=2&b=17&c=2017&d=3&e=17&f=2017&g=d&ignore=.csv
The new version appends a "crumb" field which appears to reflect cookie information in the user's browser. It seems they are intentionally blocking automated downloads of price histories and forcing queries to provide information to validate cookies in a web browser
The fix is detailed at https://github.com/joshuaulrich/quantmod/issues/157
Essentialy
remotes::install_github("joshuaulrich/quantmod", ref="157_yahoo_502")# ordevtools::install_github("joshuaulrich/quantmod", ref="157_yahoo_502")