星座运势 API 文档
本组接口提供 12 星座的日 / 周 / 月 / 年运势查询,以及一次性返回 12 星座当日运势的批量接口。所有接口均支持 POST 请求,统一返回 JSON。每个接口下方均提供在线测试工具,可直接发送请求验证。
接口总览
| 接口 | 功能 | 输入 | 输出 |
|---|---|---|---|
POST /horoscopes | 今日十二星座运势(远端文本 + 本地得分) | 无 / 可选日期 | 12 星座完整运势 |
POST /horoscopes/day | 单星座日运 | 星座名称 | 分类运势 + 得分 + 幸运元素 |
POST /horoscopes/week | 单星座周运 | 星座名称 | 分类运势 + 得分 + 幸运元素 |
POST /horoscopes/month | 单星座月运 | 星座名称 | 分类运势 + 得分 + 幸运元素 |
POST /horoscopes/year | 单星座年运 | 星座名称 | 分类运势 + 得分 + 幸运元素 |
POST /horoscopes
今日十二星座运势 — 一次请求返回全部 12 个星座的当日运势
基本信息
| 参数 | 值 |
|---|---|
| Base URL | https://chart.12sign.top |
| 接口 URL | /horoscopes |
| 请求方式 | POST |
| Content-Type | application/json |
| 是否需要身份验证 | 否 |
| 是否需要用户出生数据 | 否 |
请求参数
请求体可为空({})或不传。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
date | string | 否 | 查询日期,格式 YYYYMMDD,默认当天 |
请求示例
POST https://chart.12sign.top/horoscopes
Content-Type: application/json
{}
返回参数
| 字段 | 类型 | 说明 |
|---|---|---|
status | string | 请求状态,成功时返回 success |
data | array | 12 星座运势数组,共 12 项 |
data[].zodiac | string | 星座中文名 |
data[].name | string | 星座中文名(同 zodiac) |
data[].sign | string | 星座英文名 |
data[].date | string | 查询日期(YYYYMMDD) |
data[].score_overall | integer | 综合运势得分(0-99) |
data[].score_love | integer | 爱情运势得分(0-99) |
data[].score_career | integer | 事业运势得分(0-99) |
data[].score_money | integer | 财富运势得分(0-99) |
data[].score_health | integer | 健康运势得分(0-99) |
data[].lucky_color | string | 幸运颜色 |
data[].lucky_number | integer | 幸运数字(1-9) |
data[].lucky_direction | string | 幸运方向 |
data[].lucky_time | string | 幸运时间段 |
data[].lucky_food | string | 幸运食物 |
data[].lucky_companion | string | 幸运小物 |
data[].lucky_flower | string | 幸运花 |
此外,data[] 还可能包含其他运势文本字段(如远端返回的解读文案等),具体以接口实际返回为准。
返回示例
{
"status": "success",
"data": [
{
"zodiac": "白羊座",
"name": "白羊座",
"sign": "Aries",
"date": "20260805",
"score_overall": 85,
"score_love": 90,
"score_career": 78,
"score_money": 88,
"score_health": 82,
"lucky_color": "火焰红",
"lucky_number": 9,
"lucky_direction": "东南",
"lucky_time": "09:00 - 11:00",
"lucky_food": "川味火锅",
"lucky_companion": "便携小镜子",
"lucky_flower": "向日葵"
}
// ... 其余 11 个星座
]
}
星座对照表
| 序号 | 英文名 (sign) | 中文名 (zodiac) | 日期范围 |
|---|---|---|---|
| 1 | Aries | 白羊座 | 3.21 - 4.19 |
| 2 | Taurus | 金牛座 | 4.20 - 5.20 |
| 3 | Gemini | 双子座 | 5.21 - 6.21 |
| 4 | Cancer | 巨蟹座 | 6.22 - 7.22 |
| 5 | Leo | 狮子座 | 7.23 - 8.22 |
| 6 | Virgo | 处女座 | 8.23 - 9.22 |
| 7 | Libra | 天秤座 | 9.23 - 10.23 |
| 8 | Scorpio | 天蝎座 | 10.24 - 11.22 |
| 9 | Sagittarius | 射手座 | 11.23 - 12.21 |
| 10 | Capricorn | 摩羯座 | 12.22 - 1.19 |
| 11 | Aquarius | 水瓶座 | 1.20 - 2.18 |
| 12 | Pisces | 双鱼座 | 2.19 - 3.20 |
cURL 调用示例
curl -X POST https://chart.12sign.top/horoscopes \
-H "Content-Type: application/json" \
-d '{}'
Python 测试代码示例
import requests
def test_horoscopes(base_url="https://chart.12sign.top"):
url = f"{base_url}/horoscopes"
try:
print("正在测试12星座每日运势API...")
response = requests.post(url, json={}, headers={'Content-Type': 'application/json'})
print(f"响应状态码: {response.status_code}")
if response.status_code == 200:
data = response.json()
print("API测试成功!")
print(f"返回星座数量: {len(data.get('data', []))}")
for item in data.get('data', []):
print(f"\n=== {item['sign']} / {item['zodiac']} ({item['date']}) ===")
print(f"综合分: {item.get('score_overall')}")
print(f"爱情分: {item.get('score_love')}")
print(f"事业分: {item.get('score_career')}")
print(f"幸运色: {item.get('lucky_color')}")
return data
else:
print(f"API请求失败: {response.status_code}")
print(f"错误信息: {response.text}")
return None
except Exception as e:
print(f"请求出错: {e}")
return None
if __name__ == "__main__":
test_horoscopes()
JavaScript (Fetch) 调用示例
fetch('https://chart.12sign.top/horoscopes', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
})
.then(res => res.json())
.then(data => {
console.log('返回状态:', data.status);
data.data.forEach(item => {
console.log(`${item.sign} / ${item.zodiac} (${item.date})`);
console.log('综合分:', item.score_overall);
console.log('幸运色:', item.lucky_color);
});
})
.catch(err => console.error('请求失败:', err));
在线测试
请求地址:
https://chart.12sign.top/horoscopes
请求参数(JSON):
返回结果:
点击"发送请求"后在此显示结果
POST /horoscopes/day
单星座日运 — 传入星座名称,返回该星座当天的分类运势、得分及幸运元素
基本信息
| 参数 | 值 |
|---|---|
| Base URL | https://chart.12sign.top |
| 接口 URL | /horoscopes/day |
| 请求方式 | POST |
| Content-Type | application/json |
| 是否需要身份验证 | 否 |
| 是否需要用户出生数据 | 否 |
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
zodiac | string | 是 | 星座中文名,如 "白羊座" |
date | string | 否 | 查询日期,格式 YYYY-MM-DD,默认当天 |
可选星座值
白羊座、金牛座、双子座、巨蟹座、狮子座、处女座、天秤座、天蝎座、射手座、摩羯座、水瓶座、双鱼座
请求示例
POST https://chart.12sign.top/horoscopes/day
Content-Type: application/json
{
"zodiac": "白羊座"
}
返回参数
| 字段 | 类型 | 说明 |
|---|---|---|
zodiac | string | 星座中文名 |
date | string | 查询日期(YYYY-MM-DD) |
type | string | 固定为 "day" |
categorized_fortune | object | 分类运势文案,包含 8 个维度 |
categorized_fortune.love | string | 爱情运势描述 |
categorized_fortune.career | string | 事业运势描述 |
categorized_fortune.money | string | 财运描述 |
categorized_fortune.health | string | 健康运势描述 |
categorized_fortune.study | string | 学业运势描述 |
categorized_fortune.mood | string | 心情运势描述 |
categorized_fortune.social | string | 人际运势描述 |
categorized_fortune.travel | string | 出行运势描述 |
scores | object | 运势得分 |
scores.love | integer | 爱情得分(0-100) |
scores.career | integer | 事业得分(0-100) |
scores.wealth | integer | 财富得分(0-100) |
scores.study | integer | 学业得分(0-100) |
scores.health | integer | 健康得分(0-100) |
scores.overall | integer | 综合得分(0-100) |
lucky_color | string | 幸运颜色 |
lucky_stone | string | 幸运宝石 |
lucky_flower | string | 幸运花 |
lucky_food | string | 幸运食物 |
lucky_number | integer | 幸运数字 |
lucky_direction | string | 幸运方向 |
返回示例
{
"zodiac": "白羊座",
"date": "2026-08-05",
"type": "day",
"categorized_fortune": {
"love": "爱情运势描述文本...",
"career": "事业运势描述文本...",
"money": "财运描述文本...",
"health": "健康运势描述文本...",
"study": "学业运势描述文本...",
"mood": "心情运势描述文本...",
"social": "人际运势描述文本...",
"travel": "出行运势描述文本..."
},
"scores": {
"love": 75,
"career": 80,
"wealth": 70,
"study": 72,
"health": 65,
"overall": 74
},
"lucky_color": "玫瑰粉",
"lucky_stone": "蓝宝石",
"lucky_flower": "粉色郁金香",
"lucky_food": "甜点",
"lucky_number": 6,
"lucky_direction": "正东方"
}
cURL 调用示例
curl -X POST https://chart.12sign.top/horoscopes/day \
-H "Content-Type: application/json" \
-d '{"zodiac": "白羊座"}'
# 指定日期
curl -X POST https://chart.12sign.top/horoscopes/day \
-H "Content-Type: application/json" \
-d '{"zodiac": "金牛座", "date": "2026-08-10"}'
Python 测试代码示例
import requests
def test_horoscope_day(base_url="https://chart.12sign.top"):
url = f"{base_url}/horoscopes/day"
payload = {"zodiac": "白羊座"}
try:
response = requests.post(url, json=payload, headers={'Content-Type': 'application/json'})
print(f"响应状态码: {response.status_code}")
if response.status_code == 200:
data = response.json()
print(f"星座: {data['zodiac']} 日期: {data['date']} 类型: {data['type']}")
print(f"综合得分: {data['scores']['overall']}")
for k, v in data['categorized_fortune'].items():
print(f"{k}: {v[:30]}...")
print(f"幸运色: {data['lucky_color']} 幸运数字: {data['lucky_number']}")
return data
else:
print(f"请求失败: {response.text}")
return None
except Exception as e:
print(f"请求出错: {e}")
return None
if __name__ == "__main__":
test_horoscope_day()
在线测试
请求地址:
https://chart.12sign.top/horoscopes/day
请求参数(JSON):
返回结果:
点击"发送请求"后在此显示结果
POST /horoscopes/month
单星座月运 — 传入星座名称,返回该星座本月度完整的分类运势、得分及幸运元素
基本信息
| 参数 | 值 |
|---|---|
| Base URL | https://chart.12sign.top |
| 接口 URL | /horoscopes/month |
| 请求方式 | POST |
| Content-Type | application/json |
| 是否需要身份验证 | 否 |
| 是否需要用户出生数据 | 否 |
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
zodiac | string | 是 | 星座中文名,如 "白羊座" |
date | string | 否 | 查询日期,格式 YYYY-MM-DD,默认当天(用于确定月份) |
请求示例
POST https://chart.12sign.top/horoscopes/month
Content-Type: application/json
{
"zodiac": "双子座"
}
返回参数
| 字段 | 类型 | 说明 |
|---|---|---|
zodiac | string | 星座中文名 |
date | string | 月份(YYYY-MM) |
type | string | 固定为 "month" |
categorized_fortune | object | 月度分类运势文案(8 个维度) |
categorized_fortune.love | string | 爱情运势描述 |
categorized_fortune.career | string | 事业运势描述 |
categorized_fortune.money | string | 财运描述 |
categorized_fortune.health | string | 健康运势描述 |
categorized_fortune.study | string | 学业运势描述 |
categorized_fortune.mood | string | 心情运势描述 |
categorized_fortune.social | string | 人际运势描述 |
categorized_fortune.travel | string | 出行运势描述 |
scores | object | 月度运势得分 |
scores.love | integer | 爱情得分(0-100) |
scores.career | integer | 事业得分(0-100) |
scores.wealth | integer | 财富得分(0-100) |
scores.study | integer | 学业得分(0-100) |
scores.health | integer | 健康得分(0-100) |
scores.mood | integer | 心情得分(0-100) |
scores.social | integer | 人际得分(0-100) |
scores.travel | integer | 出行得分(0-100) |
scores.average | integer | 平均得分(0-100) |
lucky_color | string | 幸运颜色 |
lucky_stone | string | 幸运宝石 |
lucky_flower | string | 幸运花 |
lucky_food | string | 幸运食物 |
lucky_number | integer | 幸运数字 |
lucky_direction | string | 幸运方向 |
返回示例
{
"zodiac": "白羊座",
"date": "2026-08",
"type": "month",
"categorized_fortune": {
"love": "本月爱情运势描述...",
"career": "本月事业运势描述...",
"money": "本月财运描述...",
"health": "本月健康运势描述...",
"study": "本月学业运势描述...",
"mood": "本月心情运势描述...",
"social": "本月人际运势描述...",
"travel": "本月出行运势描述..."
},
"scores": {
"love": 75,
"career": 80,
"wealth": 70,
"study": 72,
"health": 65,
"mood": 70,
"social": 68,
"travel": 73,
"average": 74
},
"lucky_color": "玫瑰粉",
"lucky_stone": "蓝宝石",
"lucky_flower": "粉色郁金香",
"lucky_food": "甜点",
"lucky_number": 6,
"lucky_direction": "正东方"
}
cURL 调用示例
curl -X POST https://chart.12sign.top/horoscopes/month \
-H "Content-Type: application/json" \
-d '{"zodiac": "双子座"}'
在线测试
请求地址:
https://chart.12sign.top/horoscopes/month
请求参数(JSON):
返回结果:
点击"发送请求"后在此显示结果
POST /horoscopes/week
单星座周运 — 传入星座名称,返回该星座本周完整的分类运势、得分及幸运元素
基本信息
| 参数 | 值 |
|---|---|
| Base URL | https://chart.12sign.top |
| 接口 URL | /horoscopes/week |
| 请求方式 | POST |
| Content-Type | application/json |
| 是否需要身份验证 | 否 |
| 是否需要用户出生数据 | 否 |
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
zodiac | string | 是 | 星座中文名,如 "白羊座" |
date | string | 否 | 查询日期,格式 YYYY-MM-DD,默认当天(用于确定所在周) |
可选星座值
白羊座、金牛座、双子座、巨蟹座、狮子座、处女座、天秤座、天蝎座、射手座、摩羯座、水瓶座、双鱼座
请求示例
POST https://chart.12sign.top/horoscopes/week
Content-Type: application/json
{
"zodiac": "双子座"
}
返回参数
| 字段 | 类型 | 说明 |
|---|---|---|
zodiac | string | 星座中文名 |
date | string | 周次(查询日期所在周) |
type | string | 固定为 "week" |
categorized_fortune | object | 周度分类运势文案(8 个维度) |
categorized_fortune.love | string | 爱情运势描述 |
categorized_fortune.career | string | 事业运势描述 |
categorized_fortune.money | string | 财运描述 |
categorized_fortune.health | string | 健康运势描述 |
categorized_fortune.study | string | 学业运势描述 |
categorized_fortune.mood | string | 心情运势描述 |
categorized_fortune.social | string | 人际运势描述 |
categorized_fortune.travel | string | 出行运势描述 |
scores | object | 周度运势得分 |
scores.love | integer | 爱情得分(0-100) |
scores.career | integer | 事业得分(0-100) |
scores.wealth | integer | 财富得分(0-100) |
scores.study | integer | 学业得分(0-100) |
scores.health | integer | 健康得分(0-100) |
scores.mood | integer | 心情得分(0-100) |
scores.social | integer | 人际得分(0-100) |
scores.travel | integer | 出行得分(0-100) |
scores.average | integer | 平均得分(0-100) |
lucky_color | string | 幸运颜色 |
lucky_stone | string | 幸运宝石 |
lucky_flower | string | 幸运花 |
lucky_food | string | 幸运食物 |
lucky_number | integer | 幸运数字 |
lucky_direction | string | 幸运方向 |
返回示例
{
"zodiac": "白羊座",
"date": "2026-W33",
"type": "week",
"categorized_fortune": {
"love": "本周爱情运势描述...",
"career": "本周事业运势描述...",
"money": "本周财运描述...",
"health": "本周健康运势描述...",
"study": "本周学业运势描述...",
"mood": "本周心情运势描述...",
"social": "本周人际运势描述...",
"travel": "本周出行运势描述..."
},
"scores": {
"love": 75,
"career": 80,
"wealth": 70,
"study": 72,
"health": 65,
"mood": 70,
"social": 68,
"travel": 73,
"average": 74
},
"lucky_color": "玫瑰粉",
"lucky_stone": "蓝宝石",
"lucky_flower": "粉色郁金香",
"lucky_food": "甜点",
"lucky_number": 6,
"lucky_direction": "正东方"
}
cURL 调用示例
curl -X POST https://chart.12sign.top/horoscopes/week \
-H "Content-Type: application/json" \
-d '{"zodiac": "双子座"}'
在线测试
请求地址:
https://chart.12sign.top/horoscopes/week
请求参数(JSON):
返回结果:
点击"发送请求"后在此显示结果
POST /horoscopes/year
单星座年运 — 传入星座名称,返回该星座本年度完整的分类运势、得分及幸运元素
基本信息
| 参数 | 值 |
|---|---|
| Base URL | https://chart.12sign.top |
| 接口 URL | /horoscopes/year |
| 请求方式 | POST |
| Content-Type | application/json |
| 是否需要身份验证 | 否 |
| 是否需要用户出生数据 | 否 |
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
zodiac | string | 是 | 星座中文名,如 "白羊座" |
date | string | 否 | 查询日期,格式 YYYY-MM-DD,默认当天(用于确定年份) |
请求示例
POST https://chart.12sign.top/horoscopes/year
Content-Type: application/json
{
"zodiac": "狮子座"
}
返回参数
| 字段 | 类型 | 说明 |
|---|---|---|
zodiac | string | 星座中文名 |
date | string | 年份(YYYY) |
type | string | 固定为 "year" |
categorized_fortune | object | 年度分类运势文案(8 个维度) |
categorized_fortune.love | string | 爱情运势描述 |
categorized_fortune.career | string | 事业运势描述 |
categorized_fortune.money | string | 财运描述 |
categorized_fortune.health | string | 健康运势描述 |
categorized_fortune.study | string | 学业运势描述 |
categorized_fortune.mood | string | 心情运势描述 |
categorized_fortune.social | string | 人际运势描述 |
categorized_fortune.travel | string | 出行运势描述 |
scores | object | 年度运势得分 |
scores.love | integer | 爱情得分(0-100) |
scores.career | integer | 事业得分(0-100) |
scores.wealth | integer | 财富得分(0-100) |
scores.study | integer | 学业得分(0-100) |
scores.health | integer | 健康得分(0-100) |
scores.mood | integer | 心情得分(0-100) |
scores.social | integer | 人际得分(0-100) |
scores.travel | integer | 出行得分(0-100) |
scores.average | integer | 平均得分(0-100) |
lucky_color | string | 幸运颜色 |
lucky_stone | string | 幸运宝石 |
lucky_flower | string | 幸运花 |
lucky_food | string | 幸运食物 |
lucky_number | integer | 幸运数字 |
lucky_direction | string | 幸运方向 |
返回示例
{
"zodiac": "白羊座",
"date": "2026",
"type": "year",
"categorized_fortune": {
"love": "本年爱情运势描述...",
"career": "本年事业运势描述...",
"money": "本年财运描述...",
"health": "本年健康运势描述...",
"study": "本年学业运势描述...",
"mood": "本年心情运势描述...",
"social": "本年人际运势描述...",
"travel": "本年出行运势描述..."
},
"scores": {
"love": 75,
"career": 80,
"wealth": 70,
"study": 72,
"health": 65,
"mood": 70,
"social": 68,
"travel": 73,
"average": 74
},
"lucky_color": "玫瑰粉",
"lucky_stone": "蓝宝石",
"lucky_flower": "粉色郁金香",
"lucky_food": "甜点",
"lucky_number": 6,
"lucky_direction": "正东方"
}
cURL 调用示例
curl -X POST https://chart.12sign.top/horoscopes/year \
-H "Content-Type: application/json" \
-d '{"zodiac": "狮子座"}'
在线测试
请求地址:
https://chart.12sign.top/horoscopes/year
请求参数(JSON):
返回结果:
点击"发送请求"后在此显示结果
错误响应 & 注意事项
HTTP 400 — 参数错误
{
"error": "请提供有效的星座名称,可选: 白羊座, 金牛座, 双子座, 巨蟹座, 狮子座, 处女座, 天秤座, 天蝎座, 射手座, 摩羯座, 水瓶座, 双鱼座"
}
触发条件:
- 未提供
zodiac参数 zodiac值不在可选范围内
HTTP 500 — 内部异常
{
"error": "<异常详细信息>"
}
HTTP 404 — 运势未更新(仅 /horoscopes)
{
"status": "error",
"message": "今日运势还未更新"
}
HTTP 502 — 远端服务异常(仅 /horoscopes)
{
"status": "error",
"message": "请求远端服务失败: <具体错误信息>"
}
注意事项
- 星座名称必须使用中文全称,如
"白羊座",不支持英文或缩写。 - 日期格式:
/horoscopes/day|week|month|year使用YYYY-MM-DD,/horoscopes使用YYYYMMDD。 - 默认日期:不传
date参数时默认使用当天日期。 - 得分范围:
/horoscopes/day|week|month|year的各项得分范围为 0-100;/horoscopes的score_*字段范围为 0-99。 - 分类运势:
categorized_fortune包含 8 个维度(love / career / money / health / study / mood / social / travel),部分维度可能为空字符串。 /horoscopes与/horoscopes/day的区别:前者一次返回 12 星座通用运势(含远端文本与本地得分),后者返回单个星座的 8 维度详细分类运势。