{
    "openapi": "3.0.0",
    "info": {
        "title": "节假日 - API文档",
        "version": "1.0.0",
        "description": "查询节假日信息，接口返回节日名称类型、农历信息、上班调休、工资倍数、假期范围、拼假建议、及工作日相关信息等。通过请求参数mode还可以指定是否返回当天有关的国内外节日信息。使用前建议阅读参考文章：<a target=\"_blank\" href=\"https:\/\/www.tianapi.com\/article\/153\">节假日接口增加多种查询方式<\/a><\/p>\n<p>接口支持按年、按月、按日期范围和多个日期批量查询。如按年查询（type=1&date=2020）、按月查询（type=2&date=2020-10）、按日期范围查询（type=3&date=2020-11-1~2020-11-10）、按多个日期批量查询（date=2020-10-1,2020-11-12）<\/p>\n<p>请注意，按年查询只返回中国官方节假日信息；按月查询如只传年月，则为从该月第一天到最后一天；按范围查询，起点和终点用波浪号~分隔；按多个日期批量查询用英文半角逗号分隔。无论哪种查询方式，单次查询所包含的总日期数不能超过31天。<\/p>\n<p style=\"color:red\">daycode表示日期类型，0表示工作日、1节假日、2双休日、3调休日（需上班）。判断是否需要上班建议用isnotwork字段，其中值为0表示上班，为1表示休息。wage表示薪资倍数，周末为两倍，法定节假日当天为三倍其他两倍（按年查询时返回三倍薪资的具体日期）。<\/p>\n<p>提示：info字段和daycode并非对应关系，建议仅用于日期类型标记；节日指某个具体日期（如2021年1月1号），节假日指整个假期（如2021年1月1号至3号）；节日范围宽泛（如会包含植树节、圣诞节），节假日指来自官方发布的有假节日，每年底政府公布后同步更新。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/jiejiari\/index": {
            "get": {
                "summary": "节假日查询",
                "tags": [
                    "节假日"
                ],
                "description": "判断日期是否为官方节假日支持按年、按月和范围批量查询",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "查询日期或日期范围",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "2021-01-01",
                            "description": "查询日期或日期范围"
                        }
                    },
                    {
                        "name": "mode",
                        "in": "query",
                        "description": "查询模式，为1返回中外特殊节日、纪念日等",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 0,
                            "description": "查询模式，为1返回中外特殊节日、纪念日等"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "查询类型，0批量、1按年、2按月、3范围",
                        "required": true,
                        "schema": {
                            "type": "int",
                            "example": 0,
                            "description": "查询类型，0批量、1按年、2按月、3范围"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "end": {
                                            "type": "int",
                                            "example": 6,
                                            "description": "假期终点计数"
                                        },
                                        "now": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "假期当前计数"
                                        },
                                        "tip": {
                                            "type": "string",
                                            "example": "10月1日至7日放假调休，共7天......",
                                            "description": "放假提示"
                                        },
                                        "date": {
                                            "type": "string",
                                            "example": "2019-10-01",
                                            "description": "当前阳历日期"
                                        },
                                        "info": {
                                            "type": "string",
                                            "example": "节假日",
                                            "description": "文字提示，工作日、节假日、节日、双休日、调休日"
                                        },
                                        "name": {
                                            "type": "string",
                                            "example": "国庆节",
                                            "description": "节假日名称（中文）"
                                        },
                                        "rest": {
                                            "type": "string",
                                            "example": "10月8日至10月10日请假2天，与周末连休可拼11天长假。",
                                            "description": "拼假建议"
                                        },
                                        "wage": {
                                            "type": "int",
                                            "example": 3,
                                            "description": "薪资法定倍数\/按年查询时为具体日期"
                                        },
                                        "start": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "假期起点计数"
                                        },
                                        "enname": {
                                            "type": "string",
                                            "example": "National Day",
                                            "description": "节日名称（英文）"
                                        },
                                        "remark": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            },
                                            "example": "[\"2021-12-26\",\"2021-01-08\"]",
                                            "description": "调休日数组"
                                        },
                                        "update": {
                                            "type": "boolean",
                                            "example": "true\/false",
                                            "description": "是否更新法定节假日（按年查询专有字段）"
                                        },
                                        "daycode": {
                                            "type": "int",
                                            "example": 1,
                                            "description": "日期类型，为0表示工作日、为1节假日、为2双休日、3为调休日（上班）"
                                        },
                                        "holiday": {
                                            "type": "string",
                                            "example": "10月1日",
                                            "description": "节日日期"
                                        },
                                        "weekday": {
                                            "type": "int",
                                            "example": 2,
                                            "description": "星期（数字）"
                                        },
                                        "lunarday": {
                                            "type": "string",
                                            "example": "初三",
                                            "description": "农历日"
                                        },
                                        "vacation": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            },
                                            "example": "[\"2021-01-01\",\"2021-01-02\",\"2021-01-03\"]",
                                            "description": "节假日数组"
                                        },
                                        "cnweekday": {
                                            "type": "string",
                                            "example": "星期二",
                                            "description": "星期（中文）"
                                        },
                                        "isnotwork": {
                                            "type": "int",
                                            "example": 1,
                                            "description": "是否需要上班，0为工作日，1为休息日"
                                        },
                                        "lunaryear": {
                                            "type": "string",
                                            "example": "己亥",
                                            "description": "农历年"
                                        },
                                        "lunarmonth": {
                                            "type": "string",
                                            "example": "九月",
                                            "description": "农历月"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "end": 2,
                                                "now": 0,
                                                "tip": "1月1日放假，共3天。",
                                                "date": "2021-01-01",
                                                "info": "节假日",
                                                "name": "元旦节",
                                                "rest": "2020年12月28日至2020年12月31日请假四天，与周末连休可拼七天长假。",
                                                "wage": 3,
                                                "start": 0,
                                                "enname": "NewYear",
                                                "remark": [
                                                    "2021-12-26",
                                                    "2021-01-08"
                                                ],
                                                "daycode": 1,
                                                "holiday": "1月1号",
                                                "weekday": 5,
                                                "lunarday": "十八",
                                                "vacation": [
                                                    "2021-01-01",
                                                    "2021-01-02",
                                                    "2021-01-03"
                                                ],
                                                "cnweekday": "星期五",
                                                "isnotwork": 1,
                                                "lunaryear": "庚子",
                                                "lunarmonth": "冬月"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "节假日查询",
                "tags": [
                    "节假日"
                ],
                "description": "判断日期是否为官方节假日支持按年、按月和范围批量查询",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "date": {
                                        "type": "string",
                                        "example": "2021-01-01",
                                        "description": "查询日期或日期范围"
                                    },
                                    "mode": {
                                        "type": "int",
                                        "example": 0,
                                        "description": "查询模式，为1返回中外特殊节日、纪念日等"
                                    },
                                    "type": {
                                        "type": "int",
                                        "example": 0,
                                        "description": "查询类型，0批量、1按年、2按月、3范围"
                                    }
                                },
                                "required": [
                                    "key",
                                    "date",
                                    "type"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "end": {
                                            "type": "int",
                                            "example": 6,
                                            "description": "假期终点计数"
                                        },
                                        "now": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "假期当前计数"
                                        },
                                        "tip": {
                                            "type": "string",
                                            "example": "10月1日至7日放假调休，共7天......",
                                            "description": "放假提示"
                                        },
                                        "date": {
                                            "type": "string",
                                            "example": "2019-10-01",
                                            "description": "当前阳历日期"
                                        },
                                        "info": {
                                            "type": "string",
                                            "example": "节假日",
                                            "description": "文字提示，工作日、节假日、节日、双休日、调休日"
                                        },
                                        "name": {
                                            "type": "string",
                                            "example": "国庆节",
                                            "description": "节假日名称（中文）"
                                        },
                                        "rest": {
                                            "type": "string",
                                            "example": "10月8日至10月10日请假2天，与周末连休可拼11天长假。",
                                            "description": "拼假建议"
                                        },
                                        "wage": {
                                            "type": "int",
                                            "example": 3,
                                            "description": "薪资法定倍数\/按年查询时为具体日期"
                                        },
                                        "start": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "假期起点计数"
                                        },
                                        "enname": {
                                            "type": "string",
                                            "example": "National Day",
                                            "description": "节日名称（英文）"
                                        },
                                        "remark": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            },
                                            "example": "[\"2021-12-26\",\"2021-01-08\"]",
                                            "description": "调休日数组"
                                        },
                                        "update": {
                                            "type": "boolean",
                                            "example": "true\/false",
                                            "description": "是否更新法定节假日（按年查询专有字段）"
                                        },
                                        "daycode": {
                                            "type": "int",
                                            "example": 1,
                                            "description": "日期类型，为0表示工作日、为1节假日、为2双休日、3为调休日（上班）"
                                        },
                                        "holiday": {
                                            "type": "string",
                                            "example": "10月1日",
                                            "description": "节日日期"
                                        },
                                        "weekday": {
                                            "type": "int",
                                            "example": 2,
                                            "description": "星期（数字）"
                                        },
                                        "lunarday": {
                                            "type": "string",
                                            "example": "初三",
                                            "description": "农历日"
                                        },
                                        "vacation": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            },
                                            "example": "[\"2021-01-01\",\"2021-01-02\",\"2021-01-03\"]",
                                            "description": "节假日数组"
                                        },
                                        "cnweekday": {
                                            "type": "string",
                                            "example": "星期二",
                                            "description": "星期（中文）"
                                        },
                                        "isnotwork": {
                                            "type": "int",
                                            "example": 1,
                                            "description": "是否需要上班，0为工作日，1为休息日"
                                        },
                                        "lunaryear": {
                                            "type": "string",
                                            "example": "己亥",
                                            "description": "农历年"
                                        },
                                        "lunarmonth": {
                                            "type": "string",
                                            "example": "九月",
                                            "description": "农历月"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "end": 2,
                                                "now": 0,
                                                "tip": "1月1日放假，共3天。",
                                                "date": "2021-01-01",
                                                "info": "节假日",
                                                "name": "元旦节",
                                                "rest": "2020年12月28日至2020年12月31日请假四天，与周末连休可拼七天长假。",
                                                "wage": 3,
                                                "start": 0,
                                                "enname": "NewYear",
                                                "remark": [
                                                    "2021-12-26",
                                                    "2021-01-08"
                                                ],
                                                "daycode": 1,
                                                "holiday": "1月1号",
                                                "weekday": 5,
                                                "lunarday": "十八",
                                                "vacation": [
                                                    "2021-01-01",
                                                    "2021-01-02",
                                                    "2021-01-03"
                                                ],
                                                "cnweekday": "星期五",
                                                "isnotwork": 1,
                                                "lunaryear": "庚子",
                                                "lunarmonth": "冬月"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}