我正在为一个给定的股票代码(损益表,资产负债表和现金流量表)下载财务报表的Web API(免费或以个别开发商的合理成本提供)
我搜索了这个网站,发现了几个关于股票报价的有用链接(Best/Most Comprehensive API for Stocks/Financial Data)我看了YQL但它仅限于股票相关信息http://www.gummy-stuff.org/Yahoo-data.htm)
谷歌财务似乎没有为财务报表提供程序化API。
我能得到的最近的是http://www.mergent.com/并且他们不是免费的:
理想情况下,如果财务报表采用“程序员友好格式”,那将是非常好的,但我认为这不可行。鉴于此,下载此数据的简便方法是第二个最佳选择。
有什么建议?
quantmod R软件包具有从Google提取财务报表的功能。它通过抓取HTML来实现这一点。如果您想尝试一下,请在R提示符下运行以下命令:
install.packages('quantmod') # run this once to install quantmod
library(quantmod)
getFinancials("IBM") # automatically assigns data to "IBM.f" object
viewFinancials(IBM.f,"BS","Q") # quarterly balance sheet
viewFinancials(IBM.f,"IS","Q") # quarterly income statement
viewFinancials(IBM.f,"CF","Q") # quarterly cash flow statement
viewFinancials(IBM.f,"BS","A") # annual balance sheet
viewFinancials(IBM.f,"IS","A") # annual income statement
viewFinancials(IBM.f,"CF","A") # annual cash flow statement
我知道Mergent(http://www.mergent.com/)在问题和评论中已经提到了,但我想在一个单独的答案中说出来,以便其他人不会错过它:Mergent API是专为满足这些需求而设计的(特别是公司Fundamentals API),他们实际上有免费的计划。
Intrinio通过API提供该数据 - 每天最多可获得500次API调用,但您可以获得一次完整的资产负债表,损益表或现金流量表。尝试它的最简单方法是使用API Explorer,它为您构建API调用。你可以在这里view the API documentation。
一些例子:
https://api.intrinio.com/fundamentals/standardized?identifier=AAPL&statement=income_statement&type=FY&date=2017-01-01
这就是以JSON格式提取Apple的损益表。您可以使用curl,GET或基本上任何编程语言。
https://api.intrinio.com/prices?identifier=AAPL&start_date=2010-01-01&end_date=2017-01-01
价格终点将为您提供任何美国股票的整个价格历史记录。
https://api.intrinio.com/data_point?identifier=AAPL&item=last_price
您可以使用data_point获取最新数据 - 此示例获取实时股票价格,但您可以获得EBITDA,EV / EBITDA等。
由于似乎Mergent链接已关闭,因此还有TradeCrunch(http://tradecrunch.net/)。它目前处于测试阶段,但常见问题解答说它有一个免费帐户。有一个用于下载所有财务报表和评估数据的API。还有一个Performance API,但你可以从雅虎那里得到它。
Kimonolabs与EDGAR合作提供SEC API,整合资产负债表,损益表等。