星座运势 API 文档

本组接口提供 12 星座的日 / 周 / 月 / 年运势查询,以及一次性返回 12 星座当日运势的批量接口。所有接口均支持 POST 请求,统一返回 JSON。每个接口下方均提供在线测试工具,可直接发送请求验证。

接口总览

接口功能输入输出
POST /horoscopes今日十二星座运势(远端文本 + 本地得分)无 / 可选日期12 星座完整运势
POST /horoscopes/day单星座日运星座名称分类运势 + 得分 + 幸运元素
POST /horoscopes/week单星座周运星座名称分类运势 + 得分 + 幸运元素
POST /horoscopes/month单星座月运星座名称分类运势 + 得分 + 幸运元素
POST /horoscopes/year单星座年运星座名称分类运势 + 得分 + 幸运元素

POST /horoscopes

今日十二星座运势 — 一次请求返回全部 12 个星座的当日运势

基本信息

参数值
Base URLhttps://chart.12sign.top
接口 URL/horoscopes
请求方式POST
Content-Typeapplication/json
是否需要身份验证否
是否需要用户出生数据否

请求参数

请求体可为空({})或不传。

参数类型必填说明
datestring否查询日期,格式 YYYYMMDD,默认当天

请求示例

POST https://chart.12sign.top/horoscopes
Content-Type: application/json

{}

返回参数

字段类型说明
statusstring请求状态,成功时返回 success
dataarray12 星座运势数组,共 12 项
data[].zodiacstring星座中文名
data[].namestring星座中文名(同 zodiac)
data[].signstring星座英文名
data[].datestring查询日期(YYYYMMDD)
data[].score_overallinteger综合运势得分(0-99)
data[].score_loveinteger爱情运势得分(0-99)
data[].score_careerinteger事业运势得分(0-99)
data[].score_moneyinteger财富运势得分(0-99)
data[].score_healthinteger健康运势得分(0-99)
data[].lucky_colorstring幸运颜色
data[].lucky_numberinteger幸运数字(1-9)
data[].lucky_directionstring幸运方向
data[].lucky_timestring幸运时间段
data[].lucky_foodstring幸运食物
data[].lucky_companionstring幸运小物
data[].lucky_flowerstring幸运花

此外,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)日期范围
1Aries白羊座3.21 - 4.19
2Taurus金牛座4.20 - 5.20
3Gemini双子座5.21 - 6.21
4Cancer巨蟹座6.22 - 7.22
5Leo狮子座7.23 - 8.22
6Virgo处女座8.23 - 9.22
7Libra天秤座9.23 - 10.23
8Scorpio天蝎座10.24 - 11.22
9Sagittarius射手座11.23 - 12.21
10Capricorn摩羯座12.22 - 1.19
11Aquarius水瓶座1.20 - 2.18
12Pisces双鱼座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 URLhttps://chart.12sign.top
接口 URL/horoscopes/day
请求方式POST
Content-Typeapplication/json
是否需要身份验证否
是否需要用户出生数据否

请求参数

参数类型必填说明
zodiacstring是星座中文名,如 "白羊座"
datestring否查询日期,格式 YYYY-MM-DD,默认当天

可选星座值

白羊座、金牛座、双子座、巨蟹座、狮子座、处女座、天秤座、天蝎座、射手座、摩羯座、水瓶座、双鱼座

请求示例

POST https://chart.12sign.top/horoscopes/day
Content-Type: application/json

{
  "zodiac": "白羊座"
}

返回参数

字段类型说明
zodiacstring星座中文名
datestring查询日期(YYYY-MM-DD)
typestring固定为 "day"
categorized_fortuneobject分类运势文案,包含 8 个维度
categorized_fortune.lovestring爱情运势描述
categorized_fortune.careerstring事业运势描述
categorized_fortune.moneystring财运描述
categorized_fortune.healthstring健康运势描述
categorized_fortune.studystring学业运势描述
categorized_fortune.moodstring心情运势描述
categorized_fortune.socialstring人际运势描述
categorized_fortune.travelstring出行运势描述
scoresobject运势得分
scores.loveinteger爱情得分(0-100)
scores.careerinteger事业得分(0-100)
scores.wealthinteger财富得分(0-100)
scores.studyinteger学业得分(0-100)
scores.healthinteger健康得分(0-100)
scores.overallinteger综合得分(0-100)
lucky_colorstring幸运颜色
lucky_stonestring幸运宝石
lucky_flowerstring幸运花
lucky_foodstring幸运食物
lucky_numberinteger幸运数字
lucky_directionstring幸运方向

返回示例

{
  "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 URLhttps://chart.12sign.top
接口 URL/horoscopes/month
请求方式POST
Content-Typeapplication/json
是否需要身份验证否
是否需要用户出生数据否

请求参数

参数类型必填说明
zodiacstring是星座中文名,如 "白羊座"
datestring否查询日期,格式 YYYY-MM-DD,默认当天(用于确定月份)

请求示例

POST https://chart.12sign.top/horoscopes/month
Content-Type: application/json

{
  "zodiac": "双子座"
}

返回参数

字段类型说明
zodiacstring星座中文名
datestring月份(YYYY-MM)
typestring固定为 "month"
categorized_fortuneobject月度分类运势文案(8 个维度)
categorized_fortune.lovestring爱情运势描述
categorized_fortune.careerstring事业运势描述
categorized_fortune.moneystring财运描述
categorized_fortune.healthstring健康运势描述
categorized_fortune.studystring学业运势描述
categorized_fortune.moodstring心情运势描述
categorized_fortune.socialstring人际运势描述
categorized_fortune.travelstring出行运势描述
scoresobject月度运势得分
scores.loveinteger爱情得分(0-100)
scores.careerinteger事业得分(0-100)
scores.wealthinteger财富得分(0-100)
scores.studyinteger学业得分(0-100)
scores.healthinteger健康得分(0-100)
scores.moodinteger心情得分(0-100)
scores.socialinteger人际得分(0-100)
scores.travelinteger出行得分(0-100)
scores.averageinteger平均得分(0-100)
lucky_colorstring幸运颜色
lucky_stonestring幸运宝石
lucky_flowerstring幸运花
lucky_foodstring幸运食物
lucky_numberinteger幸运数字
lucky_directionstring幸运方向

返回示例

{
  "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 URLhttps://chart.12sign.top
接口 URL/horoscopes/week
请求方式POST
Content-Typeapplication/json
是否需要身份验证否
是否需要用户出生数据否

请求参数

参数类型必填说明
zodiacstring是星座中文名,如 "白羊座"
datestring否查询日期,格式 YYYY-MM-DD,默认当天(用于确定所在周)

可选星座值

白羊座、金牛座、双子座、巨蟹座、狮子座、处女座、天秤座、天蝎座、射手座、摩羯座、水瓶座、双鱼座

请求示例

POST https://chart.12sign.top/horoscopes/week
Content-Type: application/json

{
  "zodiac": "双子座"
}

返回参数

字段类型说明
zodiacstring星座中文名
datestring周次(查询日期所在周)
typestring固定为 "week"
categorized_fortuneobject周度分类运势文案(8 个维度)
categorized_fortune.lovestring爱情运势描述
categorized_fortune.careerstring事业运势描述
categorized_fortune.moneystring财运描述
categorized_fortune.healthstring健康运势描述
categorized_fortune.studystring学业运势描述
categorized_fortune.moodstring心情运势描述
categorized_fortune.socialstring人际运势描述
categorized_fortune.travelstring出行运势描述
scoresobject周度运势得分
scores.loveinteger爱情得分(0-100)
scores.careerinteger事业得分(0-100)
scores.wealthinteger财富得分(0-100)
scores.studyinteger学业得分(0-100)
scores.healthinteger健康得分(0-100)
scores.moodinteger心情得分(0-100)
scores.socialinteger人际得分(0-100)
scores.travelinteger出行得分(0-100)
scores.averageinteger平均得分(0-100)
lucky_colorstring幸运颜色
lucky_stonestring幸运宝石
lucky_flowerstring幸运花
lucky_foodstring幸运食物
lucky_numberinteger幸运数字
lucky_directionstring幸运方向

返回示例

{
  "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 URLhttps://chart.12sign.top
接口 URL/horoscopes/year
请求方式POST
Content-Typeapplication/json
是否需要身份验证否
是否需要用户出生数据否

请求参数

参数类型必填说明
zodiacstring是星座中文名,如 "白羊座"
datestring否查询日期,格式 YYYY-MM-DD,默认当天(用于确定年份)

请求示例

POST https://chart.12sign.top/horoscopes/year
Content-Type: application/json

{
  "zodiac": "狮子座"
}

返回参数

字段类型说明
zodiacstring星座中文名
datestring年份(YYYY)
typestring固定为 "year"
categorized_fortuneobject年度分类运势文案(8 个维度)
categorized_fortune.lovestring爱情运势描述
categorized_fortune.careerstring事业运势描述
categorized_fortune.moneystring财运描述
categorized_fortune.healthstring健康运势描述
categorized_fortune.studystring学业运势描述
categorized_fortune.moodstring心情运势描述
categorized_fortune.socialstring人际运势描述
categorized_fortune.travelstring出行运势描述
scoresobject年度运势得分
scores.loveinteger爱情得分(0-100)
scores.careerinteger事业得分(0-100)
scores.wealthinteger财富得分(0-100)
scores.studyinteger学业得分(0-100)
scores.healthinteger健康得分(0-100)
scores.moodinteger心情得分(0-100)
scores.socialinteger人际得分(0-100)
scores.travelinteger出行得分(0-100)
scores.averageinteger平均得分(0-100)
lucky_colorstring幸运颜色
lucky_stonestring幸运宝石
lucky_flowerstring幸运花
lucky_foodstring幸运食物
lucky_numberinteger幸运数字
lucky_directionstring幸运方向

返回示例

{
  "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": "请提供有效的星座名称,可选: 白羊座, 金牛座, 双子座, 巨蟹座, 狮子座, 处女座, 天秤座, 天蝎座, 射手座, 摩羯座, 水瓶座, 双鱼座"
}

触发条件:

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 维度详细分类运势。