1912-2100年黄历信息查询。按年月日查询农历、星座、生肖、胎神、喜神、五行、冲、煞、吉日、值日天神、凶神、吉神宜趋、财神、喜神、福神、岁次、宜、忌、星期等黄历信息。
接口ID 47
请求方式 GET/POST
返回格式 JSON
HTTP/HTTPS 支持
接口价格 低至¥0.0007/次
接口地址 https://yuanxiapi.cn/api/
参数说明 获取秘钥
参数 | 必填 | 说明 |
---|---|---|
id | 是 | 接口ID |
key | 是 | 对接秘钥 |
year | 是 | 年 |
month | 是 | 月 |
day | 是 | 日 |
返回参数
名称 | 说明 | ||
---|---|---|---|
year | 年 | ||
month | 月 | ||
day | 日 | ||
yangli | 阳历日期 | ||
nongli | 农历日期 | ||
week | 周几 | ||
emonth | 英文月 | ||
eweek | 英文周几 | ||
star | 星座 | ||
shengxiao | 生肖 | ||
wuxing | 五行 | ||
taishen | 胎神 | ||
chong | 冲 | ||
sha | 煞 | ||
jiri | 吉日 | ||
zhiri | 值日天神 | ||
xiongshen | 凶神 | ||
jishenyiqu | 吉神宜趋 | ||
caishen | 财神 | ||
xishen | 喜神 | ||
fushen | 福神 | ||
suici | 岁次 | ||
yi | 宜 | ||
ji | 忌 | ||
code | 200:成功; 计费 | ||
user_info | 用户信息; zid:用户ID; rmb:余额; login_time:最近登录; |
返回示例
{ "code": 200, "msg": "success", "data": { "year": "2025", "month": "7", "day": "4", "yangli": "公元2025年07月04日", "nongli": "农历二〇二五年六月初十", "week": "五", "emonth": "July", "eweek": "FRIDAY", "star": "巨蟹座", "shengxiao": "蛇", "wuxing": "山头火", "taishen": "门鸡栖外西南", "chong": "冲(戊辰)龙", "sha": "煞北", "jiri": null, "zhiri": "天刑(黑道日)", "xiongshen": "狱日 死气 官符 临日 天刑 五鬼", "jishenyiqu": "七圣 神在 天仓 三合 普护 时阴 不将", "caishen": "东北", "xishen": "东北", "fushen": "正北", "suici": [ "乙巳年", "壬午月", "甲戌日" ], "yi": [ "嫁娶", "纳采", "祭祀", "祈福", "出行", "立券", "移徙", "入宅", "动土", "破土", "安葬" ], "ji": [ "开光", "作灶", "造屋", "架马", "开仓" ] }, "user_info": { "zid": "217", "rmb": "42.62457", "login_time": "2025-07-25 13:20:51" } }
服务级错误码(code)
错误码 | 说明 |
---|---|
201 | 请求参数错误 |
202 | 查询失败 |
203 | 请求错误 |
204 | 查无结果 |
系统级错误码(error_code)
错误码 | 说明 |
---|---|
101 | 错误的请求KEY |
102 | 被禁止的KEY |
103 | 被禁止的IP |
104 | 请求超过次数限制 |
105 | 此IP请求超过限制 |
106 | 未知的请求源 |
107 | 接口维护 |
108 | 余额不足 |
109 | 未完成认证 |
110 | 接口不存在 |
PHP代码示例:
<?php //GET请求记得用:urldecode $api_url='https://yuanxiapi.cn/api/'; $api_id='接口ID'; $key='秘钥'; $post_arr=array('id'=>$api_id,'key'=>$key,'phone'=>'参数值'); $post=http_build_query($post_arr); $data=get_curl($api_url,$post); print_r($data); function get_curl($url, $post=0, $referer=0, $cookie=0, $header=0, $ua=0, $nobaody=0, $addheader=0){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); $httpheader[] = "Accept: */*"; $httpheader[] = "Accept-Encoding: gzip,deflate,sdch"; $httpheader[] = "Accept-Language: zh-CN,zh;q=0.8"; $httpheader[] = "Connection: close"; if($addheader){ $httpheader = array_merge($httpheader, $addheader); } curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader); if ($post) { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); } if ($header) { curl_setopt($ch, CURLOPT_HEADER, true); } if ($cookie) { curl_setopt($ch, CURLOPT_COOKIE, $cookie); } if($referer){ if($referer==1){ curl_setopt($ch, CURLOPT_REFERER, 'http://m.qzone.com/infocenter?g_f='); }else{ curl_setopt($ch, CURLOPT_REFERER, $referer); } } if ($ua) { curl_setopt($ch, CURLOPT_USERAGENT, $ua); } else { curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Linux; U; Android 4.0.4; es-mx; HTC_One_X Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0"); } if ($nobaody) { curl_setopt($ch, CURLOPT_NOBODY, 1); } curl_setopt($ch, CURLOPT_ENCODING, "gzip"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $ret = curl_exec($ch); curl_close($ch); return $ret; } ?>