首页好灵数据 资料我的资料 自选我的自选股 邀请我的邀请奖励 API 我的API 财务财务中心
帮助关于

接口说明/ API

接口说明: 返回停牌股票类表,复牌股票类表,新上市股票列表,增发、分红、除权、退市、配股股权、股权登记等信息.

接口地址: http://i.h0.cn/wen.php      返回格式: json

请求方式: HTTP协议,支持GET/POST方法。     调试工具: 测试工具


请求参数/ Request parameter
1、系统级参数(所有接口都需要的参数):
参数名称 类型 示例值 必须 描述
m_id Int 10001 好灵数据网 会员MID
sign String 698d51a19d8a121ce581499d7b701668 数字签名 sign = md5( $token . md5($bjtime))
[PHP CODE: $token = 您的token; $bjtime = date("YmdHi")]
[说明: $bjtime = date("YmdHi") 即:$bjtime = "年月日时分";即:201801010930;]
2、应用级参数(每个接口有自己的参数):
参数名称 类型 默认值 示例值 必须 描述
actNmae String srsLog 接口名称(固定: actName=srsLog)
date Int 当日 20190505 传入交易日期

返回参数/ Return parameter

JSON格式返回结果。

1、系统级参数(所有接口都会返回的参数):
名称 类型 示例值 描述
msg String 接口执行情况描述。
code int 100 好灵数据网 接口执行状态,正数代表执行成功,负数代表执行失败。
 100, 接口成功,数据查询成功.
-101,系统签名sign验证失败
2、应用级参数(每个接口有自己独有的返回数值.):
名称 类型 示例值 描述
data array[] 股票分类列表
- l_gcode String 股票编码
- l_gdate String 信息日期
- l_gname String 股票名称
- l_greason String 信息内容
- l_type String 信息类型编码
- l_typename String 信息类型中文名称

请求示例/ Request example
复制
                      
                    // m_id 你自己的会员ID,请在用户中心=>个人资料中 查看  点击进入
                    $m_id	= 10000;                    
                    date_default_timezone_set('PRC');	// 设置系统时间为北京时间 
                    $ndate	= md5(date("YmdHi"));
                    // 请换成自己的token,请在用户中心=>个人资料中 查看  点击进入
                    $token	= "f5bb0c8de146c67b44babbf4e6584cc0";
                    // 产生访问签名                     
                    $sign 	=  md5($token . $ndate);	
                    // 带上应用及参数获取接口数据 
                    $r = file_get_contents("http://i.h0.cn/wen.php?actName=srsLog&m_id=$m_id&sign=$sign");
                    $r = json_decode($r,true);
                    print_r($r);
                    
                  
复制
                    
                    // m_id 你自己的会员ID,请在用户中心=>个人资料中 查看  点击进入
                    var m_id	= '';

                    var ndate	= md5加密的时间 //如:md5(201905051200)[年月日时分];
                    // 请换成自己的token,请在用户中心=>个人资料中 查看  点击进入
                    var token	= "";
                    // 产生访问签名 
                    var sign 	=  md5(token . ndate);
                    // 带上应用及参数获取接口数据 
                    var xhr = new XMLHttpRequest();
                    xhr.open('POST', 'http://i.h0.cn/wen.php', true);
                    xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
                    xhr.send('actName=srsLog&m_id='+mid+'&sign='+sign);
                    xhr.onreadystatechange = function () {//请求后的回调接口,可将请求成功后要执行的程序写在其中
                        if (xhr.readyState == 4 && xhr.status == 200) {//验证请求是否发送成功
                            var json = xhr.responseText;//获取到服务端返回的数据
                            console.log(json);
                        }
                    };
                    
                  
复制
                    
                    // m_id 你自己的会员ID,请在用户中心=>个人资料中 查看  点击进入
                    m_id	= '';

                    ndate	= md5加密的时间 //如:md5(201905051200)[年月日时分];
                    // 请换成自己的token,请在用户中心=>个人资料中 查看  点击进入
                    token	= "";
                    // 产生访问签名 
                    sign 	=  md5(token . ndate);
                    // 带上应用及参数获取接口数据 
                    curl -X POST
                    -H "Content-Type: application/x-www-form-urlencoded"
                    -d 'actName=srsLog&m_id=[m_id]&sign=[sign]'
                    http://i.h0.cn/wen.php
                    
                  
复制
                    
                    # -*- coding: utf-8 -*-
                    import time,hashlib,requests,json

                    # 解析输出的数据
                    def output(json_str):
                        return json.dumps(json.loads(json_str),indent=4,ensure_ascii=False)

                    m_id = '' #你的ID   点击进入
                    token = ''  #你的token 点击进入

                    # 时间要用北京时间(系统时间)
                    ndate = time.strftime("%Y%m%d%H%M",time.localtime())
                    m = hashlib.md5()
                    b = ndate.encode(encoding='utf-8')
                    m.update(b)
                    ndate = m.hexdigest()

                    m = hashlib.md5()
                    c = str(token+ndate).encode(encoding='utf-8')
                    m.update(c)
                    sign = m.hexdigest()

                    param1={'actName':'srsLog','m_id':m_id,'sign':sign}
                    url='http://i.h0.cn/wen.php'
                    req = requests.post(url,data=param1)
                    result = req.text
                    print(output(result))
                    
                  
复制
                                         
					// 等待添加... 

                    
                  
复制
                    
					// 等待添加... 
                    
                  
net
Android
GO
NodeJS
IOS

返回示例/ Return example
JSON:
{"code":100,"msg":"\u6570\u636e\u83b7\u53d6\u6210\u529f.","dataNums":20,"data":[{"l_gcode":"000758","l_gdate":"20190520","l_gname":"\u4e2d\u8272\u80a1\u4efd","l_greason":"2018\u5e74\u5ea6\u80a1\u4e1c\u5927\u4f1a","l_type":"stockholderList","l_typename":"\u80a1\u4e1c\u767b\u8bb0"},{"l_gcode":"002134","l_gdate":"20190520","l_gname":"\u5929\u6d25\u666e\u6797","l_greason":"2018\u5e74\u5ea6\u80a1\u4e1c\u5927\u4f1a","l_type":"stockholderList","l_typename":"\u80a1\u4e1c\u767b\u8bb0"},{"l_gcode":"002192","l_gdate":"20190520","l_gname":"\u878d\u6377\u80a1\u4efd","l_greason":"2018\u5e74\u5ea6\u80a1\u4e1c\u5927\u4f1a","l_type":"stockholderList","l_typename":"\u80a1\u4e1c\u767b\u8bb0"},{"l_gcode":"300616","l_gdate":"20190520","l_gname":"\u5c1a\u54c1\u5b85\u914d","l_greason":"2018\u5e74\u5ea6\u80a1\u4e1c\u5927\u4f1a","l_type":"stockholderList","l_typename":"\u80a1\u4e1c\u767b\u8bb0"},{"l_gcode":"600535","l_gdate":"20190520","l_gname":"\u5929\u58eb\u529b","l_greason":"2018\u5e74\u5ea6\u80a1\u4e1c\u5927\u4f1a","l_type":"stockholderList","l_typename":"\u80a1\u4e1c\u767b\u8bb0"},{"l_gcode":"600562","l_gdate":"20190520","l_gname":"\u56fd\u777f\u79d1\u6280","l_greason":"2018\u5e74\u5ea6\u80a1\u4e1c\u5927\u4f1a","l_type":"stockholderList","l_typename":"\u80a1\u4e1c\u767b\u8bb0"},{"l_gcode":"600958","l_gdate":"20190520","l_gname":"\u4e1c\u65b9\u8bc1\u5238","l_greason":"2018\u5e74\u5ea6\u80a1\u4e1c\u5927\u4f1a","l_type":"stockholderList","l_typename":"\u80a1\u4e1c\u767b\u8bb0"},{"l_gcode":"601579","l_gdate":"20190520","l_gname":"\u4f1a\u7a3d\u5c71","l_greason":"2018\u5e74\u5ea6\u80a1\u4e1c\u5927\u4f1a","l_type":"stockholderList","l_typename":"\u80a1\u4e1c\u767b\u8bb0"},{"l_gcode":"136438","l_gdate":"20190520","l_gname":"16\u4fe1\u6295G1","l_greason":"\u91cd\u8981\u516c\u544a","l_type":"stopList","l_typename":"\u80a1\u7968\u505c\u724c"},{"l_gcode":"200011","l_gdate":"20190520","l_gname":"\u6df1\u7269\u4e1aB","l_greason":"10\u6d3e3\u5143","l_type":"shareRegistList","l_typename":"\u5206\u7ea2\u8f6c\u589e"},{"l_gcode":"000672","l_gdate":"20190520","l_gname":"\u4e0a\u5cf0\u6c34\u6ce5","l_greason":"10\u6d3e4\u5143","l_type":"shareDividendList","l_typename":"\u9664\u6743\u9664\u606f"},{"l_gcode":"002253","l_gdate":"20190520","l_gname":"\u5ddd\u5927\u667a\u80dc","l_greason":"10\u6d3e1.2\u5143","l_type":"shareDividendList","l_typename":"\u9664\u6743\u9664\u606f"},{"l_gcode":"002392","l_gdate":"20190520","l_gname":"\u5317\u4eac\u5229\u5c14","l_greason":"10\u6d3e0.28\u5143","l_type":"shareDividendList","l_typename":"\u9664\u6743\u9664\u606f"},{"l_gcode":"300021","l_gdate":"20190520","l_gname":"\u5927\u79b9\u8282\u6c34","l_greason":"10\u6d3e1\u5143","l_type":"shareDividendList","l_typename":"\u9664\u6743\u9664\u606f"},{"l_gcode":"300041","l_gdate":"20190520","l_gname":"\u56de\u5929\u65b0\u6750","l_greason":"10\u6d3e1.525468\u5143","l_type":"shareDividendList","l_typename":"\u9664\u6743\u9664\u606f"},{"l_gcode":"300348","l_gdate":"20190520","l_gname":"\u957f\u4eae\u79d1\u6280","l_greason":"10\u8f6c\u589e5\u80a1\u6d3e1.5\u5143","l_type":"shareDividendList","l_typename":"\u9664\u6743\u9664\u606f"},{"l_gcode":"300383","l_gdate":"20190520","l_gname":"\u5149\u73af\u65b0\u7f51","l_greason":"10\u6d3e0.2\u5143","l_type":"shareDividendList","l_typename":"\u9664\u6743\u9664\u606f"},{"l_gcode":"300580","l_gdate":"20190520","l_gname":"\u8d1d\u65af\u7279","l_greason":"10\u6d3e1.6\u5143","l_type":"shareDividendList","l_typename":"\u9664\u6743\u9664\u606f"},{"l_gcode":"600794","l_gdate":"20190520","l_gname":"\u4fdd\u7a0e\u79d1\u6280","l_greason":"10\u6d3e0.12\u5143","l_type":"shareDividendList","l_typename":"\u9664\u6743\u9664\u606f"},{"l_gcode":"600963","l_gdate":"20190520","l_gname":"\u5cb3\u9633\u6797\u7eb8","l_greason":"10\u6d3e0.27\u5143","l_type":"shareDividendList","l_typename":"\u9664\u6743\u9664\u606f"}]}
JSON转数组后:
Array
(
    [code] => 100
    [msg] => 数据获取成功.
    [data] => Array
(
    [code] => 100
    [msg] => 数据获取成功.
    [dataNums] => 20
    [data] => Array
        (
            [0] => Array
                (
                    [l_gcode] => 000758
                    [l_gdate] => 20190520
                    [l_gname] => 中色股份
                    [l_greason] => 2018年度股东大会
                    [l_type] => stockholderList
                    [l_typename] => 股东登记
                )

            [1] => Array
                (
                    [l_gcode] => 002134
                    [l_gdate] => 20190520
                    [l_gname] => 天津普林
                    [l_greason] => 2018年度股东大会
                    [l_type] => stockholderList
                    [l_typename] => 股东登记
                )

            [2] => Array
                (
                    [l_gcode] => 002192
                    [l_gdate] => 20190520
                    [l_gname] => 融捷股份
                    [l_greason] => 2018年度股东大会
                    [l_type] => stockholderList
                    [l_typename] => 股东登记
                )

            [3] => Array
                (
                    [l_gcode] => 300616
                    [l_gdate] => 20190520
                    [l_gname] => 尚品宅配
                    [l_greason] => 2018年度股东大会
                    [l_type] => stockholderList
                    [l_typename] => 股东登记
                )

            [4] => Array
                (
                    [l_gcode] => 600535
                    [l_gdate] => 20190520
                    [l_gname] => 天士力
                    [l_greason] => 2018年度股东大会
                    [l_type] => stockholderList
                    [l_typename] => 股东登记
                )

            [5] => Array
                (
                    [l_gcode] => 600562
                    [l_gdate] => 20190520
                    [l_gname] => 国睿科技
                    [l_greason] => 2018年度股东大会
                    [l_type] => stockholderList
                    [l_typename] => 股东登记
                )

            [6] => Array
                (
                    [l_gcode] => 600958
                    [l_gdate] => 20190520
                    [l_gname] => 东方证券
                    [l_greason] => 2018年度股东大会
                    [l_type] => stockholderList
                    [l_typename] => 股东登记
                )

            [7] => Array
                (
                    [l_gcode] => 601579
                    [l_gdate] => 20190520
                    [l_gname] => 会稽山
                    [l_greason] => 2018年度股东大会
                    [l_type] => stockholderList
                    [l_typename] => 股东登记
                )

            [8] => Array
                (
                    [l_gcode] => 136438
                    [l_gdate] => 20190520
                    [l_gname] => 16信投G1
                    [l_greason] => 重要公告
                    [l_type] => stopList
                    [l_typename] => 股票停牌
                )

            [9] => Array
                (
                    [l_gcode] => 200011
                    [l_gdate] => 20190520
                    [l_gname] => 深物业B
                    [l_greason] => 10派3元
                    [l_type] => shareRegistList
                    [l_typename] => 分红转增
                )

            [10] => Array
                (
                    [l_gcode] => 000672
                    [l_gdate] => 20190520
                    [l_gname] => 上峰水泥
                    [l_greason] => 10派4元
                    [l_type] => shareDividendList
                    [l_typename] => 除权除息
                )

            [11] => Array
                (
                    [l_gcode] => 002253
                    [l_gdate] => 20190520
                    [l_gname] => 川大智胜
                    [l_greason] => 10派1.2元
                    [l_type] => shareDividendList
                    [l_typename] => 除权除息
                )

            [12] => Array
                (
                    [l_gcode] => 002392
                    [l_gdate] => 20190520
                    [l_gname] => 北京利尔
                    [l_greason] => 10派0.28元
                    [l_type] => shareDividendList
                    [l_typename] => 除权除息
                )

            [13] => Array
                (
                    [l_gcode] => 300021
                    [l_gdate] => 20190520
                    [l_gname] => 大禹节水
                    [l_greason] => 10派1元
                    [l_type] => shareDividendList
                    [l_typename] => 除权除息
                )

            [14] => Array
                (
                    [l_gcode] => 300041
                    [l_gdate] => 20190520
                    [l_gname] => 回天新材
                    [l_greason] => 10派1.525468元
                    [l_type] => shareDividendList
                    [l_typename] => 除权除息
                )

            [15] => Array
                (
                    [l_gcode] => 300348
                    [l_gdate] => 20190520
                    [l_gname] => 长亮科技
                    [l_greason] => 10转增5股派1.5元
                    [l_type] => shareDividendList
                    [l_typename] => 除权除息
                )

            [16] => Array
                (
                    [l_gcode] => 300383
                    [l_gdate] => 20190520
                    [l_gname] => 光环新网
                    [l_greason] => 10派0.2元
                    [l_type] => shareDividendList
                    [l_typename] => 除权除息
                )

            [17] => Array
                (
                    [l_gcode] => 300580
                    [l_gdate] => 20190520
                    [l_gname] => 贝斯特
                    [l_greason] => 10派1.6元
                    [l_type] => shareDividendList
                    [l_typename] => 除权除息
                )

            [18] => Array
                (
                    [l_gcode] => 600794
                    [l_gdate] => 20190520
                    [l_gname] => 保税科技
                    [l_greason] => 10派0.12元
                    [l_type] => shareDividendList
                    [l_typename] => 除权除息
                )

            [19] => Array
                (
                    [l_gcode] => 600963
                    [l_gdate] => 20190520
                    [l_gname] => 岳阳林纸
                    [l_greason] => 10派0.27元
                    [l_type] => shareDividendList
                    [l_typename] => 除权除息
                )

        )

)
Copyright © 好灵数据网 好灵数据网 网站地图 备案号:沪ICP备15043930号-1