3

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

Frank
  • 30,590
  • 58
  • 161
  • 244
  • Look into Google Finance, they might have something. – samoz Jul 21 '09 at 14:07
  • Am programatically trying to get the stock price of the stock. But am stuck with Could not connect problem. Can you help ?? http://stackoverflow.com/q/11356448/818557 – Anuj Balan Jul 06 '12 at 06:16

5 Answers5

3

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
  • 268,207
  • 37
  • 334
  • 440
1

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
  • 321,842
  • 108
  • 597
  • 820
1

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
  • 10,559
  • 3
  • 54
  • 60
  • Maybe that's the issue, I need to get data and charts for hundreds of stocks, every few minutes, what's the limit ? – Frank Jul 21 '09 at 16:59
  • 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 Jul 21 '09 at 17:05
  • The answer to this question should be in the license which you accepted when starting talking to their server. – Aaron Digulla Jul 22 '09 at 08:20
  • 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 Jul 22 '09 at 16:09
  • 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 Jul 22 '09 at 17:19
1

I use WebServiceX and Google Finance.

Damo
  • 11,410
  • 5
  • 57
  • 74
  • So what's the difference between the two, and when to use which ? – Frank Jul 21 '09 at 17:13
  • 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 Jul 22 '09 at 08:24
  • 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 Jul 22 '09 at 15:26
  • No idea. I've been using it daily for Currency Rates for over a year with no issues. – Damo Jul 23 '09 at 08:45
  • Am programatically trying to get the stock price of the stock. But am stuck with Could not connect problem. Can you help ?? stackoverflow.com/q/11356448/818557 – Anuj Balan Jul 06 '12 at 06:17
0

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
  • 6,443
  • 2
  • 38
  • 59