views:

348

answers:

5

I used to use my Java programs to get free stock data (historical prices, charts, current prices ...) from Yahoo, but recently it stopped working, because Yahoo doesn't seem to welcome people systematically getting data that way. So I wonder if there is any good (reliable and kept up-to-date) open source Java packages that get free stock info, I don't mind the 20 minute delay.

PS : After some research, I found this site for anyone who is interested in this topic :

http://www.gummy-stuff.org/Yahoo-data.htm

+1  A: 

The issue is that it's hard to find a free source for the data. This is mostly due to the fact that this data is sold for money by the trading places -- you're not asking for open source beer, you're asking for free beer.

The next big place for this data is probably Google (http://www.google.com/finance/). As with most Google services there ought to be an API where you can query the stocks but I couldn't find a link for the details.

Aaron Digulla
+3  A: 

Google does in fact provide a Java Finance API. It's talking purely in terms of portfolios and associated positions, but that should get you going.

There's also a Google Data API and even a Javascript API

Brian Agnew
+1  A: 

I'm using yahoo for free stock data, and it's still working fine (although you had me worried for a minute there).

This link downloads a CSV file containing stock info for Apple and Microsoft:

http://download.finance.yahoo.com/d/quotes.csv?s=AAPL+MSFT&f=sl1d1t1c1ohgvj1m4&e=.csv

How often was your app hitting their servers? Maybe they blocked your IP due to excessive use?

Sam Barnum
Maybe that's the issue, I need to get data and charts for hundreds of stocks, every few minutes, what's the limit ?
Frank
Oh, I just realize that I usually send for stock info one at a time, so if I have a 100 stocks, I'll hit their server 100 times, from your answer I just found I can query multiple stocks in a single query, is there a limit as to how many symbols I can pack into a single query ?
Frank
The answer to this question should be in the license which you accepted when starting talking to their server.
Aaron Digulla
You're limited by the length of the URL, but I think you can fit a few hundred symbols with delimiters without a problem. Once you get above 1000 characters you might want to consider doing it in batches.Are you using an old URL? Make sure you're using download.finance.yahoo.com
Sam Barnum
Yes, I'm using download.finance.yahoo.com, I found the limit for symbols is 200 at a time. But I wonder if anyone knows the limit on how often can I get data from it before it gives me an error message ? Such as one query for 200 symbols every second for all of the few thousand symbols every 5 minutes, maybe ?
Frank
A: 

I use WebServiceX and Google Finance.

Damo
So what's the difference between the two, and when to use which ?
Frank
WebServiceX is SOAP vs Googles's REST. Google's API has more to it. If you want something simple and your IDE can generate stubs from a SOAP WSDL (eg. using Eclipse) then WebServiceX may be easier to get off the ground. Otherwise definitely use the Google API.
Damo
I looked at WebServiceX, it seems to have what I'm looking for,but I'm curious, why it's free without ads, who's running it, any limit as to how many time a day can I request info from it ? I can't find these info on their site.
Frank
No idea. I've been using it daily for Currency Rates for over a year with no issues.
Damo
A: 

Take a look at http://www.mergent.com/servius - a set of REST API for historical stock quotes and many other types of financial data

Eugene Osovetsky