工具-节气工具

文档说明

        通过指定的年月日,计算出当年的节气以及具体时间。

请求方式

POST GET

https://api.yuanfenju.com/index.php/v1/Gongju/jieqi

请求头

字段 类型 描述
Content-Type String application/x-www-form-urlencoded

请求参数

字段 类型 描述
api_key String 密钥
type Int 历类型 0农历 1公历
year Int 年 例: 1988
month Int 月 例: 8
day Int 日 例: 7

请求参数示例

$request_data = [
'api_key' => 'FsF1CsVevk3N17w7oBkSydfSk',
'type' => '1',
'year' => '1988',
'month' => '11',
'day' => '8',
];

返回参数

字段 类型 描述
errcode String 请求状态码 0成功 其它为失败
errmsg String 状态码说明
notice String 声明
data Json 数据信息

成功返回示例

{
  "errcode": 0,
  "errmsg": "请求成功",
  "notice":"本次测算结果仅供娱乐使用,请勿用于封建迷信和违法用途。",
  "data": [
    {
      "jieqi_name": "小寒",               //节气
      "jieqi_simple_time": "2024-01-06",    //公历时间
      "jieqi_detail_time": "2024-01-06 04:49:09", //公历详细时间
      "jieqi_simple_lunar_time": "2023-11-25", //农历时间
      "jieqi_detail_lunar_time": "2023-11-25 04:49:09" //农历详细时间
    },
    {
      "jieqi_name": "立春",
      "jieqi_simple_time": "2024-02-04",
      "jieqi_detail_time": "2024-02-04 16:26:53",
      "jieqi_simple_lunar_time": "2023-12-25",
      "jieqi_detail_lunar_time": "2023-12-25 16:26:53"
    },
    {
      "jieqi_name": "惊蛰",
      "jieqi_simple_time": "2024-03-05",
      "jieqi_detail_time": "2024-03-05 10:22:31",
      "jieqi_simple_lunar_time": "2024-01-25",
      "jieqi_detail_lunar_time": "2024-01-25 10:22:31"
    },
    {
      "jieqi_name": "清明",
      "jieqi_simple_time": "2024-04-04",
      "jieqi_detail_time": "2024-04-04 15:02:03",
      "jieqi_simple_lunar_time": "2024-02-26",
      "jieqi_detail_lunar_time": "2024-02-26 15:02:03"
    },
    {
      "jieqi_name": "立夏",
      "jieqi_simple_time": "2024-05-05",
      "jieqi_detail_time": "2024-05-05 08:09:51",
      "jieqi_simple_lunar_time": "2024-03-27",
      "jieqi_detail_lunar_time": "2024-03-27 08:09:51"
    },
    {
      "jieqi_name": "芒种",
      "jieqi_simple_time": "2024-06-05",
      "jieqi_detail_time": "2024-06-05 12:09:40",
      "jieqi_simple_lunar_time": "2024-04-29",
      "jieqi_detail_lunar_time": "2024-04-29 12:09:40"
    },
    {
      "jieqi_name": "小暑",
      "jieqi_simple_time": "2024-07-06",
      "jieqi_detail_time": "2024-07-06 22:19:49",
      "jieqi_simple_lunar_time": "2024-06-01",
      "jieqi_detail_lunar_time": "2024-06-01 22:19:49"
    },
    {
      "jieqi_name": "立秋",
      "jieqi_simple_time": "2024-08-07",
      "jieqi_detail_time": "2024-08-07 08:09:01",
      "jieqi_simple_lunar_time": "2024-07-04",
      "jieqi_detail_lunar_time": "2024-07-04 08:09:01"
    },
    {
      "jieqi_name": "白露",
      "jieqi_simple_time": "2024-09-07",
      "jieqi_detail_time": "2024-09-07 11:11:06",
      "jieqi_simple_lunar_time": "2024-08-05",
      "jieqi_detail_lunar_time": "2024-08-05 11:11:06"
    },
    {
      "jieqi_name": "寒露",
      "jieqi_simple_time": "2024-10-08",
      "jieqi_detail_time": "2024-10-08 02:59:43",
      "jieqi_simple_lunar_time": "2024-09-06",
      "jieqi_detail_lunar_time": "2024-09-06 02:59:43"
    },
    {
      "jieqi_name": "立冬",
      "jieqi_simple_time": "2024-11-07",
      "jieqi_detail_time": "2024-11-07 06:19:49",
      "jieqi_simple_lunar_time": "2024-10-07",
      "jieqi_detail_lunar_time": "2024-10-07 06:19:49"
    },
    {
      "jieqi_name": "大雪",
      "jieqi_simple_time": "2024-12-06",
      "jieqi_detail_time": "2024-12-06 23:16:47",
      "jieqi_simple_lunar_time": "2024-11-06",
      "jieqi_detail_lunar_time": "2024-11-06 23:16:47"
    }
  ]
}
                

失败返回示例

{
  "errcode": -1,
  "errmsg": "日期有误",
}