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

接口说明/ API

接口说明: 返回指定日期的所有股票收盘数据.

接口地址: http://i.h0.cn/log.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 =shouPan 接口名称(固定: actName=shouPan)
date Int 20190530 返回日期是20190530日的所有的股票收盘数据

返回参数/ Return parameter

JSON格式返回结果。

1、系统级参数(所有接口都会返回的参数):
名称 类型 示例值 描述
msg String 接口执行情况描述。
code int 100 好灵数据网 接口执行状态,正数代表执行成功,负数代表执行失败。
 100, 接口成功,数据查询成功.
-101,系统签名sign验证失败
2、应用级参数(每个接口有自己独有的返回数值.):
名称 类型 示例值 描述
data array[] 股票分类列表
- l_gcode String 股票编号
- l_date String 股票名称
- l_kaipan Float 股票开盘价格
- l_zuigao Float 当日最高股票价格
- l_zuidi Float 当日最低股票价格
- l_shoupan Float 当日收盘股票价格
- l_zuoshou Float 昨日收盘股票价格
- l_cjgu Int 成交股数
- l_cjprice Float 成交价值
- l_sdprice Float 当日股票升跌值
- l_sdbili Float 当日升跌比例
- l_suo Int -
- l_gdchabi Float 高低差比
- l_huanshoulv Float 换手率
- l_total Float 总市值/亿
- l_liutong Float 流通市值/亿

请求示例/ 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/log.php?actName=shouPan&page=1&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/log.php', true);
                    xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
                    xhr.send('actName=shouPan&page=1&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=shouPan&page=1&m_id=[m_id]&sign=[sign]'
                    http://i.h0.cn/log.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':'shouPan','page':'1','m_id':m_id,'sign':sign}
                    url='http://i.h0.cn/log.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":10,"data":[{"l_gcode":"sz300414","l_date":"20190529","l_kaipan":"10.39","l_zuigao":"10.77","l_zuidi":"10.17","l_shoupan":"10.58","l_zuoshou":"10.57","l_cjgu":"76258","l_cjprice":"8043.00","l_sdprice":"0.010","l_sdbili":"0.090","l_suo":"0","l_gdchabi":"5.775","l_huanshoulv":"2.550","l_total":"34.360","l_liutong":"31.660"},{"l_gcode":"sz002182","l_date":"20190529","l_kaipan":"7.40","l_zuigao":"7.55","l_zuidi":"7.34","l_shoupan":"7.50","l_zuoshou":"7.39","l_cjgu":"80191","l_cjprice":"5987.00","l_sdprice":"0.110","l_sdbili":"1.490","l_suo":"0","l_gdchabi":"2.838","l_huanshoulv":"1.530","l_total":"48.480","l_liutong":"39.340"},{"l_gcode":"sz002936","l_date":"20190529","l_kaipan":"5.15","l_zuigao":"5.22","l_zuidi":"5.11","l_shoupan":"5.18","l_zuoshou":"5.14","l_cjgu":"107122","l_cjprice":"5537.00","l_sdprice":"0.040","l_sdbili":"0.780","l_suo":"0","l_gdchabi":"2.136","l_huanshoulv":"1.790","l_total":"306.760","l_liutong":"31.080"},{"l_gcode":"sz000812","l_date":"20190529","l_kaipan":"3.87","l_zuigao":"4.04","l_zuidi":"3.84","l_shoupan":"3.97","l_zuoshou":"4.02","l_cjgu":"211270","l_cjprice":"8323.00","l_sdprice":"-0.050","l_sdbili":"-1.240","l_suo":"0","l_gdchabi":"5.168","l_huanshoulv":"3.150","l_total":"30.520","l_liutong":"26.610"},{"l_gcode":"sz002481","l_date":"20190529","l_kaipan":"5.99","l_zuigao":"6.16","l_zuidi":"5.82","l_shoupan":"6.04","l_zuoshou":"5.84","l_cjgu":"1128151","l_cjprice":"67366.00","l_sdprice":"0.200","l_sdbili":"3.420","l_suo":"0","l_gdchabi":"5.676","l_huanshoulv":"10.190","l_total":"75.100","l_liutong":"66.870"},{"l_gcode":"sz000683","l_date":"20190529","l_kaipan":"2.83","l_zuigao":"2.86","l_zuidi":"2.82","l_shoupan":"2.83","l_zuoshou":"2.84","l_cjgu":"301115","l_cjprice":"8547.00","l_sdprice":"-0.010","l_sdbili":"-0.350","l_suo":"0","l_gdchabi":"1.413","l_huanshoulv":"1.050","l_total":"112.540","l_liutong":"80.810"},{"l_gcode":"sz000430","l_date":"20190529","l_kaipan":"5.55","l_zuigao":"5.57","l_zuidi":"5.51","l_shoupan":"5.55","l_zuoshou":"5.56","l_cjgu":"13549","l_cjprice":"751.00","l_sdprice":"-0.010","l_sdbili":"-0.180","l_suo":"0","l_gdchabi":"1.081","l_huanshoulv":"0.410","l_total":"22.470","l_liutong":"18.410"},{"l_gcode":"sz000826","l_date":"20190529","l_kaipan":"9.93","l_zuigao":"10.07","l_zuidi":"9.85","l_shoupan":"9.99","l_zuoshou":"9.94","l_cjgu":"96463","l_cjprice":"9642.00","l_sdprice":"0.050","l_sdbili":"0.500","l_suo":"0","l_gdchabi":"2.216","l_huanshoulv":"0.810","l_total":"142.910","l_liutong":"118.450"},{"l_gcode":"sz300731","l_date":"20190529","l_kaipan":"24.17","l_zuigao":"25.26","l_zuidi":"23.90","l_shoupan":"25.00","l_zuoshou":"24.05","l_cjgu":"18770","l_cjprice":"4653.00","l_sdprice":"0.950","l_sdbili":"3.950","l_suo":"0","l_gdchabi":"5.627","l_huanshoulv":"3.200","l_total":"22.300","l_liutong":"14.680"},{"l_gcode":"sz300164","l_date":"20190529","l_kaipan":"6.26","l_zuigao":"6.38","l_zuidi":"6.22","l_shoupan":"6.30","l_zuoshou":"6.28","l_cjgu":"64572","l_cjprice":"4077.00","l_sdprice":"0.020","l_sdbili":"0.320","l_suo":"0","l_gdchabi":"2.556","l_huanshoulv":"2.040","l_total":"28.430","l_liutong":"19.990"}]}
JSON转数组后:
Array
(
    [code] => 100
    [msg] => 数据获取成功.
    [dataNums] => 10
    [data] => Array
        (
            [0] => Array
                (
                    [l_gcode] => sz300414
                    [l_date] => 20190529
                    [l_kaipan] => 10.39
                    [l_zuigao] => 10.77
                    [l_zuidi] => 10.17
                    [l_shoupan] => 10.58
                    [l_zuoshou] => 10.57
                    [l_cjgu] => 76258
                    [l_cjprice] => 8043.00
                    [l_sdprice] => 0.010
                    [l_sdbili] => 0.090
                    [l_suo] => 0
                    [l_gdchabi] => 5.775
                    [l_huanshoulv] => 2.550
                    [l_total] => 34.360
                    [l_liutong] => 31.660
                )

            [1] => Array
                (
                    [l_gcode] => sz002182
                    [l_date] => 20190529
                    [l_kaipan] => 7.40
                    [l_zuigao] => 7.55
                    [l_zuidi] => 7.34
                    [l_shoupan] => 7.50
                    [l_zuoshou] => 7.39
                    [l_cjgu] => 80191
                    [l_cjprice] => 5987.00
                    [l_sdprice] => 0.110
                    [l_sdbili] => 1.490
                    [l_suo] => 0
                    [l_gdchabi] => 2.838
                    [l_huanshoulv] => 1.530
                    [l_total] => 48.480
                    [l_liutong] => 39.340
                )

            [2] => Array
                (
                    [l_gcode] => sz002936
                    [l_date] => 20190529
                    [l_kaipan] => 5.15
                    [l_zuigao] => 5.22
                    [l_zuidi] => 5.11
                    [l_shoupan] => 5.18
                    [l_zuoshou] => 5.14
                    [l_cjgu] => 107122
                    [l_cjprice] => 5537.00
                    [l_sdprice] => 0.040
                    [l_sdbili] => 0.780
                    [l_suo] => 0
                    [l_gdchabi] => 2.136
                    [l_huanshoulv] => 1.790
                    [l_total] => 306.760
                    [l_liutong] => 31.080
                )

            [3] => Array
                (
                    [l_gcode] => sz000812
                    [l_date] => 20190529
                    [l_kaipan] => 3.87
                    [l_zuigao] => 4.04
                    [l_zuidi] => 3.84
                    [l_shoupan] => 3.97
                    [l_zuoshou] => 4.02
                    [l_cjgu] => 211270
                    [l_cjprice] => 8323.00
                    [l_sdprice] => -0.050
                    [l_sdbili] => -1.240
                    [l_suo] => 0
                    [l_gdchabi] => 5.168
                    [l_huanshoulv] => 3.150
                    [l_total] => 30.520
                    [l_liutong] => 26.610
                )

            [4] => Array
                (
                    [l_gcode] => sz002481
                    [l_date] => 20190529
                    [l_kaipan] => 5.99
                    [l_zuigao] => 6.16
                    [l_zuidi] => 5.82
                    [l_shoupan] => 6.04
                    [l_zuoshou] => 5.84
                    [l_cjgu] => 1128151
                    [l_cjprice] => 67366.00
                    [l_sdprice] => 0.200
                    [l_sdbili] => 3.420
                    [l_suo] => 0
                    [l_gdchabi] => 5.676
                    [l_huanshoulv] => 10.190
                    [l_total] => 75.100
                    [l_liutong] => 66.870
                )

            [5] => Array
                (
                    [l_gcode] => sz000683
                    [l_date] => 20190529
                    [l_kaipan] => 2.83
                    [l_zuigao] => 2.86
                    [l_zuidi] => 2.82
                    [l_shoupan] => 2.83
                    [l_zuoshou] => 2.84
                    [l_cjgu] => 301115
                    [l_cjprice] => 8547.00
                    [l_sdprice] => -0.010
                    [l_sdbili] => -0.350
                    [l_suo] => 0
                    [l_gdchabi] => 1.413
                    [l_huanshoulv] => 1.050
                    [l_total] => 112.540
                    [l_liutong] => 80.810
                )

            [6] => Array
                (
                    [l_gcode] => sz000430
                    [l_date] => 20190529
                    [l_kaipan] => 5.55
                    [l_zuigao] => 5.57
                    [l_zuidi] => 5.51
                    [l_shoupan] => 5.55
                    [l_zuoshou] => 5.56
                    [l_cjgu] => 13549
                    [l_cjprice] => 751.00
                    [l_sdprice] => -0.010
                    [l_sdbili] => -0.180
                    [l_suo] => 0
                    [l_gdchabi] => 1.081
                    [l_huanshoulv] => 0.410
                    [l_total] => 22.470
                    [l_liutong] => 18.410
                )

            [7] => Array
                (
                    [l_gcode] => sz000826
                    [l_date] => 20190529
                    [l_kaipan] => 9.93
                    [l_zuigao] => 10.07
                    [l_zuidi] => 9.85
                    [l_shoupan] => 9.99
                    [l_zuoshou] => 9.94
                    [l_cjgu] => 96463
                    [l_cjprice] => 9642.00
                    [l_sdprice] => 0.050
                    [l_sdbili] => 0.500
                    [l_suo] => 0
                    [l_gdchabi] => 2.216
                    [l_huanshoulv] => 0.810
                    [l_total] => 142.910
                    [l_liutong] => 118.450
                )

            [8] => Array
                (
                    [l_gcode] => sz300731
                    [l_date] => 20190529
                    [l_kaipan] => 24.17
                    [l_zuigao] => 25.26
                    [l_zuidi] => 23.90
                    [l_shoupan] => 25.00
                    [l_zuoshou] => 24.05
                    [l_cjgu] => 18770
                    [l_cjprice] => 4653.00
                    [l_sdprice] => 0.950
                    [l_sdbili] => 3.950
                    [l_suo] => 0
                    [l_gdchabi] => 5.627
                    [l_huanshoulv] => 3.200
                    [l_total] => 22.300
                    [l_liutong] => 14.680
                )

            [9] => Array
                (
                    [l_gcode] => sz300164
                    [l_date] => 20190529
                    [l_kaipan] => 6.26
                    [l_zuigao] => 6.38
                    [l_zuidi] => 6.22
                    [l_shoupan] => 6.30
                    [l_zuoshou] => 6.28
                    [l_cjgu] => 64572
                    [l_cjprice] => 4077.00
                    [l_sdprice] => 0.020
                    [l_sdbili] => 0.320
                    [l_suo] => 0
                    [l_gdchabi] => 2.556
                    [l_huanshoulv] => 2.040
                    [l_total] => 28.430
                    [l_liutong] => 19.990
                )

        )

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