Can't download data from Yahoo Finance using Quantmod in R

后端 未结 6 1927
挽巷
挽巷 2020-11-28 10:12

I\'m trying to download data from Yahoo using this code:

library(quantmod)
getSymbols(\"WOW\", auto.assign=F)

This has worked for me in the

6条回答
  •  悲&欢浪女
    2020-11-28 10:48

    The price history csv URL's appear to have changed

    Old https://chart.finance.yahoo.com/table.csv?s=AAPL&a=2&b=17&c=2017&d=3&e=17&f=2017&g=d&ignore=.csv

    New: https://query1.finance.yahoo.com/v7/finance/download/AAPL?period1=1492438581&period2=1495030581&interval=1d&events=history&crumb=XXXXXXX

    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

提交回复
热议问题