首页 星座算命 八字排盘数据接口
八字排盘

八字排盘

49.00/10000次
申请就送1000次
根据出生的年月日、时辰、分钟,确定你的生辰八字、坤/乾造、纳音、旬空、行大运时间、流年等信息。
  • 收藏数:2426
  • 使用数:2286
http://api.jisuapi.com/bazi/paipan
JSON,JSONP
GET POST
http://api.jisuapi.com/bazi/paipan?year=2009&month=10&day=18&hour=2&minute=5&sex=1&city=&istaiyang=0&appkey=yourappkey

请求参数:

API在线测试
参数名称类型必填说明
name string 姓名
city string 城市
year string
month string
day string
hour string
minute string
sex string 性别 1男 0女
islunar int 是否是阴历 默认0阳历
istaiyang int 是否使用太阳时 默认0不使用

返回参数:

参数名称类型说明
year string
month string
day string
hour string
minute string
name string 姓名
city string 城市
istaiyang int 是否太阳时
lunaryear string 农历年
lunarmonth string 农历月
lunarday string 农历日
lunarhour string 农历时
animal string 生肖
yearganzhi string 年干支
jieqiprev string 出生的上一个节气
jieqiname string 节气名称
date string 节气日期
jieqinext string 出生的下一个节气
bazi string 八字
taiyuan string 胎元
minggong string 命宫
xunkong string 旬空
qiyun string 起运时间
jiaoyun string 交运时间
qiankunzao string 乾造/坤造
nayin string 纳音
shensha string 神煞 竖排
dayun string 大运
shishen string 大运年对应的食神
ganzhi string 大运年对应的干支
sui string 大运年对应的岁数
liunian string 流年
sex string 性别

请求代码:

查看代码
<?php

require_once 'curl.func.php';

$appkey = 'your_appkey_here';//你的appkey
$city = '';//utf8
$year=2009;
$month=10;
$day=18;
$hour=2;
$minute=5;
$sex=1;
$istaiyang=0;
$islunar=0;
$url = "http://api.jisuapi.com/bazi/paipan?appkey=$appkey&city=$city&year=$year&month=$month&day=$day&hour=$hour&minute=$minute&sex=$sex&istaiyang=$istaiyang&islunar=$islunar";
$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['year'].' '.$result['month'].' '.$result['day'].' '.$result['hour'].' '.$result['minute'].' '.$result['name'].' '.$result['city'].' '.$result['istaiyang'].' '.$result['lunaryear'].' '.$result['lunarmonth'].' '.$result['lunarday'].' '.$result['lunarhour'].' '.$result['animal'].' '.$result['yearganzhi'].'
'; echo '上一个节气:
'; echo $result['jieqiprev']['jieqiname'].' '.$result['jieqiprev']['date'].'
'; echo '下一个节气:
'; echo $result['jieqinext']['jieqiname'].' '.$result['jieqinext']['date'].'
'; echo implode(' ', $result['bazi']).' '.$result['taiyuan'].' '.$result['minggong'].' '.implode(' ', $result['xunkong']).'
'; echo implode(' ', $result['qiyun']).' '.implode(' ', $result['jiaoyun']).'
'; echo implode(' ', $result['qiankunzao'][0]).' '.implode(' ', $result['qiankunzao'][1]).' '.implode(' ', $result['qiankunzao'][2]).'
'; echo implode(' ', $result['nayin']).'
'; foreach($result['shensha'] as $shensha) { echo implode(' ', $shensha). '
'; } $dayun = $result['dayun']; echo implode(' ', $dayun['nayin']). '
'; echo implode(' ', $dayun['shishen']). '
'; echo implode(' ', $dayun['ganzhi']). '
'; echo implode(' ', $dayun['sui']). '
'; echo '流年:
'; foreach($result['liunian'] as $liunian) { echo implode(' ', $liunian). '
'; }

JSON返回示例 :

{
    "status": "0",
    "msg": "ok",
    "result": {
        "year": "2009",
        "month": "10",
        "day": "18",
        "hour": "02",
        "minute": "05",
        "name": "",
        "city": "",
        "istaiyang": "0",
        "lunaryear": "2009",
        "lunarmonth": "九月",
        "lunarday": "初一",
        "lunarhour": "丑时",
        "animal": "牛",
        "yearganzhi": "己丑",
        "jieqiprev": {
            "jieqiname": "寒露",
            "date": "2009-10-08 11:40:03"
        },
        "jieqinext": {
            "jieqiname": "立冬",
            "date": "2009-11-07 14:56:15"
        },
        "bazi": [
            "己丑",
            "甲戌",
            "丙申",
            "己丑"
        ],
        "taiyuan": "乙丑",
        "minggong": "庚午",
        "xunkong": [
            "午未",
            "申酉",
            "辰巳",
            "午未"
        ],
        "qiyun": {
            "year": "3",
            "month": "2",
            "day": "12",
            "hour": "2"
        },
        "jiaoyun": {
            "year": "2012",
            "month": "12",
            "day": "30",
            "hour": "04"
        },
        "qiankunzao": [
            [
                "伤官",
                "偏印",
                "日元",
                "伤官"
            ],
            [
                "己丑",
                "甲戌",
                "丙申",
                "己丑",
                "(辰巳空)"
            ],
            [
                [
                    "癸正官",
                    "辛正财",
                    "戊食神",
                    "癸正官"
                ]
            ]
        ],
        "nayin": [
            "霹雳火",
            "山头火",
            "山下火",
            "霹雳火"
        ],
        "shensha": [
            [
                "太极贵人",
                "华盖",
                "国印贵人",
                "十恶大败"
            ],
            [
                "太极贵人",
                "寡宿",
                "吊客"
            ]
        ],
        "dayun": {
            "nayin": [
                "山头火",
                "剑锋金"
            ],
            "shishen": [
                "偏印",
                "正官"
            ],
            "ganzhi": [
                "甲戌",
                "癸酉",
                "壬申"
            ],
            "sui": [
                "1-2岁",
                "3岁",
                "13岁",
                "23岁",
                "33岁"
            ],
            "year": [
                "2009",
                "2012",
                "2022",
                "2032"
            ]
        },
        "liunian": [
            [
                "己丑",
                "壬辰",
                "壬寅"
            ]
        ]
    }
}
                    

API错误码:

代号说明
201 日期不正确
202 时间不正确
210 没有信息

系统错误码:

代号说明
101 APPKEY为空或不存在
102 APPKEY已过期
103 APPKEY无请求此数据权限
104 请求超过次数限制
105 IP被禁止
106 IP请求超过限制
107 接口维护中
108 接口已停用
名称权限价格
免费套餐 1000次 免费
Level1 10000次 49.00元
Level2 20000次 97.00元
Level3 50000次 240.00元
Level4 100000次 475.00元

活动推荐ACTIVITY 更多

  • 短信

其它推荐RECOMMENDED DATA 更多