用于将公历日期转换为农历日期,支持1944年至2051年的日期范围。
用于将公历日期转换为农历日期,支持1944年至2051年的日期范围。
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| date | string | 否 | 公历日期,格式为YYYY-MM-DD。不传则默认使用当天日期 |
[
{
"name": "date",
"type": "string",
"required": false,
"description": "公历日期,格式为YYYY-MM-DD。不传则默认使用当天日期",
"example": ""
}
]{"openapi":"3.1.1","info":{"title":"公历日期转农历日期","description":"用于将公历日期转换为农历日期,支持1944年至2051年的日期范围。","version":"1.0.0"},"paths":{"/apis/gateway?api=solar2lunar":{"get":{"summary":"公历日期转农历日期","description":"用于将公历日期转换为农历日期,支持1944年至2051年的日期范围。","parameters":[{"name":"date","in":"query","required":false,"schema":{"type":"string"},"description":"公历日期,格式为YYYY-MM-DD。不传则默认使用当天日期"}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"summary":"公历日期转农历日期","description":"用于将公历日期转换为农历日期,支持1944年至2051年的日期范围。","parameters":[{"name":"date","in":"query","required":false,"schema":{"type":"string"},"description":"公历日期,格式为YYYY-MM-DD。不传则默认使用当天日期"}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"servers":[{"url":"https://api.souxiaocha.com","description":"当前访问入口(https)"}]}
https://api.souxiaocha.com/apis/gateway?api=solar2lunarGET https://api.souxiaocha.com/apis/gateway?api=solar2lunar apikey=你的API密钥&date=请填写date
GET 参数放在查询字符串中。参数值请替换为实际有效值。
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
date | string | 否 | 公历日期,格式为YYYY-MM-DD。不传则默认使用当天日期 |
用于将公历日期转换为农历日期,支持1944年至2051年的日期范围。
https://api.souxiaocha.com/apis/gateway?api=solar2lunar
GET / POST(业务参数 GET 通过 URL 传递,POST 支持表单或 JSON)
调用需携带平台密钥(用户中心「令牌管理」获取,SK- 开头):
key=SK-你的密钥X-API-Key: SK-你的密钥| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| date | string | 否 | 公历日期,格式为YYYY-MM-DD。不传则默认使用当天日期 |
[
{"name": "date", "type": "string", "required": false, "description": "公历日期,格式为YYYY-MM-DD。不传则默认使用当天日期"}
]
| 参数名 | 类型 | 说明 |
|---|---|---|
| success | boolean | 请求是否成功 |
| data.solar_date | string | 原始公历日期 |
| data.lunar_date.year | integer | 农历年份(数字) |
| data.lunar_date.year_text | string | 农历年份(中文) |
| data.lunar_date.month | integer | 农历月份(数字) |
| data.lunar_date.month_text | string | 农历月份(中文) |
| data.lunar_date.day | integer | 农历日期(数字) |
| data.lunar_date.day_text | string | 农历日期(中文) |
| data.lunar_date.full_text | string | 完整农历日期(带"农历"前缀) |
| data.lunar_date.display | string | 完整农历日期(不带前缀) |
| generated_at | string | 响应生成时间 |
curl "https://api.souxiaocha.com/apis/gateway?api=solar2lunar?key=SK-你的密钥&date=2026-09-24"
平台级错误(errcode):11001 缺少密钥 / 11002 密钥无效或已禁用 / 11005 接口禁用 / 11006 接口维护 / 11010 积分不足 / 11018 请求方式不允许。
失败时请以响应体中的 code / errcode 与 msg 判断。
2026-09-24
curl "https://api.souxiaocha.com/apis/gateway?api=solar2lunar?key=SK-你的密钥&date=2026-09-24"
// 结果将在此处显示