免费股票行情接口
免费股票行情接口:
A股
1 sina 新浪js接口
http://hq.sinajs.cn/list=sh600001
返回
var hq_str_sh600011="华能国际,7.390,7.420,7.230,7.500,7.110,7.210,7.230,24257738,174459225.000,6200,7.210,9900,7.200,16000,7.190,24400,7.180,18506,7.170,23900,7.230,53100,7.240,50400,7.250,17000,7.260,2000,7.270,2018-12-17,15:00:00,00";
http://hq.sinajs.cn/list=sh600011,sh600012
返回
var hq_str_sh600011="华能国际,7.390,7.420,7.230,7.500,7.110,7.210,7.230,24257738,174459225.000,6200,7.210,9900,7.200,16000,7.190,24400,7.180,18506,7.170,23900,7.230,53100,7.240,50400,7.250,17000,7.260,2000,7.270,2018-12-17,15:00:00,00"; var hq_str_sh600012="皖通高速,5.590,5.590,5.620,5.650,5.550,5.610,5.620,2157530,12066336.000,16500,5.610,45971,5.600,11600,5.590,44300,5.580,19600,5.570,1200,5.620,19500,5.630,21300,5.640,57700,5.650,38100,5.660,2018-12-17,15:00:00,00";
返回格式如下:
股票名字,今日开盘价,昨日收盘价,当前价格,今日最高价,今日最低价,买一价,买一价,成交量,成交额,买一量,买一价,买二量,买二价,买三量,买三价,买四量,买四价,买五量,买五价,卖一量,卖一价,卖二量,卖二价,卖三量,卖三价,卖四量,卖四价,卖五量,卖五价,日期,时间
优点:实时数据,可以一次获取多个股票的当天实时数据,而且数据指标很全;
缺点:不能指定日期;
另外还有图片url如下:
查看日K线图:
http://image.sinajs.cn/newchart/daily/n/sh600011.gif
分时线的查询:
http://image.sinajs.cn/newchart/min/n/sh600011.gif
日K线查询:
http://image.sinajs.cn/newchart/daily/n/sh600011.gif
周K线查询:
http://image.sinajs.cn/newchart/weekly/n/sh600011.gif
月K线查询:
http://image.sinajs.cn/newchart/monthly/n/sh600011.gif
ps: 美股接口:
http://hq.sinajs.cn/list=gb_sina
http://image.sinajs.cn/newchart/usstock/daily/SINA.gif
2 netease 网易csv下载接口
http://quotes.money.163.com/service/chddata.html?code=0600011&start=19940809&end=20181214&fields=TCLOSE;HIGH;LOW;TOPEN;LCLOSE;CHG;PCHG;TURNOVER;VOTURNOVER;VATURNOVER;TCAP;MCAP
返回
优点:可以指定起始和结束日期以及哪些数据指标,适合下载历史数据;
缺点:不实时;
代码如下:
val url = new URL(urlStr) val conn = url.openConnection val is = conn.getInputStream val bos = new ByteArrayOutputStream() val b = new Array[Byte](1024) var len = 0 do { len = is.read(b) if (len > 0) bos.write(b, 0, len) } while (len != -1) println(new String(bos.toByteArray, "GBK"))
3 sohu历史数据接口
返回结果为js数据
4 其他
以下接口已经不能使用:
webservice:http://www.webxml.com.cn/WebServices/ChinaStockWebService.asmx
yahoo:http://quote.yahoo.com/d/quotes.csv?s=000969.SZ&f=slc1wop
5 代码
指数代码:
https://www.myquant.cn/gm2/docs/api/index_list/
股票代码:
http://quote.eastmoney.com/stocklist.html
场内ETF代码:
http://fund_open.eastmoney.com/data/rankhandler.aspx?op=ph&dt=fb&ft=ct&rs=&gs=0&sc=zzf&st=desc&pi=1&pn=10000&v=0.03511869769117637
外汇
福汇api
https://www.fuhuiyazhou.com/gb/algorithmic-trading/api-trading/
https://github.com/fxcm/JavaAPI
数字货币
火币api
https://huobiapi.github.io/docs/spot/v1/en/
---------------------------------------------------------------- 结束啦,我是大魔王先生的分割线 :) ----------------------------------------------------------------
- 由于大魔王先生能力有限,文中可能存在错误,欢迎指正、补充!
- 感谢您的阅读,如果文章对您有用,那么请为大魔王先生轻轻点个赞,ありがとう