月运API文档
本API提供月运预测功能,基于占星学原理进行计算。
POST /month
月运计算接口 - 计算指定月份的运势
接口说明
计算指定月份的月运,包括三限相位、月返数据、本命宫位、三限行星落入本命宫位及各领域评分。
基本信息
| 参数 | 值 |
|---|---|
| Base URL | https://chart.12sign.top |
| 接口URL | /month |
| 请求方式 | POST |
| Content-Type | application/json |
请求参数
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| birth_data.year | integer | 是 | 出生年份 |
| birth_data.month | integer | 是 | 出生月份 |
| birth_data.day | integer | 是 | 出生日 |
| birth_data.hour | integer | 是 | 出生小时 |
| birth_data.minute | integer | 是 | 出生分钟 |
| birth_data.latitude | number | 是 | 出生地纬度 |
| birth_data.longitude | number | 是 | 出生地经度 |
| birth_data.timezone | number | 是 | 时区,如:8.0表示UTC+8 |
| target_date | string | 是 | 目标日期,格式:YYYY-MM-DD |
请求示例
{
"birth_data": {
"year": 1990,
"month": 1,
"day": 1,
"hour": 12,
"minute": 0,
"latitude": 31.23,
"longitude": 121.47,
"timezone": 8.0
},
"target_date": "2026-01-15"
}
返回参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| target_date | string | 目标日期 |
| calculation_date | string | 计算日期时间 |
| build | string | 版本标识 |
| birth_data | object | 出生数据 |
| aspects | object | 三限相位数据 |
| natal_houses | object | 本命宫位数据 |
| tertiary_in_natal_houses | object | 三限行星落入本命宫位 |
| tertiary_positions | object | 三限行星位置 |
| lunar_return | object | 月返数据 |
| scores | object | 各领域评分 |
| summary | object | 摘要信息 |
返回示例
{
"target_date": "2026-01-15",
"calculation_date": "2026-01-15 12:00:00",
"build": "month-v2-scores",
"birth_data": {
"year": 1990,
"month": 1,
"day": 1,
"hour": 12,
"minute": 0,
"latitude": 31.23,
"longitude": 121.47,
"timezone": 8.0
},
"aspects": {
"tp_sun_n_moon_0": {
"cn": "三限太阳合相本命月亮",
"start_date": "2026-01",
"end_date": "2026-01",
"duration_months": 1,
"orb": 1.2,
"tp": "Sun",
"n": "Moon",
"a": "0"
}
},
"natal_houses": {
"raw_houses": [17.6, 52.1, 78.0, 101.1, 125.7, 156.6, 197.6, 235.4, 267.8, 293.5, 319.2, 354.1]
},
"tertiary_in_natal_houses": {
"sun": 1,
"moon": 2,
"mercury": 3
},
"tertiary_positions": {
"sun": 280.5,
"moon": 125.3,
"mercury": 295.8
},
"lunar_return": {
"success": true,
"target_date": "2026-01-15 12:00:00",
"moon_house": 5,
"moon_sign": "白羊座",
"moon_degree": 280.5
},
"scores": {
"love": 78,
"career": 85,
"wealth": 72,
"study": 80,
"health": 75
},
"summary": {
"total_aspects": 5,
"tertiary_vs_natal": 3,
"tertiary_vs_tertiary": 2,
"lunar_return_available": true,
"tertiary_houses_count": 10
}
}
Python测试代码示例
import requests
import json
def test_month_fortune(base_url="https://chart.12sign.top"):
url = f"{base_url}/month"
payload = {
"birth_data": {
"year": 1990,
"month": 1,
"day": 1,
"hour": 12,
"minute": 0,
"latitude": 31.23,
"longitude": 121.47,
"timezone": 8.0
},
"target_date": "2026-01-15"
}
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"三限相位数量: {len(data.get('aspects', {}))}")
print(f"月返数据: {data.get('lunar_return', {})}")
print(f"评分: {data.get('scores', {})}")
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_month_fortune()
注意事项
- 月运计算使用三限(Tertiary Progressions)方法
- 月返数据现在使用本地计算,不再依赖外部API
- 计算时间点为目标月份15日12:00
- 相位包括三限vs本命、三限vs三限
- 容差设置为3度
- 月返数据包含月亮宫位、星座和度数