雅虎财经股票数据API获取

yahoo提供国内和国外股市每天的交易数据资料

http://table.finance.yahoo.com/table.csv?s=&a=&b=&c=&d=&e=&f=&g=d&ignore=.csv  
参数:

s — 股票名称

a — 起始时间,月

b — 起始时间,日

c — 起始时间,年

d — 结束时间,月

e — 结束时间,日

f — 结束时间,年

g — 时间周期。Example: g=w, 表示周期是‘周’。d->‘日’(day), w->‘周’(week),m->‘月’(mouth),v->‘dividends only’

一定注意月份参数,其值比真实数据-1。如需要9月数据,则写为08。

例如:http://table.finance.yahoo.com/table.csv?s=ibm&d=6&e=22&f=2006&g=d&a=11&b=16&c=1991&ignore=.csv
上面的链接可以抓取IBM股票从1991年12月16日起到2006年7月22的数据。

对于中国股市的数据,上证股票是股票代码后面加上.ss,深证股票是股票代码后面加上.sz
例如:000001 = 000001.sz
深市数据链接:http://table.finance.yahoo.com/table.csv?s=000001.sz
上市数据链接:http://table.finance.yahoo.com/table.csv?s=600000.ss
上证综指代码:000001.ss,深证成指代码:399001.SZ,沪深300代码:000300.ss

对于新浪数据和从VBA上下载,可以参考:

http://www.douban.com/note/25911691/

http://www.cnhup.com/index.php/archives/downloading-a-file-from-the-web-in-vba/

参考资料:http://www.predream.org/show-58-320-1.html

                 http://club.excelhome.net/forum.php?mod=viewthread&tid=1016103

               

你可能感兴趣的:(股票)