문제

Yahoo! Finance feeds are pain in the ass.

Google Finance API seems OK but don't know why I can't retrieve stock quotes information for Dow Johnes, NASDAQ, S&P...

Works perfect with company quotes like YHOO, MSFT but don't gets full data for stock indexes.

There is an article at YQL blog on how to get this data from Open tables with YQL, but that table is missing in the list.

Can anybody recommend any good API, web service or a feed?

Best answer + vote up guaranteed.

도움이 되었습니까?

해결책

Yahoo provides a free API via http. You can get real-time informations & historical data in csv format.

For example to get the S&P historical data (^GSPC):
http://ichart.finance.yahoo.com/table.csv?s=^GSPC&ignore=.csv

or Dow Jones (^DJI):
http://ichart.finance.yahoo.com/table.csv?s=^DJI&ignore=.csv

URL syntax explained at:
http://www.gummy-stuff.org/Yahoo-data.htm

다른 팁

You can also use YahooAPIs and send a YQL query that returns an XML document, such as:

http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20%28%22GLD,SLV%22%29&env=store://datatables.org/alltableswithkeys

To make things easier, I wrote a simple YahooFinanceAPI script on GitHub. Example usage:

$y = new YahooFinanceAPI;
$y->api(array('SLV','GLD'));

For more complete information you can view an article I wrote at http://thesimplesynthesis.com/article/finance-apis/.

Nordnet External API looks good:

  • Nice documentation although more sample/boilerplate code would be good.
  • Support forum with some activity.
  • Development environment where you can play around.

Before you can use your application for actual trades there is a certification process to ensure that your code works. The API is for building trading bots and not for downloading price histories though.

Could it be that you're using the wrong symbols for the averages? For example, the symbol for the Dow Jones Industrial Average is .DJI - something that caused me a bit of confusion when I was searching for it. The symbol for the S&P 500 is .INX, which is even more counterintuitive.

Take a look at the Interactive Brokers API. Among many other features, it has delayed and real time quotes available via the API.

http://www.interactivebrokers.com/en/p.php?f=programInterface

Take a look at http://www.mergent.com/servius (no stock quotes, but lots of other financial information like dividends, corporate actions and financial statements)

@Brian: The delayed quotes are NOT available through the IB API at the time of writing. Only the real time quotes - and those are not free.

See http://ibkb.interactivebrokers.com/taxonomy/term/147

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top