Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any good Finance API? [closed]

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.

like image 578
Otar Avatar asked Sep 08 '10 13:09

Otar


People also ask

Is Google Finance API discontinued?

Why is Google Finance API not on the list? Google Finance API also discontinued. But don't worry, we have good solutions for you.

When was Yahoo Finance API discontinued?

Announcement: Yahoo Finance API discontinued (Update 2017-11-04: Version 217)

Does Yahoo Finance still have an API?

The Yahoo Finance API is a range of libraries/APIs/methods to obtain historical and real time data for a variety of financial markets and products, as shown on Yahoo Finance- https://finance.yahoo.com/.


2 Answers

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

like image 177
Paul Avatar answered Sep 18 '22 15:09

Paul


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/.

like image 45
josephdpurcell Avatar answered Sep 17 '22 15:09

josephdpurcell