Free Api series [1] of holiday-related information

Foreword

I believe attention of little friends should know, six months ago I started to maintain a common set of free api interfaces, the original intention was for own use, the way to put it together with a friend in need! Maintenance after another six months, and now the number of interfaces are slowly added, some friends private letter I, in the hope that I can continue to maintain the same time, I hope I can finish each interface individually what looks clearer, so with this [series] free Api finishing the document.

In addition, if you need an overview of all interfaces, please move GitHub: RollToolsApi ! If this project help you, I hope you do not begrudge the hands of the mouse, help to point a star, and recommend to the people around you, to thank you the big brother!

Api Interface Description

Special Note

HOST Address: recommend the use of more secure https Interface: www.mxnzp.com/api before www.mxnzp.com/api can continue to use will not be affected! HOST hereinafter all need to replace the above http or https domain

First, specify the date of holidays and calendar information

  • Interface Description: Gets holidays and calendar information specified date

  • Interface Address: [the HOST] / Holiday / SINGLE / {DATE} [example: [HOST] / holiday / single / 20181121 ]

  • Parameters: DATE Date Format yyyyMMdd

  • Return data:

    • date: Current date
    • weekDay: current week day of 1- 2- Monday Tuesday ... Sunday 7-
    • yearTips: attribution chronology described example: Hundred
    • type: type 1 2 0 holiday weekday holidays
    • typeDes: Type Description such as the National Day holidays, weekdays
    • chineseZodiac: Zodiac example: dog
    • solarTerms: throttle describe, for example: snow
    • lunarCalendar: Lunar Date
    • suit: should matters
    • dayOfYear: The first few days of the year
    • weekOfYear: The first few weeks of the year
    • constellation: constellation
  • Sample data:

    {
        "code": 1,
        "msg": "数据返回成功",
        "data": {
            "date": "2018-11-21",
            "weekDay": 3,
            "yearTips": "戊戌",
            "type": 0,
            "typeDes": "工作日",
            "chineseZodiac": "狗",
            "solarTerms": "立冬后",
            "avoid": "嫁娶.安葬",
            "lunarCalendar": "十月十四",
            "suit": "破屋.坏垣.祭祀.余事勿取",
            "dayOfYear": 325,
            "weekOfYear": 47,
            "constellation": "天蝎座"
        }
    }
    复制代码

Second, to specify multiple dates of holidays and calendar information

  • Interface Description: get more holidays and calendar information specified date

  • Interface Address: [the HOST] / Holiday / Multi / {} {e.g. a dates: [HOST] / holiday / multi / 20180101,20181010,20181011 ]

  • Parameters: a dates set date format yyyyMMdd, yyyyMMdd, yyyyMMdd (separated by a comma)

  • Return data:

    • date: Current date
    • weekDay: current week day of 1- 2- Monday Tuesday ... Sunday 7-
    • yearTips: attribution chronology described example: Hundred
    • type: type 1 2 0 holiday weekday holidays
    • typeDes: Type Description such as the National Day holidays, weekdays
    • chineseZodiac: Zodiac example: dog
    • solarTerms: throttle describe, for example: snow
    • lunarCalendar: Lunar Date
    • suit: should matters
    • dayOfYear: The first few days of the year
    • weekOfYear: The first few weeks of the year
    • constellation: constellation
  • Sample data:

    {
        "code": 1,
        "msg": "数据返回成功",
        "data": [
            {
                "date": "2018-01-01",
                "weekDay": 1,
                "yearTips": "丁酉",
                "type": 2,
                "chineseZodiac": "鸡",
                "solarTerms": "冬至后",
                "avoid": "出行.安葬.修坟.开市",
                "lunarCalendar": "11-15",
                "typeDes" : "元旦",
                "suit": "祭祀.塑绘.开光.裁衣.冠笄.嫁娶.纳采.拆卸.修造.动土.竖柱.上梁.安床.移徙.入宅.安香.结网.捕捉.畋猎.伐木.进人口.放水",
                "dayOfYear": 1,
                "weekOfYear": 1,
                "constellation": "天蝎座"
            },
            {
                "date": "2018-10-10",
                "weekDay": 3,
                "yearTips": "戊戌",
                "type": 0,
                "chineseZodiac": "狗",
                "solarTerms": "寒露后",
                "typeDes" : "工作日",
                "avoid": "造庙.嫁娶.掘井.栽种.造桥.作灶.动土",
                "lunarCalendar": "9-2",
                "suit": "祭祀.开光.出行.解除.伐木.作梁.出火.拆卸.入宅.移徙.安床.修造.造畜椆栖.扫舍",
                "dayOfYear": 283,
                "weekOfYear": 41,
                "constellation": "天蝎座"
            },
            {
                "date": "2018-10-11",
                "weekDay": 4,
                "yearTips": "戊戌",
                "type": 0,
                "typeDes" : "工作日",
                "chineseZodiac": "狗",
                "solarTerms": "寒露后",
                "avoid": "入宅.上梁.斋醮.出火.谢土",
                "lunarCalendar": "9-3",
                "suit": "纳采.订盟.开市.交易.立券.会亲友.纳畜.牧养.问名.移徙.解除.作厕.入学.起基.安床.开仓.出货财.安葬.启攒.入殓.除服.成服",
                "dayOfYear": 284,
                "weekOfYear": 41,
                "constellation": "天蝎座"
            }
        ]
    }
    复制代码

Third, all of the specified month holiday and calendar information

  • Interface Description: Gets holidays and calendar information for a given month

  • Interface Address: [the HOST] / Holiday / List / month The / {DATE} [example: [HOST] / holiday / list / month / 201802 ]

  • Parameters: January query format yyyyMM date (only date)

  • Return data:

    • date: Current date
    • weekDay: current week day of 1- 2- Monday Tuesday ... Sunday 7-
    • yearTips: attribution chronology described example: Hundred
    • type: type 1 2 0 holiday weekday holidays
    • typeDes: Type Description such as the National Day holidays, weekdays
    • chineseZodiac: Zodiac example: dog
    • solarTerms: throttle describe, for example: snow
    • lunarCalendar: Lunar Date
    • suit: should matters
    • dayOfYear: The first few days of the year
    • weekOfYear: The first few weeks of the year
    • constellation: constellation
  • Sample data:

    {
        "code": 1,
        "msg": "数据返回成功",
        "data": [
            {
                "date": "2018-02-01",
                "weekDay": 4,
                "yearTips": "丁酉",
                "type": 0,
                "chineseZodiac": "鸡",
                "typeDes" : "工作日",
                "solarTerms": "大寒后",
                "avoid": "开仓.嫁娶.移徙.入宅",
                "lunarCalendar": "12-16",
                "suit": "祭祀.沐浴.祈福.斋醮.订盟.纳采.裁衣.拆卸.起基.竖柱.上梁.安床.入殓.除服.成服.移柩.启攒.挂匾.求嗣.出行.合帐.造畜椆栖",
                "dayOfYear": 32,
                "weekOfYear": 5,
                "constellation": "天蝎座"
            },
            ...中间隐藏了"2018-02-02"~"2018-02-27"的数据
            {
                "date": "2018-02-28",
                "weekDay": 3,
                "yearTips": "戊戌",
                "type": 0,
                "chineseZodiac": "狗",
                "typeDes" : "工作日",
                "solarTerms": "雨水后",
                "avoid": "掘井",
                "lunarCalendar": "1-13",
                "suit": "祭祀.斋醮.裁衣.合帐.冠笄.订盟.纳采.嫁娶.入宅.安香.谢土.入殓.移柩.破土.立碑.安香.会亲友.出行.祈福.求嗣.立碑.上梁.放水",
                "dayOfYear": 59,
                "weekOfYear": 9,
                "constellation": "天蝎座"
            }
        ]
    
    }
    复制代码

Fourth, specify the type of a given month, all the holidays and calendar information

  • Interface Description: Gets holidays and calendar information for a given month

  • Interface Address: [the HOST] / Holiday / List / month The / {DATE} / {[e.g. type}: [HOST] / holiday / list / month / 201810 / rest ]

  • Parameters: January query format yyyyMM date (only date), type type need to query {Optional values: Type workday working holiday holidays rest rest day festival holiday}

  • Return data:

    • month: current month
    • year: current year
      • date: Current date
      • weekDay: current week day of 1- 2- Monday Tuesday ... Sunday 7-
      • yearTips: attribution chronology described example: Hundred
      • type: type 1 2 0 holiday weekday holidays
      • typeDes: Type Description such as the National Day holidays, weekdays
      • chineseZodiac: Zodiac example: dog
      • solarTerms: throttle describe, for example: snow
      • lunarCalendar: Lunar Date
      • suit: should matters
      • dayOfYear: The first few days of the year
      • weekOfYear: The first few weeks of the year
      • constellation: constellation
  • Sample data

    {
        "code": 1,
        "msg": "数据返回成功",
        "data": [
            {
                "month": 10,
                "year": 2018,
                "days": [
                    {
                        "date": "2018-10-13",
                        "weekDay": 6,
                        "yearTips": "戊戌",
                        "type": 1,
                        "typeDes": "休息日",
                        "chineseZodiac": "狗",
                        "solarTerms": "寒露后",
                        "avoid": "开市.交易.祭祀.入宅.安葬",
                        "lunarCalendar": "九月初五",
                        "suit": "捕捉.畋猎.余事勿取",
                        "dayOfYear": 286,
                        "weekOfYear": 41,
                        "constellation": "天蝎座"
                    },
                    ...中间隐藏了一部分的数据...
                    {
                        "date": "2018-10-28",
                        "weekDay": 7,
                        "yearTips": "戊戌",
                        "type": 1,
                        "typeDes": "休息日",
                        "chineseZodiac": "狗",
                        "solarTerms": "霜降后",
                        "avoid": "出行.祈福.安葬.作灶",
                        "lunarCalendar": "九月廿",
                        "suit": "会亲友.嫁娶.订盟.纳采.纳婿.拆卸.修造.动土.起基.竖柱.上梁.安床.会亲友.纳财",
                        "dayOfYear": 301,
                        "weekOfYear": 43,
                        "constellation": "天蝎座"
                    }
                ]
            }
        ]
    }
    复制代码

Five, all of the specified year holidays and calendar information

  • Interface Description: Gets the Year holidays and calendar information

  • Interface Address: [the HOST] / Holiday List // / year / {DATE} [example: [HOST] / holiday / list / year / 2018 ]

  • Parameter Description: Year yyyy date format query (only the year)

  • Return data:

    • month: current month
    • year: current year
      • date: Current date
      • weekDay: current week day of 1- 2- Monday Tuesday ... Sunday 7-
      • yearTips: attribution chronology described example: Hundred
      • type: type 1 2 0 holiday weekday holidays
      • typeDes: Type Description such as the National Day holidays, weekdays
      • chineseZodiac: Zodiac example: dog
      • solarTerms: throttle describe, for example: snow
      • lunarCalendar: Lunar Date
      • suit: should matters
      • dayOfYear: The first few days of the year
      • weekOfYear: The first few weeks of the year
      • constellation: constellation
  • Sample data:

    {
        "code": 1,
        "msg": "数据返回成功",
        "data": [
            {
                "month": 1,
                "year": 2018,
                "days": [
                    {
                        "date": "2018-01-01",
                        "weekDay": 1,
                        "yearTips": "丁酉",
                        "type": 2,
                        "chineseZodiac": "鸡",
                        "solarTerms": "冬至后",
                        "typeDes" : "元旦",
                        "avoid": "出行.安葬.修坟.开市",
                        "lunarCalendar": "11-15",
                        "suit": "祭祀.塑绘.开光.裁衣.冠笄.嫁娶.纳采.拆卸.修造.动土.竖柱.上梁.安床.移徙.入宅.安香.结网.捕捉.畋猎.伐木.进人口.放水",
                        "dayOfYear": 1,
                        "weekOfYear": 1,
                        "constellation": "天蝎座"
                    },
                    ...中间隐藏了"2018-01-02"~"2018-01-30"的数据
                    {
                        "date": "2018-01-31",
                        "weekDay": 3,
                        "yearTips": "丁酉",
                        "type": 0,
                        "chineseZodiac": "鸡",
                        "typeDes" : "工作日",
                        "solarTerms": "大寒后",
                        "avoid": "嫁娶.入殓.安葬.出行",
                        "lunarCalendar": "12-15",
                        "suit": "塑绘.开光.沐浴.冠笄.会亲友.作灶.放水.造畜椆栖",
                        "dayOfYear": 31,
                        "weekOfYear": 5,
                        "constellation": "天蝎座"
                    }
                ]
            },
            ...中间隐藏了02月到11月的数据
            {
                "month": 12,
                "days": [
                    {
                        "date": "2018-12-01",
                        "weekDay": 6,
                        "yearTips": "戊戌",
                        "type": 1,
                        "chineseZodiac": "狗",
                        "typeDes" : "休息日",
                        "solarTerms": "小雪后",
                        "avoid": "作灶.治病",
                        "lunarCalendar": "10-24",
                        "suit": "祭祀.祈福.订盟.纳采.裁衣.拆卸.修造.动土.起基.安床.移徙.入宅.安香.入殓.移柩.安葬.谢土.赴任.进人口.会亲友",
                        "dayOfYear": 335,
                        "weekOfYear": 48,
                        "constellation": "天蝎座"
                    },
                    ...中间隐藏了"2018-12-02"~"2018-12-30"的数据
                    {
                        "date": "2018-12-31",
                        "weekDay": 1,
                        "yearTips": "戊戌",
                        "type": 0,
                        "chineseZodiac": "狗",
                        "solarTerms": "冬至后",
                        "avoid": "开市.破土",
                        "lunarCalendar": "10-25",
                        "suit": "祭祀.沐浴.安床.纳财.畋猎.捕捉",
                        "dayOfYear": 365,
                        "weekOfYear": 1,
                        "constellation": "天蝎座"
                    }
                ]
            }
        ]
    }
    复制代码

Sixth, all the specified year of the specified type of holidays and calendar information

  • Interface Description: Gets holidays and calendar information for a given month

  • Interface Address: [the HOST] / Holiday / List / year / {DATE} / {[e.g. type}: [HOST] / holiday / list / year / 2018 / rest ]

  • Parameters: January query format yyyy date (year only), type type need to query {Optional values: Type workday working holiday holidays rest rest day festival holiday}

  • Return data:

    • month: current month
    • year: current year
      • date: Current date
      • weekDay: current week day of 1- 2- Monday Tuesday ... Sunday 7-
      • yearTips: attribution chronology described example: Hundred
      • type: type 1 2 0 holiday weekday holidays
      • typeDes: Type Description such as the National Day holidays, weekdays
      • chineseZodiac: Zodiac example: dog
      • solarTerms: throttle describe, for example: snow
      • lunarCalendar: Lunar Date
      • suit: should matters
      • dayOfYear: The first few days of the year
      • weekOfYear: The first few weeks of the year
      • constellation: constellation
  • Sample data

    {
        "code": 1,
        "msg": "数据返回成功,域名已经成功备案,为了更优雅的调用,不久后将废弃8091端口,请尽快使用新域名直接调用,多有不便敬请谅解",
        "data": [
            {
                "month": 1,
                "year": 2018,
                "days": [
                    {
                        "date": "2018-01-06",
                        "weekDay": 6,
                        "yearTips": "丁酉",
                        "type": 1,
                        "typeDes": "休息日",
                        "chineseZodiac": "鸡",
                        "solarTerms": "小寒后",
                        "avoid": "嫁娶.开市.入宅.安床.破土.安葬",
                        "lunarCalendar": "冬月廿",
                        "suit": "祭祀.斋醮.纳财.捕捉.畋猎",
                        "dayOfYear": 6,
                        "weekOfYear": 1,
                        "constellation": "天蝎座"
                    },
                    ...中间还有一些数据没有显示...
                    {
                        "date": "2018-01-28",
                        "weekDay": 7,
                        "yearTips": "丁酉",
                        "type": 1,
                        "typeDes": "休息日",
                        "chineseZodiac": "鸡",
                        "solarTerms": "大寒后",
                        "avoid": "祈福.嫁娶.造庙.安床.谢土",
                        "lunarCalendar": "腊月十二",
                        "suit": "纳采.订盟.祭祀.求嗣.出火.塑绘.裁衣.会亲友.入学.拆卸.扫舍.造仓.挂匾.掘井.开池.结网.栽种.纳畜.破土.修坟.立碑.安葬.入殓",
                        "dayOfYear": 28,
                        "weekOfYear": 4,
                        "constellation": "天蝎座"
                    }
                ]
            },
            ...中间有2月到11月的数据没有展示...
            {
                "month": 12,
                "year": 2018,
                "days": [
                    {
                        "date": "2018-12-01",
                        "weekDay": 6,
                        "yearTips": "戊戌",
                        "type": 1,
                        "typeDes": "休息日",
                        "chineseZodiac": "狗",
                        "solarTerms": "小雪后",
                        "avoid": "作灶.治病",
                        "lunarCalendar": "十月廿四",
                        "suit": "祭祀.祈福.订盟.纳采.裁衣.拆卸.修造.动土.起基.安床.移徙.入宅.安香.入殓.移柩.安葬.谢土.赴任.进人口.会亲友",
                        "dayOfYear": 335,
                        "weekOfYear": 48,
                        "constellation": "天蝎座"
                    },
                    ...中间还有一些数据没有显示...
                    {
                        "date": "2018-12-30",
                        "weekDay": 7,
                        "yearTips": "戊戌",
                        "type": 1,
                        "typeDes": "元旦",
                        "chineseZodiac": "狗",
                        "solarTerms": "冬至后",
                        "avoid": null,
                        "lunarCalendar": "冬月廿四",
                        "suit": "塑绘.斋醮.出行.拆卸.解除.修造.移徙.造船.入殓.除服.成服.移柩.启攒.修坟.立碑.谢土",
                        "dayOfYear": 364,
                        "weekOfYear": 52,
                        "constellation": "天蝎座"
                    }
                ]
            }
        ]
    }
    复制代码

Instructions

This interface is currently one of the largest in the use of all interfaces, so put a series of articles to introduce the first! Data interface that contains data from 2002 to 2019 for 17 years. As for why no data before 2002 and why why no data after 2019, I need to explain: [Chinese government] network by the end of year holiday schedule will be announced next year, so far, only data collected in 2019, prior to 2002, in fact, there is no clear concept of holidays and related data, we can not collect all the relevant data.

As for the update data, will be released at the same time there is new information to follow up to ensure that accurate data as possible for everyone.

As for what these interfaces can do, I believe that as this service using the maximum amount of interface should give you some inspiration.

Epilogue

Jane books home , links are www.jianshu.com/u/123f97613...

Nuggets home page , links are juejin.im/user/5838d5...

Home Github link is github.com/MZCretin

CSDN home page , links are blog.csdn.net/u010998327

I was Cretin, a lovely greasy uncle.

Guess you like

Origin juejin.im/post/5d40213ff265da03d8719944