aixingpan.cn API开发文档:api_docs_interpretation_corpus接口指南
1. 引言
本文档详细介绍了占星系统的api_docs_interpretation_corpus接口的使用方法,包括请求参数详解、响应数据结构、错误处理机制以及最佳实践建议。
2. 接口基础信息
- 接口名称: api_docs_interpretation_corpus
- 请求方式: POST
- Content-Type: application/x-www-form-urlencoded
- 接口地址: /astrology/chart/api_docs_interpretation_corpus
3. 请求参数详解
3.1 公共参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| access_token | 字符串 | 是 | 访问令牌,请在用户登录后获取 |
3.2 业务参数
| chartType | string | 必需 | 星盘类型,如 “natal”、“solar_return” 等 |
| fallInto | object | 必需 | 查询条件对象,包含以下字段: |
| fallInto.type | integer | 必需 | 语料类型:
1 = 行星解释
4 = 行星落宫解释
5 = 行星落座解释
6 = 行星相位解释
7 = 宫头落入星座解释 |
| fallInto.planet_id | integer | 条件必需 | 行星ID(type=1,4,5,6时需要) |
| fallInto.planet_id2 | integer | 条件必需 | 第二个行星ID(仅type=6时需要) |
| fallInto.sign_id | integer | 条件必需 | 星座ID(type=5,7时需要) |
| fallInto.house_id | integer | 条件必需 | 宫位ID(type=4,7时需要) |
| fallInto.degree | integer | 条件必需 | 相位度数(仅type=6时需要) |
| corpusSets | array | 可选 | 语料集名称列表,用于过滤查询结果。推荐使用 [“aixingpan”] 来获取爱星盘解释语料。 |
| returnAll | boolean | 可选 | 是否返回所有匹配的语料集结果,默认为 false |
4. 请求示例解析
{"access_token":"***","birthday":"1990-01-01 12:00:00","longitude":"116.404","latitude":"39.915","tz":"+8:00"}```## 5. 如何发送请求 ### 5.1 使用curl发送请求```bash curl-XPOST"https://chart.12sign.top/astrology/chart/api_docs_interpretation_corpus -H "Content-Type:application/x-www-form-urlencoded" -d "access_token=YOUR_TOKEN" -d "param1=value1" -d "param2=value2"5.2 使用Postman发送请求
- 打开Postman,新建请求
- 请求方式选择 POST
- URL填写接口地址
- 在Body选项卡选择 x-www-form-urlencoded
- 填写请求参数
- 点击Send发送请求
6. 响应处理指南
6.1 成功响应格式
{"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:基本本命盘查询```pythonimportrequests 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)10. 结论
api_docs_interpretation_corpus接口是占星系统的核心接口之一,通过本文档的指导,您应该能够顺利地集成和使用该接口。如有任何问题,请联系zx12sign 获取帮助。
文档生成时间: 2026-08-14 01:45:02
版本: v1.0