随机抽签算卦
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| key | string | 是 | 接口调用密钥 | |
| type | string | 否 | 不填默认为json,可填text/json/text1 | json |
[
{
"name": "key",
"type": "string",
"required": true,
"description": "接口调用密钥",
"example": ""
},
{
"name": "type",
"type": "string",
"required": false,
"description": "不填默认为json,可填text/json/text1",
"example": "json"
}
]
{
"openapi": "3.1.1",
"info": {
"title": "抽签算卦",
"description": "随机抽签算卦",
"version": "1.0.0"
},
"paths": {
"/api/yljk/cqsg/api.php": {
"get": {
"summary": "抽签算卦",
"description": "随机抽签算卦",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
},
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "json"
},
"description": "不填默认为json,可填text/json/text1"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
},
"post": {
"summary": "抽签算卦",
"description": "随机抽签算卦",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
},
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "json"
},
"description": "不填默认为json,可填text/json/text1"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://api-v2.317ak.com",
"description": "当前访问入口(https)"
}
]
}
{
"code": 1,
"text": "获取成功",
"data": {
"format": 70,
"draw": "李密反唐 (下签)",
"annotate": "此卦蜜蜂采花之象,凡事劳心费力也。",
"explain": "无觅春色 久雨不晴 求谋用事 不如安静",
"details": "家宅口舌 婚姻不长 疾病有阻 公讼亏 自身小人 六甲虚花 行人杳 失物空 求财破耗 寻人无踪 田蚕损 山坟改 交易反复 移徙守旧 六畜损",
"source": "李密反唐。隋末。李密瓦岗寨之首领。自封魏王。李密手下名将如秦琼。单雄信。程咬金。纷投唐王李渊。李密与王伯当后亦投李渊。又娶李仁公之公主为妻。后杀妻反唐。被乱箭射死时三十七岁。",
"image": "https://api.317ak.com/API/yljk/cqsg/cache/image/70.gif"
}
}
抽签算卦接口用于随机生成签文内容,适用于娱乐类应用场景。
用户可通过接口获取随机抽签结果及相关解析信息。
https://api-v2.317ak.com/api/yljk/cqsg/api.php
GET、POST
接口调用需要提供密钥进行鉴权,采用 Query 参数方式传递:
key=接口调用密钥
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
key |
string | 是 | 接口调用密钥 |
type |
string | 否 | 返回格式类型,不填写时默认为 json,可填写 text、json、text1 |
{
"code": 1,
"text": "获取成功",
"data": {
"format": 70,
"draw": "李密反唐 (下签)",
"annotate": "此卦蜜蜂采花之象,凡事劳心费力也。",
"explain": "无觅春色 久雨不晴 求谋用事 不如安静",
"details": "家宅口舌 婚姻不长 疾病有阻 公讼亏 自身小人 六甲虚花 行人杳 失物空 求财破耗 寻人无踪 田蚕损 山坟改 交易反复 移徙守旧 六畜损",
"source": "李密反唐。隋末。李密瓦岗寨之首领。自封魏王。李密手下名将如秦琼。单雄信。程咬金。纷投入唐王李渊。李密与王伯当后亦投李渊。又娶李仁公之公主为妻。后杀妻反唐。被乱箭射死时三十七岁。",
"image": "https://api.317ak.com/API/yljk/cqsg/cache/image/70.gif"
}
}
| 字段 | 类型 | 说明 |
|---|---|---|
code |
number | 请求处理状态,成功时返回 1 |
text |
string | 返回提示信息 |
data |
object | 抽签算卦结果数据 |
data.format |
number | 签文编号 |
data.draw |
string | 抽取到的签名及签位信息 |
data.annotate |
string | 签文注解 |
data.explain |
string | 签文简要解释 |
data.details |
string | 详细签文内容 |
data.source |
string | 签文相关典故说明 |
data.image |
string | 签文图片地址 |
接口发生业务异常时,返回 JSON 格式错误信息:
{
"code": 0,
"msg": "未提供调用密钥",
"errcode": 11001
}
| errcode | 含义 |
|---|---|
| 11001 | 未提供调用密钥 |
| 11002 | 密钥错误 |
| 11003 | 密钥已禁用 |
| 11004 | 积分余额不足 |
| 11005 | 请求过于频繁(QPM 限制) |
| 11006 | 接口维护中 |
| 11007 | 接口已禁用 |
| 11008 | 接口不可用 |
| 11009 | 密钥校验暂不可用 |
| 11010 | 积分系统暂不可用 |
| 11011 | 收费接口须提供有效密钥 |
| 11012 | 鉴权方式错误 |
| 11013 | 接口不存在 |
| 11014 | ***地址无效 |
| 11015 | ***地址不允许 |
| 11016 | ***请求失败 |
| 11017 | 服务暂不可用 |
| 11018 | 请求方式不允许 |
| 11019 | 当前IP不在白名单内 |
| 11020 | 启用出口代理须提供有效密钥 |
| 11021 | 未配置可用出口代理 |
| 11022 | 出口代理不可用 |
| 11023 | 密钥已过期 |
| 11024 | 令牌分配积分不足 |
curl -G "https://api-v2.317ak.com/api/yljk/cqsg/api.php" \
--data-urlencode "key=你的接口密钥" \
--data-urlencode "type=json"
// PHP
$url = "https://api-v2.317ak.com/api/yljk/cqsg/api.php?key=你的接口密钥&type=json";
$response = file_get_contents($url);
echo $response;
key 为必填参数;type 为可选参数,不填写时默认返回 JSON 格式,可根据需求填写 json、text 或 text1。curl -G "https://api-v2.317ak.com/api/yljk/cqsg/api.php" \
--data-urlencode "key=YOUR_API_KEY" \
--data-urlencode "type=json"