日运API文档
本API提供日运预测功能,基于占星学原理进行计算。
POST /dailytransit
日运计算接口 - 计算指定日期的运势
接口说明
计算指定日期的日运,包括行星相位、各领域评分、重要相位、日运总评及幸运物品。
基本信息
| 参数 | 值 |
|---|---|
| Base URL | https://chart.12sign.top |
| 接口URL | /dailytransit |
| 请求方式 | POST |
| Content-Type | application/json |
请求参数
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| birth_data.year | integer | 是 | 出生年份,如:1990 |
| birth_data.month | integer | 是 | 出生月份,1-12 |
| birth_data.day | integer | 是 | 出生日,1-31 |
| birth_data.hour | integer | 是 | 出生小时,0-23 |
| birth_data.minute | integer | 是 | 出生分钟,0-59 |
| birth_data.second | integer | 是 | 出生秒,通常为0 |
| birth_data.latitude | number | 是 | 出生地纬度,北纬为正,南纬为负 |
| birth_data.longitude | number | 是 | 出生地经度,东经为正,西经为负 |
| birth_data.timezone_offset | number | 是 | 时区偏移,如:8.0表示UTC+8 |
| target_date | string | 是 | 目标日期,格式:YYYY-MM-DD |
请求示例
{
"birth_data": {
"year": 1990,
"month": 1,
"day": 1,
"hour": 12,
"minute": 0,
"second": 0,
"latitude": 31.23,
"longitude": 121.47,
"timezone_offset": 8.0
},
"target_date": "2026-01-19"
}
返回参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| date | string | 计算日期 |
| aspects | array | 行星相位数组 |
| scores | object | 各领域评分对象,包含:love(爱情)、career(事业)、wealth(财富)、study(学业)、health(健康) |
| important_aspect | object | 重要相位信息 |
| daily_overall_text | string | 日运总评文案(AI生成) |
| lucky_color | string | 幸运颜色 |
| lucky_stone | string | 幸运宝石 |
| lucky_flower | string | 幸运花卉 |
| lucky_food | string | 幸运食物 |
| lucky_number | string | 幸运数字 |
| lucky_direction | string | 幸运方位 |
返回示例
{
"date": "2026-01-19",
"aspects": [
{
"planet1": "水星",
"planet2": "金星",
"aspect": "六分相",
"orb": 2.3,
"interpretation": "..."
}
],
"scores": {
"love": 85,
"career": 72,
"wealth": 68,
"study": 79,
"health": 75
},
"important_aspect": {
"main_field": "love",
"description": "..."
},
"daily_overall_text": "今日运势总体向好...",
"lucky_color": "红色",
"lucky_stone": "红宝石",
"lucky_flower": "玫瑰",
"lucky_food": "辣椒",
"lucky_number": "8",
"lucky_direction": "正南方"
}
Python测试代码示例
import requests
import json
def test_daily_fortune(base_url="https://chart.12sign.top"):
url = f"{base_url}/dailytransit"
payload = {
"birth_data": {
"year": 1990,
"month": 1,
"day": 1,
"hour": 12,
"minute": 0,
"second": 0,
"latitude": 31.23,
"longitude": 121.47,
"timezone_offset": 8.0
},
"target_date": "2026-01-19"
}
try:
print("正在测试日运API...")
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("日运API测试成功!")
print(f"返回数据: {json.dumps(data, ensure_ascii=False, indent=2)}")
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_daily_fortune()
注意事项
- target_date格式必须为YYYY-MM-DD
- 经纬度使用小数格式,东经北纬为正,西经南纬为负
- 时区偏移为浮点数,如8.0表示UTC+8
- 评分范围为0-100分
- 重要相位和解释来自内置数据