问题
I know that Yahoo has a great API for accessing detailed financial metrics about a company documented at http://www.gummy-stuff.org/Yahoo-data.htm. Yahoo also provides historical pricing data, documented at http://code.google.com/p/yahoo-finance-managed/wiki/csvHistQuotesDownload.
However, I'm trying to find a place where I can programmatically access detailed historical data, like what was a company's earnings 10 years ago, and not just the price of the stock. Does anyone know of such a site? I'm willing to pay, and I think http://www.mergent.com/servius, but they seem very, very expensive. A single standardized financial report from a company costs 50 units, which is $2.50 under their pay-as-you-go plan.
Google seems to have pretty good historical financial data that appears to go back 5 years. I may try scraping them, but I'd like to go back much, much further. Any ideas?
回答1:
Quandl provides a huge amount of different databases with all sorts of data, not only EOD but e.g. earnings per share and a lot of other stuff like US employment data.
API is easy to use and well documented. It also provides an Excel plug-in, a Matlab plug-in, a Python package, an R package, and a number of languages has a support through community maintained libraries.
Not all the data are free though. For more advanced data bases there is a subscription fee. I think the price is different depending on the database and the number of potential users.
回答2:
Wolfram Alpha has the data you desire
Examples:
- http://www.wolframalpha.com/input/?i=msft+earnings
- http://www.wolframalpha.com/input/?i=aapl+earnings+2001
- http://www.wolframalpha.com/input/?i=ko+price+1983
I have not used it, but I see they provide a free API with an option to upgrade if you exceed their monthly limits.
回答3:
Intrinio provides income statements, balance sheets, and statement of cashflows going back 10 years, in addition to stock prices and valuation ratios, via API. You can programmatically query the API to pull the data into your app.
Some examples:
https://api.intrinio.com/financials/standardized?identifier=YUM&statement=income_statement&fiscal_period=Q2&fiscal_year=2015
This grabs YUM's income statement from Q2, 2015.
https://api.intrinio.com/companies?latest_filing_date=2017-03-06
That shows all companies with a new filing date on or after 2017-03-06, which is useful for determining which fundamentals need to be updated.
https://api.intrinio.com/data_point?ticker=AAPL,MSFT&item=pricetoearnings
That pulls the current price to earnings ratio for Apple and Microsoft. You could swap out last_price to get the current stock price.
https://api.intrinio.com/data_point?ticker=$FEDFUNDS&item=level
This call returns the current federal funds interest rate from the federal reserve.
https://api.intrinio.com/prices?ticker=AAPL
That returns the price history for AAPL.
Intrinio gives away 500 daily API calls to any developer.
回答4:
Check out this page: ADVFN Financial Data Scraper. You can download a spreadsheet with built-in macro that scrapes up 22 years of financial earnings data for any publically traded company that ADVFN posts historic data for. Just keep in mind that it's not an quick process, for the 3000 odd companies pre-listed in the spreadsheet, the macro will need to run for a couple of days (obviously you can download less if you like though). But, you'll end up with over 8 million data values and you'll have them saved locally in a spreadsheet for quick and easy analysis.
ADVFN posts up to 307 rows of data per company per year and this spreadsheet can capture them all, yielding a very comprehensive data base of historical financial data.
回答5:
Depends what you want. Lets say, if you looking for FX historical data you can take a look on Dukascopy historical data feed(http://www.dukascopy.com/swiss/english/data_feed/historical/) It is possible to write some scripts to download data into your app.
回答6:
You can get what you want from financialmodelingprep they have quarterly income statement, balance sheet and cash flow. I include a sample code so you can see how I took the data in jquery.
They also offer historical quote according to their documentation.
Fiddle: https://jsfiddle.net/7g238qrp/
$(document).ready(function() {
var url = "https://financialmodelingprep.com/api/financials/income-statement/AAPL?period=quarter";
$.ajax({
url: url,
type: "GET",
crossDomain: true,
success: function (response) {
let resp = response;
resp = resp.substring(5);
resp = resp.substring(0, resp.length - 5);
// if you want to convert to JSON
//resp = JSON.parse(resp)
//console.log(resp);
$('#JonContent').text(resp);
},
error: function (xhr, status) {
alert("error");
}
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<pre>
<div id="JonContent"></div>
</pre>
来源:https://stackoverflow.com/questions/9740116/programmatic-access-to-detailed-historical-financial-data