Display stocks data from Google Finance or Yahoo! Finance

巧了我就是萌 提交于 2019-12-18 10:12:16

问题


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:

  • amCharts
  • Open Flash Chart

回答1:


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.




回答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.




回答3:


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




回答4:


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?




回答5:


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.




回答6:


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




回答7:


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.




回答8:


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




回答9:


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

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



来源:https://stackoverflow.com/questions/395291/display-stocks-data-from-google-finance-or-yahoo-finance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!