# 使用方法

### 概述

黄历API提供了基于指定日期的黄历信息，包括农历、节气、干支等数据。用户可以通过GET请求获取特定日期的黄历信息。

### 基本信息

* **API URL**: `https://api.8i5.net/huangli`
* **请求方式**: GET
* **返回格式**: JSON

### 请求参数

| 参数名称 | 类型     | 必填 | 描述                                |
| ---- | ------ | -- | --------------------------------- |
| date | string | 否  | 查询的公历日期，格式为`YYYY-MM-DD`。默认值为当前日期。 |

#### 示例请求

```plaintext
GET https://api.8i5.net/huangli?date=2024-10-13
```

### 返回字段

响应将返回一个JSON对象，包含以下字段：

| 字段名称                | 类型     | 描述                   |
| ------------------- | ------ | -------------------- |
| code                | int    | 响应状态码，1表示成功，其他值表示错误。 |
| msg                 | string | 响应信息，描述状态码的含义。       |
| data                | object | 包含详细的黄历数据。           |
| - GregorianDateTime | string | 公历日期。                |
| - LunarDateTime     | string | 农历日期。                |
| - LunarShow         | string | 农历显示。                |
| - IsJieJia          | string | 是否节假日，0表示不是，1表示是。    |
| - LJie              | string | 农历节日信息。              |
| - GJie              | string | 公历节日信息。              |
| - Yi                | string | 宜做事项。                |
| - Ji                | string | 忌做事项。                |
| - ShenWei           | string | 喜神方位。                |
| - Taishen           | string | 胎神方位。                |
| - Chong             | string | 冲煞信息。                |
| - SuiSha            | string | 岁煞信息。                |
| - WuxingJiazi       | string | 五行干支年。               |
| - WuxingNaYear      | string | 年五行。                 |
| - WuxingNaMonth     | string | 月五行。                 |
| - WuxingNaDay       | string | 日五行。                 |
| - MoonName          | string | 月名。                  |
| - XingEast          | string | 东星宿。                 |
| - XingWest          | string | 西星宿。                 |
| - PengZu            | string | 彭祖忌信息。               |
| - JianShen          | string | 值神信息。                |
| - TianGanDiZhiYear  | string | 干支年。                 |
| - TianGanDiZhiMonth | string | 干支月。                 |
| - TianGanDiZhiDay   | string | 干支日。                 |
| - ShengXiao         | string | 生肖。                  |
| - LunarMonth        | string | 农历月。                 |
| - LunarDay          | string | 农历日。                 |
| - SolarTermName     | string | 节气信息。                |

#### 示例响应

```json
{
    "code": 1,
    "msg": "成功获取",
    "data": {
        "GregorianDateTime": "2024-10-13",
        "LunarDateTime": "2024-09-11",
        "LunarShow": "",
        "IsJieJia": "0",
        "LJie": "无数据",
        "GJie": "世界保护日 国际教师节",
        "Yi": "日值岁破 大事不宜",
        "Ji": "日值岁破 大事不宜",
        "ShenWei": "喜神：西北 福神：西南 财神：正东",
        "Taishen": "脐带虫动,鸡棚",
        "Chong": "狗日冲(乙亥)龙",
        "SuiSha": "岁煞北",
        "WuxingJiazi": "火",
        "WuxingNaYear": "佛灯火",
        "WuxingNaMonth": "叠绒金",
        "WuxingNaDay": "无数据",
        "MoonName": "仲月",
        "XingEast": "南方星日马-壬",
        "XingWest": "天秤座",
        "PengZu": "贞不经忌不吃狗",
        "JianShen": "建",
        "TianGanDiZhiYear": "甲辰",
        "TianGanDiZhiMonth": "甲戌",
        "TianGanDiZhiDay": "庚戌",
        "ShengXiao": "龙",
        "LunarMonth": "九月",
        "LunarDay": "十一",
        "SolarTermName": "无数据"
    }
}
```

### 错误响应示例

```json
{
    "code": "cURL error",
    "message": "Error message here",
    "data": {}
}
```

### 注意事项

* **请求频率**: 请勿频繁请求，以免影响API服务器性能。
* **数据准确性**: 尽管API尽力提供准确的数据，但请根据实际情况进行判断。
* **安全性**: API未提供认证机制，建议在生产环境中添加相应的安全措施。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-doc.8i5.net/huang-li-yun-shi/shi-yong-fang-fa.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
