生肖纳音API文档

接口说明

本接口用于生肖查询:根据出生日期计算生肖属相(同时给出立春界与正月初一界两种口径)、出生年干支、纳音五行(如"大林木")、六合/三合和合生肖、冲/害/刑/破摩擦生肖,以及该生肖的性格优劣势、事业、财运、爱情完整报告。

年界说明:立春界 = 八字/紫微口径(默认推荐);正月初一界 = 民俗口径。两界对生日在春节附近的人可能给出不同生肖。

基本信息

参数值
Base URL(紫微服务)https://chart.12sign.top/ziwei
接口URL/zodiac
请求方式GET
返回格式application/json

请求参数

参数名类型必选说明
yearint是出生年,如 1990
monthint是出生月,1-12
dayint是出生日,1-31

请求示例

GET https://chart.12sign.top/zodiac?year=1990&month=1&day=1

返回参数

参数名类型说明
zodiacobjectlunarYearGZ / lichunYearGZ 年干支;zodiacByLunarNewYear(正月初一界生肖)、zodiacByLiChun(立春界生肖);note 年界说明
naYinobjectganzhi 干支、naYin 纳音(如"大林木")、element 五行、label 属相生辰
harmonyAnimalsarray和合生肖:animal、type(六合/三合)、detail
frictionAnimalsarray摩擦生肖:animal、type(相冲/相害/相刑/相破)、detail
reportobjectstrengths 优势、weaknesses 劣势、career 事业、wealth 财运、love 爱情

返回示例

{
    "zodiac": {
    "lunarYearGZ": "己巳",
    "zodiacByLunarNewYear": "蛇",
    "lichunYearGZ": "己巳",
    "zodiacByLiChun": "蛇",
    "note": "两种年界:立春界=八字/紫微口径(默认推荐);正月初一界=民俗口径"
    },
    "naYin": { "ganzhi": "己巳", "naYin": "大林木", "element": "木", "label": "属相生辰:木" },
    "harmonyAnimals": [
    { "animal": "猴", "type": "六合", "detail": "暗合默契,最佳拍档" },
    { "animal": "鸡", "type": "三合", "detail": "志同道合,贵人互助" }
    ],
    "frictionAnimals": [
    { "animal": "猪", "type": "相冲", "detail": "观念对立,易摩擦" },
    { "animal": "虎", "type": "相害", "detail": "暗中损耗,合作谨慎" }
    ],
    "report": {
    "strengths": "生肖蛇的人以冷静睿智、深谋远虑而著称……",
    "weaknesses": "属蛇人的缺点在于其过重的猜忌心与防备心理……",
    "career": "在事业层面,属蛇人是卓越的战略家与深度分析专家……",
    "wealth": "属蛇人的财运具备"偏财运旺、理财精明"的独特优势……",
    "love": "属蛇人的爱情观呈现出"外冷内热、专一炽热"的极端色彩……"
    }
    }

Python测试代码示例

import requests

def test_zodiac():
    params = {"year": 1990, "month": 1, "day": 1}
    d = requests.get("https://chart.12sign.top/zodiac", params=params).json()
    z = d["zodiac"]
    print(f"生肖(立春界): {z['zodiacByLiChun']}  年干支: {z['lichunYearGZ']}")
    print(f"纳音: {d['naYin']['naYin']} ({d['naYin']['element']})")
    print(f"和合: {[a['animal'] + a['type'] for a in d['harmonyAnimals']]}")
    print(f"摩擦: {[a['animal'] + a['type'] for a in d['frictionAnimals']]}")
    print(f"事业: {d['report']['career'][:60]}...")

if __name__ == "__main__":
    test_zodiac()

在线测试

请求地址:
https://chart.12sign.top/zodiac
出生日期(JSON):
返回结果:
点击"发送请求"后在此显示结果