0

有没有什么地方可以以编程方式下载公司季度报告中通常报告的 ROIC 和其他数据?

我知道我可以从http://chart.yahoo.com/table.csv访问股票的每日价格数据,但我找不到有关财务表现的任何信息。

谢谢!

4

1 回答 1

1

Intrinio使用 httr 包在 R 中提供该数据。您可以按照此处的说明进行操作,我将在此处对其进行修改以获得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 更改为数百个其他财务指标。如果您想提取历史 roic 或特定日期范围的 roic,请参阅我在此答案开头发布的说明。

于 2017-05-04T21:21:07.043 回答