Pergunta

Can I use the Google Finance API to get stock data?

If there is a Flash or Javascript viewer for such stocks data it would be good.
I found some chart components that could be used for the same:

Foi útil?

Solução 2

Yahoo! Finance gives you real-time stock quotes. Data is returned as a CSV.

See this NASDAQ page at http://finance.yahoo.com/q?s=^IXIC

  1. Click the Download Data button to access live data

  2. Click the Download To Spreadsheet button to access historical data

You can access that data from Flash using the LoadVars or URLLoader classes. Use unescape() to decode the string from its URL-encoded format.

Outras dicas

Thats cleared out, Dion Loy, a Google employee recently affirmed that it was perfectly legal to use the Finance API on commercial websites.

"You can use our APIs for commercial or non-commercial purposes."

Using Google Finance Portfolio Data javascript API, via MarkMail.

"Yes, it is fine to use the portfolio API in a commercial application."

Using Google Finance API in commercial app?, via MarkMail.

As an alternative to Google Finance, consider http://www.mergent.com/servius (the Historical Securities Data API)

About the legality of using Yahoo Finance data via the API:

Khalid, from the Drupal project recently assured us that although Yahoo! is aware of the use of its CSV's by third parties (automated scripts and the like) Yahoo! allows them to take it, even for commercial websites!

Officially, there is no explicit permission to use stock data from Yahoo in scripts. However, in reality, there are tons of scripts in every language imaginable (PHP, Perl, .asp, java, ...etc.) that use that data all over the internet. Just do a Google search and see how many there are.

It seems Yahoo realize that many people are using the data in this way, and turn a blind eye to it.

~ Legality of use of Yahoo! data on commercial website?

Several points:

1) Google has recently deprecated the finance API: http://code.google.com/apis/finance/

2) From reading discussions on the forums, google does not have rights to deliver stock quotes, only portfolio performance data, so there is no direct way to get a quote via the API

3) Several items are broken in the web service at this point such as the ability to get market value for a position or portfolio and ability to get the cash position in a portfolio

Yahoo finance seems the best option at this point.

Had a look into this a while ago but, as far as I can tell, google dont let you use their finance data outside of google itself. So, you could use it in a google gadget but you're not allowed to re-publish the finance data outside of google. I assume its something to do with googles licence terms on all that (expensive) market data. If I'm wrong.. someone please please reply and let me know as I could do to do something similar ;)

Matt

I experienced the same problem, that is, if I executed my flex apps locally all worked fine, but when I published it on the server I got 2048 sandbox error. I think that the problem is caused by the crossdomain.xml file on yahoo finance server; if I am right, you can solve it in this way: your flex app do not have to call directly yahoo finance download page but another page (that you can make with php,jsp, asp) that call yahoo finance download page and returns you the data.

It looks like at least yahoo is charging for real-time quotes now:

http://billing.finance.yahoo.com/realtime_quotes/signup?.src=quote&.refer=quote

When I try to access the URL, I get this problem..

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top