参数名称 | 类型 | 必填 | 说明 |
---|---|---|---|
code | string | 是 | 股票代码 |
startdate | string | 否 | 开始时间 |
enddate | string | 否 | 结束时间 |
参数名称 | 类型 | 说明 |
---|---|---|
name | string | 股票名称 |
code | string | 股票代码 |
startdate | string | 开始时间 |
enddate | string | 结束时间 |
stockid | string | 股票ID |
date | string | 日期 |
openningprice | string | 开盘价 |
closingprice | string | 收盘价 |
maxprice | string | 最高价 |
minprice | string | 最低价 |
tradenum | string | 成交量(手) |
tradeamount | string | 成交额 |
turnoverrate | string | 换手率 |
changepercent | string | 涨跌幅 |
changeamount | string | 涨跌额 |
amplitude | string | 振幅 |
per | string | 市盈率 |
pbr | string | 市净率 |
totalmarket | string | 总市值 |
circulationmarket | string | 流通市值 |
<?php require_once 'curl.func.php'; $appkey = 'your_appkey_here';//你的appkey $url = "https://api.jisuapi.com/stockhistory/query?code=300917&startdate=2020-12-24&enddate=2020-12-25&appkey=$appkey"; $result = curlOpen($url); $jsonarr = json_decode($result, true); //exit(var_dump($jsonarr)); if($jsonarr['status'] != 0) { echo $jsonarr['msg']; exit(); } $result = $jsonarr['result']; echo $result['code'].' '.$result['name'].' '.$result['startdate'].' '.$result['enddate'].' '.'
'; $list = $result['list']; foreach($list as $val) { echo $val['stockid'].' '.$val['date'].' '.$val['openningprice'].' '.$val['closingprice'].' '.$val['maxprice'].' '.$val['minprice'].' '.$val['tradenum'].' '.$val['tradeamount'].' '.$val['turnoverrate'].' '.$val['changepercent'].' '.$val['changeamount'].' '.$val['amplitude'].' '.$val['per'].' '.$val['pbr'].' '.$val['totalmarket'].' '.$val['circulationmarket'].' '.'
'; }
{ "status": 0, "msg": "ok", "result": { "code": "300917", "name": "C特发", "startdate": "2020-12-24", "enddate": "2020-12-25", "list": [ { "stockid": 6769, "date": "2020-12-24", "openningprice": "40.10", "closingprice": "53.92", "maxprice": "54.20", "minprice": "40.10", "tradenum": 166623, "tradeamount": "756991472.00", "turnoverrate": "78.110", "changepercent": "32.48", "changeamount": "13.22", "amplitude": "34.64", "per": null, "pbr": null, "totalmarket": null, "circulationmarket": null }, { "stockid": 6769, "date": "2020-12-25", "openningprice": "51.01", "closingprice": "44.04", "maxprice": "51.88", "minprice": "43.80", "tradenum": 132553, "tradeamount": "619542864.00", "turnoverrate": "62.130", "changepercent": "-18.32", "changeamount": "-9.88", "amplitude": "14.99", "per": null, "pbr": null, "totalmarket": null, "circulationmarket": null } ] } }
代号 | 说明 |
---|---|
201 | 股票代码为空 |
202 | 股票代码不存在 |
210 | 没有信息 |
代号 | 说明 |
---|---|
101 | APPKEY为空或不存在 |
102 | APPKEY已过期 |
103 | APPKEY无请求此数据权限 |
104 | 请求超过次数限制 |
105 | IP被禁止 |
106 | IP请求超过限制 |
107 | 接口维护中 |
108 | 接口已停用 |