股票报价API? [英] Stock quotes API?

查看:338
本文介绍了股票报价API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图把一个简单的RSS窗口小部件(我的道preSS博客),将显示的股票,或市场和他们目前的价格清单。

I'm trying to put together a simple RSS widget (for my wordpress blog) that will show a list of stocks, or markets, and their current prices.

我似乎无法找到任何地方对这个数据的API - (?也许作为一个RSS源),任何人都可以提出这样的事

I cant seem to find an API for this data anywhere - can anyone suggest such a thing (perhaps as an RSS feed?)

推荐答案

雅虎有一个(无证)股票行情API作为其财政的一部分API

Yahoo have an (undocumented) Stock Quotes API as part of their Finance API

基本上,<一个href=\"http://download.finance.yahoo.com/d/quotes.csv?s=GOOG&f=ll\">http://download.finance.yahoo.com/d/quotes.csv?s=GOOG&f=ll将返回价格股票CVS格式

Basically, http://download.finance.yahoo.com/d/quotes.csv?s=GOOG&f=ll will return the price for GOOG stock in CVS format

取值参数为股票代码。你可以通过用 +

The s parameter is the stock symbol. You can specify multiple by separating them with +

quotes.csv?s=GOOG+YHOO‎

˚F参数是数据格式code,我发现从的这个Python脚本(这也是我如何发现API ..):

The f parameter is the data format code, which I found documented from this Python script (which is also how I discovered the API..):

code   description

l1     price
c1     change
v      volume
a2     avg_daily_volume
x      stock_exchange
j1     market_cap
b4     book_value
j4     ebitda
d      dividend_per_share
y      dividend_yield
e      earnings_per_share
k      52_week_high
j      52_week_low
m3     50day_moving_avg
m4     200day_moving_avg
r      price_earnings_ratio
r5     price_earnings_growth_ratio
p5     price_sales_ratio
p6     price_book_ratio
s7     short_ratio

它们都记录在此页面

数据返回为一个逗号分隔的文件,它应该是完全微不足道的任何语言​​来解析

The data is returned as a comma separated file, which should be utterly trivial to parse in any language

您也可以使用谷歌的财务API来获取在一个稍微圆一个回合路股票行情

You can also use Google's Finance API to get Stock Quotes in a slightly round-a-bout way

基本上你创建一个谷歌小号preadsheet,并使用个GoogleFinance功能

Basically you create a Google Spreadsheet, and use the GoogleFinance function:

=GoogleFinance("GOOG"; "price")

..然后使用S preadsheet API来访问该值

..then use the Spreadsheet API to access that value

我发现这个通过介绍了谷歌财经API和的使用谷歌API介绍,这是更多的细节,包括一个简单的bash shell脚本访问数据(我如何获得实时股票报价认为它可以通过在S preadsheet公开访问)来简化

I found this via "Introducing the Google Finance API", and "How to get a real-time stock quote using Google API" describes this is more detail, including a simple bash shell-script to access the data (I think it could be simplified by making the spreadsheet publicly accessible)

这篇关于股票报价API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆