Downloading Yahoo stock prices in R

后端 未结 8 678
野趣味
野趣味 2020-12-12 13:46

This is a newbie question in R. I am downloading yahoo finance monthly stock price data using R where the ticker names are read from a text file. I am using a loop to read

8条回答
  •  旧时难觅i
    2020-12-12 14:13

    Unfortunately, URL "ichart.finance.yahoo.com" is dead and not working now. As I know, Yahoo closed it and it seems it will not be opened.

    Several days ago I found nice alternative (https://eodhistoricaldata.com/) with an API very similar to Yahoo Finance.

    Basically, for R-script described above you just need to change this part:

    URL <- paste0("ichart.finance.yahoo.com/table.csv?s=", symbols[i])
    

    to this:

    URL <- paste0("eodhistoricaldata.com/api/table.csv?s=", symbols[i])
    

    Then add an API key and it will work in the same way as before. I saved a lot of time for my R-scripts on it.

提交回复
热议问题