参数名称 | 类型 | 必填 | 说明 |
---|---|---|---|
year | string | 否 | 年份 默认今年 |
参数名称 | 类型 | 说明 |
---|---|---|
now | string | 当前的节气 |
name | string | 节气名称 |
time | string | 时间 |
lunar | string | 农历 |
jieqiid | int | 节气ID |
pic | string | 图片 |
song | string | 节气歌 |
<?php require_once 'curl.func.php'; $appkey = 'your_appkey_here';//你的appkey $url = "https://api.jisuapi.com/jieqi/query?appkey=$appkey"; $result = curlOpen($url, ['ssl'=>true]); $jsonarr = json_decode($result, true); //exit(var_dump($jsonarr)); if($jsonarr['status'] != 0) { echo $jsonarr['msg']; exit(); } $result = $jsonarr['result']; echo $result['now']['name'].' '.$result['now']['time'].' '.implode(' ', $result['now']['lunar']).'
'; foreach($result['list'] as $val) { echo $val['jieqiid'].' '.$val['name'].' '.$val['pic'].' '.$val['time'].'
'; } echo $result['song'].'
';
{ "status": 0, "msg": "ok", "result": { "now": { "name": "小寒", "time": "2016-01-06 06:08:21", "lunar": [ "2015", "冬月", "廿七", "乙未", "11", "27", "羊", "0" ] }, "list": [ { "jieqiid": "1", "name": "立春", "pic": "http://m.46644.com/jieqi/static/images/jieqi/lc.png", "time": "2016-02-04 17:46:00" }, { "jieqiid": "2", "name": "雨水", "pic": "http://m.46644.com/jieqi/static/images/jieqi/ys.png", "time": "2016-02-19 13:33:41" } ], "song": "春雨惊春清谷天,夏满芒夏暑相连。秋处露秋寒霜降,冬雪雪冬小大寒。" } }
代号 | 说明 |
---|---|
201 | 节气ID为空 |
202 | 节气ID不正确 |
203 | 没有信息 |
代号 | 说明 |
---|---|
101 | APPKEY为空或不存在 |
102 | APPKEY已过期 |
103 | APPKEY无请求此数据权限 |
104 | 请求超过次数限制 |
105 | IP被禁止 |
106 | IP请求超过限制 |
107 | 接口维护中 |
108 | 接口已停用 |