星座介绍API文档
接口说明
本接口用于获取指定星座的完整介绍资料:返回 7 个板块——星座档案(日期区间/守护星/元素/掌管宫位/著名人物)、基本性格、天赋才能、健康与体征、家庭关系、伴侣关系、三区间(DECANS)解读。传入星座名即可获得 JSON 格式的全部板块内容。
基本信息
| 参数 | 值 |
|---|---|
| Base URL | https://chart.12sign.top |
| 接口URL | /horoscopes/intro |
| 请求方式 | POST |
| Content-Type | application/json |
| 返回格式 | application/json |
请求参数
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| zodiac | string | 是 | 星座中文名(如"白羊座"),十二星座均可 |
请求示例
POST https://chart.12sign.top/horoscopes/intro
Content-Type: application/json
{ "zodiac": "白羊座" }
返回参数
| 字段名 | 类型 | 说明 |
|---|---|---|
| zodiac | string | 星座名 |
| sections | array | 7 个板块的数组,每项 {title 板块标题, content 板块正文};正文为中文,含换行符,展示时建议做换行处理 |
返回示例(节选)
{
"zodiac": "白羊座",
"sections": [
{ "title": "ARIES (MARCH 21–APRIL 19)", "content": "符号—公羊
守护星—火星
元素—火
掌管宫位—第一宫
著名白羊座人士—…" },
{ "title": "Basic Personality", "content": "白羊座,黄道的第一个星座,象征着开端…" },
{ "title": "Talents and Abilities", "content": "…" },
{ "title": "Health and Physical Traits", "content": "…" },
{ "title": "Family Relationships", "content": "…" },
{ "title": "Partnerships", "content": "…" },
{ "title": "DECANS", "content": "第一区间…
第二区间…
第三区间…" }
]
}
Python测试代码示例
import requests
def test_intro():
r = requests.post(
"https://chart.12sign.top/horoscopes/intro",
json={"zodiac": "白羊座"})
d = r.json()
print(f"{d['zodiac']} 共 {len(d['sections'])} 个板块")
for s in d['sections']:
print(f"■ {s['title']}")
print(s['content'][:60], "...")
if __name__ == "__main__":
test_intro()
在线测试
请求地址:
https://chart.12sign.top/horoscopes/intro
选择星座:
返回结果:
选择星座后点击"发送请求"