2013-04-25 154 views
0

有沒有一些地方可以通過編程方式下載公司季度報告中通常報告的ROIC和其他數據?以編程方式下載RIC和其他財務數據R

我知道我可以從http://chart.yahoo.com/table.csv獲得股票的每日價格數據,但我找不到有關財務業績的任何信息。

謝謝!

+0

看看我的[**答案**](http://stackoverflow.com/questions/2614767/using-r-to-analyze-balance-sheets-and-income-statements/15975391#15975391)涉及從雅虎下載資產負債表/收入表數據。 – hvollmeier 2013-04-26 15:09:56

+1

還有['quantmod :: getFinancials'](http://www.quantmod.com/documentation/getFinancials.html)。 – 2013-04-26 22:22:12

+0

太棒了。我知道quantmod,但不知道他們有一個函數來獲取財務信息。 – defoo 2013-04-27 02:21:07

回答

1

Intrinio使用httr包提供R中的數據。您可以按照instructions here,我會在這裏進行修改以獲得ROIC:

#Install httr, which you need to request data via API 
install.packages("httr") 
require("httr") 

#Create variables for your usename and password, get those at intrinio.com/login 
username <- "Your_API_Username" 
password <- "Your_API_Password" 

#Making an api call for roic. This puts together the different parts of the API call 

base <- "https://api.intrinio.com/" 
endpoint <- "data_point" 
stock <- "T" 
item1 <- "roic" 
call1 <- paste(base,endpoint,"?","ticker","=", stock, "&","item","=",item1, sep="") 

#Now we use the API call to request the data from Intrinio's database 

ATT_roic <- GET(call1, authenticate(username,password, type = "basic")) 

#That gives us the ROIC value, but it isn't in a good format so we parse it 

test1 <- unlist(content(ATT_roic,"parsed")) 

df <- data.frame(test1) 

您可以修改代碼,任何美國股票,並且可以更改ROIC出來數以百計的其他財務指標的。如果您想要拉取歷史漫遊,或漫遊特定的日期範圍,請參閱我在本答覆開始處發佈的說明。

相關問題