## 万年历 >[danger]### 免费接口,每日100次免费调用,会员可不限次数调用,购买[API会员](https://market.topthink.com/product/210) ![](https://img.kancloud.cn/29/e6/29e6b4e9a5a45b0404f48d56e336d4c0_219x213.png =120x) > 包含三个接口:根据日期查询当天详细信息、查询近期假期和查询当年假期。 ## 接口调用([调用须知](https://docs.topthink.com/think-api/1835086)) ## 接口1:查询当天详细信息 ### 请求地址 ``` GET https://api.topthink.com/calendar/day ``` ### 请求参数 | 名称 | 必填 | 类型 | 说明 | | --- | --- | --- | --- | | appCode| 是| string|用户授权码,参考[API调用](https://docs.topthink.com/think-api/1835086) | |  date| 是 | string | 指定日期,格式为YYYY-MM-DD,如月份和日期小于10,则取个位,如:2012-1-1 | ### SDK调用 ``` $client = new Client("YourAppCode"); $result = $client->calendarDay() ->withDate('2020-8-1') ->request(); dump($result); ``` 返回示例: ~~~ { "message":"Success", "data":{ "data":{ "date":"2020-8-1", "animalsYear":"鼠", "avoid":"嫁娶.入宅.移徙.作灶.开市.交易.安门.栽种.", "lunar":"六月十二", "lunarYear":"庚子年", "suit":"祭祀.解除.沐浴.整手足甲.入殓.移柩.破土.启攒.安葬.", "weekday":"星期六", "year-month":"2020-8" } }, "code":0 } ~~~ ## 接口2:根据传入的月份返回近期的假期列表 ### 请求地址 ``` https://api.topthink.com/calendar/month ``` ### 请求参数 | 名称 | 必填 | 类型 | 说明 | | --- | --- | --- | --- | |  yearMonth| 是 | string | 指定月份,格式为YYYY-MM,如月份和日期小于10,则取个位,如:2012-1| ### SDK调用 ``` $client = new Client("YourAppCode"); $result = $client->calendarMonth() ->withYearMonth('2020-8') ->request(); dump($result); ``` ## 接口3:根据传入年份返回当年假期列表 ### 请求地址 ``` https://api.topthink.com/calendar/year ``` ### 请求参数 | 名称 | 必填 | 类型 | 说明 | | --- | --- | --- | --- | |  year| 是 | string | 指定年份,格式为YYYY,如:2015 | ### SDK调用 ``` $client = new Client("YourAppCode"); $result = $client->calendarYear() ->withYear('2020') ->request(); dump($result); ```