股票、期货交易及行情等API接口汇总 股票、期货等交易及行情接口非常多,我自己也对接过不少,对接各种接口是个很麻烦的事,各家有各家的特点,最近在做一个ctps...
来源:雪球App,作者: krenx,(https://xueqiu.com/1915158817/180423725)
股票、期货等交易及行情接口非常多,我自己也对接过不少,对接各种接口是个很麻烦的事,各家有各家的特点,最近在做一个ctpstock开源项目,就是以CTP接口头文件封装其它各系统接口,为CTP开发者及其它接口开发者提供接入便利,也做了一个兼容CTP接口的模拟交易平台,方便CTP接口开发者进行接入测试,毕竟simnow是国家级平台,规章限制比较多,很多时段不开放,最近更是一个多月没开,CTP接口兼容模拟交易平台虽然不可能各个细节都与CTP柜台一样,但是大体上是差不多的,我们也会尽量往CTP处理细节上靠。
下面先列几个股票、期货的交易、行情、资讯API接口,后绪会逐步加上我能找到的全部接口信息,也希望大家投稿补充,各尽所能,相互支持,为投资者提供一些服务,为行业发展做点小小贡献。
柜台接口CTP
国内期货交易柜台系统之王,极低的延时,开放式接口,生态非常好。
http://www.simnow.com.cn
ctpstock
ctpstock为以CTP接口封装其他各股票、期货等系统接口的开源接口,可以方便CTP开发者接入其他柜台。
ctpstock开源项目
奇点
华鑫证券自研的证券交易柜台,与CTP类似,开放式接口,提供与simnow类似的模拟交易平台。
N视界模拟交易平台
华鑫证券同时提供一套跟simnow一样的CTP期货模拟交易平台,与其证券模拟柜台同用其N视界模拟平台帐户。
第三方数据接口新浪财经
请求:http://hq.sinajs.cn/list=sh601003,sh601001
应答:
var hq_str_sh601003="柳钢股份,7.280,7.340,7.030,7.280,7.000,7.030,7.040,15228340,107876445.000,187800,7.030,83000,7.020,83200,7.010,316200,7.000,54600,6.990,49800,7.040,157800,7.050,34100,7.060,6000,7.070,5700,7.080,2023-05-19,15:00:01,00,";var hq_str_sh601001="晋控煤业,7.340,7.310,7.150,7.350,7.070,7.140,7.150,27236181,195092848.000,26300,7.140,112500,7.130,16100,7.120,51200,7.110,38700,7.100,289950,7.150,3000,7.160,152200,7.170,188900,7.180,181600,7.190,2023-05-19,15:00:20,00,";
腾讯财经
请求:http://qt.gtimg.cn/q=sh601003,sh601001
应答:
v_sh601003="1~柳钢股份~601003~7.03~7.34~7.28~152283~56714~95570~7.03~1878~7.02~830~7.01~832~7.00~3162~6.99~546~7.04~498~7.05~1578~7.06~341~7.07~60~7.08~57~~20230519154033~-0.31~-4.22~7.28~7.00~7.03/152283/107876445~152283~10788~0.59~8.12~~7.28~7.00~3.81~180.16~180.16~1.45~8.07~6.61~1.03~4714~7.08~6.79~10.48~~~0.77~10787.6445~0.0000~0~ ~GP-A~35.45~-10.22~6.40~17.83~3.68~8.17~4.32~-2.36~-2.09~18.15"; v_sh601001="1~晋控煤业~601001~7.15~7.31~7.34~272362~118865~153497~7.14~263~7.13~1125~7.12~161~7.11~512~7.10~387~7.15~2900~7.16~30~7.17~1522~7.18~1889~7.19~1816~~20230519154054~-0.16~-2.19~7.35~7.07~7.15/272362/195092848~272362~19509~1.63~10.99~~7.35~7.07~3.83~119.67~119.67~1.51~8.04~6.58~0.54~-5709~7.16~5.92~13.67~~~1.25~19509.2848~0.0000~0~ ~GP-A~13.49~-10.85~0.00~13.78~4.66~8.56~3.65~4.08~30.47~50.53";
雪球
请求:https://stock.xueqiu.com/v5/stock/realtime/quotec.json?symbol=SH601003,SH601001
应答:
{"data":[{"symbol":"SH601003","current":7.03,"percent":-4.22,"chg":-0.31,"timestamp":1621407600000,"volume":15228340,"amount":1.07876445E8,"market_capital":1.8016436196E10,"float_market_capital":1.8016436196E10,"turnover_rate":0.59,"amplitude":3.81,"open":7.28,"last_close":7.34,"high":7.28,"low":7.0,"avg_price":7.084,"trade_volume":null,"side":null,"is_trade":false,"level":2,"trade_session":null,"trade_type":null,"current_year_percent":35.45,"trade_unique_id":null,"type":11,"bid_appl_seq_num":null,"offer_appl_seq_num":null,"volume_ext":null,"traded_amount_ext":null},{"symbol":"SH601001","current":7.15,"percent":-2.19,"chg":-0.16,"timestamp":1621407600000,"volume":27236181,"amount":1.95092848E8,"market_capital":1.1966955E10,"float_market_capital":1.1966955E10,"turnover_rate":1.63,"amplitude":3.83,"open":7.34,"last_close":7.31,"high":7.35,"low":7.07,"avg_price":7.163,"trade_volume":null,"side":null,"is_trade":false,"level":2,"trade_session":null,"trade_type":null,"current_year_percent":13.49,"trade_unique_id":null,"type":11,"bid_appl_seq_num":null,"offer_appl_seq_num":null,"volume_ext":null,"traded_amount_ext":null}],"error_code":0,"error_description":null}
Tushare
Tushare是一个免费、开源的python财经数据接口包,不仅包括股票、期货行情数据,还有丰富的财经资讯数据。
http://tushare.org
主流通讯协议及开发框架(主要介绍C++)ptotobuf协议
protobuf库源码
json协议
nlohmann/json库源码
FIX协议
quickfix也提供java、python、C#等版本
quickfix库源码(C++)
websocket协议
websocket++库源码
#股票# #期货# #量化#
版权声明: 本站仅提供信息存储空间服务,旨在传递更多信息,不拥有所有权,不承担相关法律责任,不代表本网赞同其观点和对其真实性负责。如因作品内容、版权和其它问题需要同本网联系的,请发送邮件至 举报,一经查实,本站将立刻删除。