13

I am looking for a web API (free or available at some reasonable cost for an individual developer) to download financial statements for a given stock symbol (income statement, balance sheet and cash flow statements)

I searched on this site and found couple of useful links about stock quotes (Best/Most Comprehensive API for Stocks/Financial Data) I looked at YQL but it is limited to stock related information http://www.gummy-stuff.org/Yahoo-data.htm)

Google finance does not seem to give a programmatic api for financial statements.

Closest I could get to was http://www.mergent.com/ and they are not free:

Ideally, if the financial statement is in a "programmer friendly format", it would be terrific but I don't think that is feasible. Given that, an easy way of downloading this data is the second best option.

Any suggestions?

Community
  • 1
  • 1
serverman
  • 1,314
  • 5
  • 22
  • 39
  • I expect you will need to pay for it, since that information has value and is not scattered about freely on the Internet. – James Black Sep 12 '10 at 00:06
  • It isn't all that programmatic, but it is authoritative and longitudinal: http://www.sec.gov/edgar.shtml – msw Sep 12 '10 at 00:08
  • Hi James Yes that is what I was thinking but I am surprised why it is not free. It is after all available publicly for today's data. And it "should" be publicly accessible for anyone to look at. @msw, I would take another look at that site (already scanned it) – serverman Sep 12 '10 at 00:15
  • http://www.mergent.com/servius/ seems to be exactly what you need (financial statements in programmatic, REST API form), and it does offer some free usage and very reasonable pricing after you exceed it. Please contact me offline - eugene at webservius dot com - to discuss. – Eugene Osovetsky Sep 16 '10 at 04:37

4 Answers4

10

The quantmod R package has functionality to pull financial statements from Google. It does this by scraping the HTML. If you'd like to give it a try, run these commands at a R prompt:

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
Joshua Ulrich
  • 173,410
  • 32
  • 338
  • 418
  • 2
    this appears to no longer work, presumably because Google Finance changes their HTML markup and R can no longer parse it. R is emitting the error: `> getFinancials("IBM") [1] "IBM.f" Warning message: In readLines(tmp) : incomplete final line found on '/var/folders/pn/f50mz2ts5rd5hzg3s9t5p3hc0000gn/T//RtmpTHwzNv/file708a7b1a' ` which points to a cached copy of the Google Finance HTML page. – jm3 May 12 '12 at 15:28
  • @jm3: that's a "Warning" not an "Error". The examples still work for me using quantmod from CRAN and R-forge, despite the warning. – Joshua Ulrich May 12 '12 at 16:55
  • The examples do not still work for me using quantmod from CRAN. The contents of the return object are empty. Still get this same message though: Warning message: In readLines(tmp) : incomplete final line found – Geoffrey Anderson Jun 11 '14 at 20:39
  • This solution now throws an error: `Error: ‘getFinancials.google’ is defunct. Google Finance stopped providing data in March, 2018. You could try some of the data sources via Quandl instead. See help("Defunct") and help("quantmod-defunct")` – miguelmorin Feb 15 '20 at 10:49
1

I know that Mergent ( http://www.mergent.com/ ) was already mentioned in the question and the comments, but I wanted to call it out in a separate answer so that others won't miss it: The Mergent APIs were specifically designed to meet these needs (specifically the Company Fundamentals API), and they actually do have free plans.

isomorphismes
  • 8,233
  • 9
  • 59
  • 70
Eugene Osovetsky
  • 6,443
  • 2
  • 38
  • 59
1

Intrinio provides that data via API- its free up to 500/daily API calls, but you can get an entire balance sheet, income statement, or statement of cashflows for a single call. The easiest way to try it is with the API Explorer, which builds the API calls for you. You can view the API documentation here.

Some examples:

https://api.intrinio.com/fundamentals/standardized?identifier=AAPL&statement=income_statement&type=FY&date=2017-01-01

That pulls Apple's income statement in JSON format. You can use curl, GET, or basically any programming language.

https://api.intrinio.com/prices?identifier=AAPL&start_date=2010-01-01&end_date=2017-01-01

The prices endpoint will get you the entire price history for any US stock.

https://api.intrinio.com/data_point?identifier=AAPL&item=last_price

You can use data_point to get the latest data- this example gets the real time stock price, but you can get EBITDA, EV/EBITDA, etc.

  • Intrinio no longer has a free solution for 500 API calls daily. They have pay-as-you-go, bulk download, and monthly subscriptions starting at $50/month ([pricing](https://intrinio.com/prices)). – miguelmorin Feb 15 '20 at 11:29
  • The query syntax seems to have changed You can query net income for Apple with https://api-v2.intrinio.com/companies/AAPL/historical_data/netincome?api_key=. You can use a sandbox key by signing up to an account. That gives fake data; for real data, you need an active subscription. See [this forum thread](https://community.intrinio.com/questions/13/bulk-request-for-fundamental-data.html) for details on querying historical fundamental data, e.g. balance sheet data. – miguelmorin Feb 15 '20 at 11:30
-1

Kimonolabs has partnered with EDGAR to provide the SEC API, which consolidates balance sheets, income statements, etc.

http://www.kimonolabs.com/sec/docs

greph
  • 79
  • 1
  • 3
  • From their website: "The Kimono web service shut down on February 29th, 2016 and the cloud service has been discontinued." and "The kimono team is joining Palantir!" http://www.kimonolabs.com – miguelmorin Feb 15 '20 at 10:52