2013年12月31日,有博友反应,无法打开,sohu 接口换掉了。。这个我无法控制……
http://q.stock.sohu.com/hisHq?code=cn_300228&start=20130930&end=20131231&stat=1&order=D&period=d&callback=historySearchHandler&rt=jsonp
=============================================================================
http://q.stock.sohu.com/app2/history.up?method=history&code=XXX&sd=YYYY-MM-DD&ed=YYYY-MM-DD&t=d&res=js
code股票代码,格式 国别_代码
sd start date 开始日期 格式YYYY-MM-DD
ed enddate 结束日期格式YYYY-MM-DD
t周期 d日w 周 m 月
res response 返回格式,默认js。返回json格式
比如
http://q.stock.sohu.com/cn/300228/lshq.shtml
【日线例子】
http://q.stock.sohu.com/app2/history.up?method=history&code=cn_300228&sd=2013-01-01&ed=2013-06-22&t=d&res=js
【周线例子】
http://q.stock.sohu.com/app2/history.up?method=history&code=cn_300228&sd=2012-06-01&ed=2012-09-21&t=w&res=js
【月线例子】
http://q.stock.sohu.com/app2/history.up?method=history&code=cn_300228&sd=2012-01-01&ed=2012-12-31&t=m&res=js
【优点】
1)有重要数据换手率
2)免费
3)封装简单
【局限性】
1)数据不是除权后的数据
2)一次最多只能读取100条交易记录
3)只能取日线、周线、月线数据
【例子】
http://q.stock.sohu.com/app2/history.up?method=history&code=cn_300228&sd=2012-01-01&ed=2012-12-31&t=m&res=js的返回值
PEAK_ODIA(['hq_history',[['2012-12-31','28.320','34.000','5.680','20.06%','27.600','34.300','207519','65735.484','0.30%'],['2012-11-30','34.950','28.320','-7.210','-20.29%','27.600','35.800','346141','110124.172','0.50%'],['2012-10-31','30.690','35.530','4.830','15.73%','29.860','35.850','261429','85368.055','0.38%'],['2012-09-28','30.170','30.700','0.530','1.76%','29.520','36.500','297842','98240.477','0.43%'],['2012-08-31','26.090','30.170','4.020','15.37%','25.620','33.790','407295','125262.055','0.59%'],['2012-07-31','24.710','26.150','2.070','8.60%','23.850','29.700','594098','157645.719','0.86%'],['2012-06-29','42.330','24.080','-18.550','-43.51%','22.420','46.410','380650','95291.883','0.59%'],['2012-05-31','42.000','42.630','0.880','2.11%','40.150','49.770','82580','36706.238','0.49%'],['2012-04-27','40.710','41.750','0.460','1.11%','40.710','45.490','78322','34054.535','0.46%'],['2012-03-30','40.000','41.290','0.980','2.43%','39.690','44.680','182988','77951.711','1.08%'],['2012-02-29','35.200','40.310','5.220','14.88%','34.920','42.990','77037','30142.270','0.45%'],['2012-01-31','41.000','35.090','-5.610','-13.78%','32.560','42.580','100983','38553.188','0.59%'] ], ['2012-01-01至2012-12-31','-1.090','-3.11%','22.420','49.770','3016884','955075.812','5.71%']])
------------------------------------------------------------------------------
http://q.stock.sohu.com/app2/history.up?method=history&code=XXX&sd=YYYY-MM-DD&ed=YYYY-MM-DD&t=d&res=js
code股票代码,格式 zs_代码 (注意zs开头 指数的拼音首字母)
sd start date 开始日期 格式YYYY-MM-DD
ed enddate 结束日期格式YYYY-MM-DD
t周期 d日w 周 m 月
res response 返回格式,默认js。返回json格式
指数的例子
比如
http://q.stock.sohu.com/zs/000001/lshq.shtml
【日线例子】
http://q.stock.sohu.com/app2/history.up?method=history&code=zs_000001&sd=2013-01-01&ed=2013-06-28&t=d&res=js
【周线例子】
http://q.stock.sohu.com/app2/history.up?method=history&code=zs_000001&sd=2013-01-01&ed=2013-06-28&t=w&res=js
【月线例子】
http://q.stock.sohu.com/app2/history.up?method=history&code=zs_000001&sd=2013-01-01&ed=2013-06-28&t=m&res=js