我有R包getReturns問題。我已經發生,因爲5月17日這個錯誤:警告文件(文件,「RT」): 無法打開URL「http://ichart.finance.yahoo.com/table.csv?s=AAPL&a=4&b=28&c=2014&d=4&e=27&f=2017&g=w&ignore=.csv」:HTTP狀態‘404未找到’ 它看起來像ichart API沒有運行了。任何人都可以幫我解決這個問題嗎?有人知道如何解決它嗎?我遇到了與quantmod R軟件包相同的問題。[R getReturns雅虎財經API
3
A
回答
1
您可以按照我以前的post,這可能會幫助你。
我想:
library(quantmod)
# Create an object containing the Pfizer ticker symbol
symbol <- "PFE"
# Use getSymbols to import the data
getSymbols(symbol, src="yahoo", auto.assign=T)
# because src='google' throws error, yahoo was used, and even that is down
當我嘗試過其他來源,它的工作:
# "quantmod::oanda.currencies" contains a list of currencies provided by Oanda.com
currency_pair <- "GBP/CAD"
# Load British Pound to Canadian Dollar exchange rate data
getSymbols(currency_pair, src="oanda")
str(GBPCAD)
,似乎有與谷歌問題和雅虎,而我們使用quantmod PKG。
我會建議你使用「Quandl」代替。 PLZ轉到Quandl網站,免費註冊和創建API密鑰,然後在下面複製:
# Install Quandl
install.packages("Quandl")
# or from github
install.packages("devtools")
library(devtools)
install_github("quandl/quandl-r")
# Load the Quandl package
library(Quandl)
# use API for full access
Quandl.api_key("xxxxxx")
# Download APPLE stock data
mydata = Quandl::Quandl.datatable("ZACKS/FC", ticker="AAPL")
對於HDFC在BSE,你可以使用:
hdfc = Quandl("BSE/BOM500180")
瞭解更多詳情:
https://www.quandl.com/data/BSE-Bombay-Stock-Exchange?keyword=HDFC
3
我也遇到這個問題爲好。雅虎已撤下ichart現在依賴於它的開源庫被破壞。雅虎也沒有計劃推出替代品。欲瞭解更多信息,請參閱Yahoo!的論壇https://forums.yahoo.net/t5/Yahoo-Finance-help/Is-Yahoo-Finance-API-broken/td-p/250503
0
雅虎失敗後,我切換到eodhistoricaldata.com,幾個星期前我發現了一個很好的替代方案(https://eodhistoricaldata.com/),其API與Yahoo Finance非常相似。
基本上,幾乎所有的R腳本,我用我只是改變了這一點:
URL <- paste0("ichart.finance.yahoo.com/table.csv?s=", symbols[i])
到:
URL <- paste0("eodhistoricaldata.com/api/table.csv?s=", symbols[i])
然後加入一個API密鑰,它會以同樣的方式工作如前。我爲它節省了大量的R腳本。
相關問題
- 1. 雅虎財經API
- 2. 雅虎財經API問題
- 3. 雅虎財經API全部股票?
- 4. 熊貓DataFrame和雅虎財經API
- 5. 雅虎財經API Java下載CSV
- 6. 處理雅虎財經API HTTP錯誤
- 7. 雅虎財務API錯誤
- 8. 雅虎財務api圖表
- 9. retriving股票報價與雅虎財經
- 10. 熊貓雅虎財經實時數據
- 11. 解析雅虎財經CSV用的NodeJS
- 12. 從雅虎財經獲取數據
- 13. 使用雅虎財經寶石
- 14. R:從雅虎財經下載歷史數據
- 15. 從雅虎財經拉動歷史分析師意見R
- 16. 雅虎gecoding API中的R
- 17. 雅虎財務API實時報價
- 18. 雅虎財務API不起作用
- 19. 雅虎財經搜索股票代碼API /方法
- 20. 雅虎財經API - 針對不同證券交易所
- 21. 雅虎財經API股票過去的價值
- 22. 使用雅虎財務
- 23. python web-scraping雅虎財務
- 24. 雅虎財經商品股票報價PHP
- 25. 如何獲取雅虎財經股票數據?
- 26. JSON從雅虎財經API SyntaxError當作爲參數給谷歌圖表表
- 27. 如何獲得雅虎財經(YQL)gzip迴應?
- 28. 用Python篡改道瓊斯指數的雅虎財經
- 29. 的wget不能下載雅虎財經的數據更
- 30. python2.7:從雅虎財經獲得股票數據與pandas_datareader錯誤