本文档详细介绍了占星系统的api_docs_bichart_natalvslunar_return2接口的使用方法,包括请求参数详解、响应数据结构、错误处理机制以及最佳实践建议。
请求方式: POST
Content-Type: application/x-www-form-urlencoded
接口地址: /astrology/chart/api_docs_bichart_natalvslunar_return2
参数名类型必填说明 access_token字符串是访问令牌,请在用户登录后获取
| planets | 数组 | 是 | 星体id列表 |
| h_sys | 字符 | 否 | 宫位系统,默认k |
| longitude | 字符 | 否 | 经度 |
| latitude | 字符 | 否 | 纬度 |
| tz | 字符 | 否 | 时区 |
| birthday | 字符 | 否 | 生日,时间格式:1999-10-17 21:00:00 |
{
"access_token": "***",
"birthday": "1990-01-01 12:00:00",
"longitude": "116.404",
"latitude": "39.915",
"tz": "+8:00"
}
```
## 5. 如何发送请求
### 5.1 使用curl发送请求
```bash
curl -X POST "https://chart.12sign.top/astrology/chart/api_docs_bichart_natalvslunar_return2 -H "Content-Type: application/x-www-form-urlencoded" -d "access_token=YOUR_TOKEN" -d "param1=value1" -d "param2=value2"
请求方式选择 POST
URL填写接口地址
在Body选项卡选择 x-www-form-urlencoded
填写请求参数
点击Send发送请求
{
"code": 0,
"msg": "操作成功",
"data": {...}
}
```
### 6.2 响应字段说明
- **code**: 状态码,0表示成功
- - **msg**: 状态描述
- - **data**: 返回的业务数据
- - **exe_time**: 执行时间
## 7. 错误处理与调试
| 错误码 | 说明 | 解决方案 |
|--------|------|----------|
| 1001 | 参数错误 | 检查必填参数是否完整,参数格式是否正确 |
| 1002 | access_token无效 | 检查access_token是否正确,是否已过期 |
| 1003 | 权限不足 | 确认账号是否有调用该接口的权限 |
| 500 | 服务器内部错误 | 联系zx12sign |
## 8. 最佳实践与性能优化
### 8.1 请求优化
- 合理设置超时时间(建议30秒)
- - 使用连接池复用连接
- - 避免频繁重复请求相同参数
### 8.2 安全建议
- 不要在客户端代码中硬编码access_token
- - 定期更新access_token
- - 使用HTTPS协议调用接口
### 8.3 注意事项
- 所有时间参数请使用正确的格式:YYYY-MM-DD HH:MM:SS
- - 经纬度参数需要精确到小数点后6位
- - 时区参数使用标准时区格式(如:+8:00)
## 9. 使用案例
### 案例1:基本本命盘查询
```python
import requests
url = "https://chart.12sign.top/astrology/chart/natal"
data = {
"access_token": "YOUR_TOKEN",
"birthday": "1990-01-01 12:00:00",
"longitude": "116.404",
"latitude": "39.915",
"tz": "+8:00"
}
response = requests.post(url, data=data)
result = response.json()
print(result)
api_docs_bichart_natalvslunar_return2接口是占星系统的核心接口之一,通过本文档的指导,您应该能够顺利地集成和使用该接口。如有任何问题,请联系zx12sign 获取帮助。
文档生成时间: 2026-07-05 22:48:26
版本: v1.0
$(function() {
setTimeout(function () {
var mathcodeList = document.querySelectorAll('.htmledit_views img.mathcode');
if (mathcodeList.length > 0) {
for (let i = 0; i ');
curSpan.text(alt);
$(mathcodeList[i]).before(curSpan);
$(mathcodeList[i]).remove();
}
} else {
mathcodeList[i].onerror = function() {
var alt = mathcodeList[i].alt;
alt = '\\(' + alt + '\\)';
var curSpan = $('');
curSpan.text(alt);
$(mathcodeList[i]).before(curSpan);
$(mathcodeList[i]).remove();
};
}
}
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
}
}, 500)
});