根据输入星座名返回相应含有星座数据,贵人方位、贵人星座、幸运数字、幸运颜色、爱情运势等信息的图片。
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| key | string | 是 | 接口调用密钥 | |
| msg | string | 是 | 你需要查询的星座 | 天秤 |
| hh | string | 否 | 换行符号(默认/n) | /n |
[
{
"name": "key",
"type": "string",
"required": true,
"description": "接口调用密钥",
"example": ""
},
{
"name": "msg",
"type": "string",
"required": true,
"description": "你需要查询的星座",
"example": "天秤"
},
{
"name": "hh",
"type": "string",
"required": false,
"description": "换行符号(默认/n)",
"example": "/n"
}
]
{
"openapi": "3.1.1",
"info": {
"title": "星座运势(图片版)",
"description": "根据输入星座名返回相应含有星座数据,贵人方位、贵人星座、幸运数字、幸运颜色、爱情运势等信息的图片。",
"version": "1.0.0"
},
"paths": {
"/api/yljk/xzys/api.php": {
"get": {
"summary": "星座运势(图片版)",
"description": "根据输入星座名返回相应含有星座数据,贵人方位、贵人星座、幸运数字、幸运颜色、爱情运势等信息的图片。",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
},
{
"name": "msg",
"in": "query",
"required": true,
"schema": {
"type": "string",
"example": "天秤"
},
"description": "你需要查询的星座"
},
{
"name": "hh",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "/n"
},
"description": "换行符号(默认/n)"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
},
"post": {
"summary": "星座运势(图片版)",
"description": "根据输入星座名返回相应含有星座数据,贵人方位、贵人星座、幸运数字、幸运颜色、爱情运势等信息的图片。",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
},
{
"name": "msg",
"in": "query",
"required": true,
"schema": {
"type": "string",
"example": "天秤"
},
"description": "你需要查询的星座"
},
{
"name": "hh",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "/n"
},
"description": "换行符号(默认/n)"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://api-v2.317ak.com",
"description": "当前访问入口(https)"
}
]
}
根据输入的星座名返回对应的星座运势图片内容,包含星座相关信息展示。
适用于需要获取星座运势图片数据的应用场景。
https://api-v2.317ak.com/api/yljk/xzys/api.php
支持 GET、POST 请求方式。
接口调用需要提供密钥进行鉴权。
首选鉴权方式:Query 参数。
请求时需在 Query 中添加 key 参数传递接口调用密钥。
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| key | string | 是 | 接口调用密钥,通过 Query 参数 key 传递。 |
| msg | string | 是 | 需要查询的星座名称,例如:天秤。 |
| hh | string | 否 | 换行符号,默认使用 /n。 |
该接口成功调用后返回星座运势图片,图片内容包含对应星座的数据、贵人方位、贵人星座、幸运数字、幸运颜色、爱情运势等信息。
返回内容为图片资源,示例:
图片地址或图片内容
| 字段 | 类型 | 说明 |
|---|---|---|
| 图片内容 | image | 返回对应星座运势信息图片,包含星座相关数据及运势内容展示 |
请求接口发生错误时,返回统一 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/xzys/api.php" \
--data-urlencode "key=你的接口密钥" \
--data-urlencode "msg=天秤" \
--data-urlencode "hh=/n"
// PHP
$url = "https://api-v2.317ak.com/api/yljk/xzys/api.php";
$params = [
"key" => "你的接口密钥",
"msg" => "天秤",
"hh" => "/n"
];
$response = file_get_contents($url. "?". http_build_query($params));
echo $response;
key 参数内容。msg 参数需填写有效的星座名称,例如“天秤”。建议使用接口支持的标准星座名称格式,避免因名称错误导致查询失败。hh 参数用于设置图片内容中的换行符号,未传入时接口会使用默认换行设置;如需调整展示效果,请传入符合要求的换行格式。# 获取星座运势图片
res=$(curl -s -G 'https://api-v2.317ak.com/api/yljk/xzys/api.php' \
--data-urlencode 'key=YOUR_API_KEY' \
--data-urlencode 'msg=天秤' \
--data-urlencode 'hh=/n')
echo "$res"
# 成功状态code为0
[ "$(echo "$res" | grep -o '"code":[0-9]*' | grep -o '[0-9]*')" = "0" ] || echo 'error'