SuperAPI AI Directory

china-holidays

General & other

View repository

Updated 10-16 08:06

About this skill

National Statutory Holiday Query

Retrieve from the Chinese government website (www.gov.cn) the national statutory holiday arrangement notices issued by the General Office of the State Council.

Use Cases

  • Query the holiday arrangements for a certain year
  • Find out the make-up work dates for statutory holidays
  • Get the specific number of days for long holidays such as Spring Festival and National Day
  • Confirm whether make-up work days are required

Workflow

Step 1: Confirm the query year

First confirm the year the user wants to query. If the user does not specify, use the current year by default.

Step 2: Retrieve the holiday notice

Run the script to retrieve the holiday arrangement notice issued by the General Office of the State Council:

python scripts/fetch_holidays.py --year {年份}

This script uses acache-first strategy:

  1. reads the local cache first: check whether assets/{年份}.md exists
  2. Cache hit: directly return the cached holiday data (millisecond-level response)
  3. Cache miss: retrieve the data online from the government website and automatically cache it locally

Expected output: The full text of the General Office of the State Council's notice on the arrangement of some holidays for that year (pure Chinese content)

Force refresh (optional)

If you need to force retrieval of the latest data from the network (ignoring the cache), add the --force parameter:

python scripts/fetch_holidays.py --year {年份} --force

Trigger scenarios: When the user mentions similar phrases such as the following, use the --force parameter:

  • "retrieve again from the network"
  • "force update the cache"
  • "refresh the data"
  • "download again"
  • "update the cache for {year}"

Step 3: Parse and output the holiday information

Based on the retrieved notice content, organize the output according to the user's requirements:

Standard output format:

【{年份}年国家法定节假日安排】

一、元旦:{具体日期}放假调休,共{天数}天。{调休说明}
二、春节:{具体日期}放假调休,共{天数}天。{调休说明}
三、清明节:{具体日期}放假调休,共{天数}天。{调休说明}
四、劳动节:{具体日期}放假调休,共{天数}天。{调休说明}
五、端午节:{具体日期}放假调休,共{天数}天。{调休说明}
六、中秋节:{具体日期}放假调休,共{天数}天。{调休说明}
七、国庆节:{具体日期}放假调休,共{天数}天。{调休说明}

Example

Example 1: Query holidays for 2026

The user says: "Help me look up the holiday arrangements for 2026"

Operation:

  1. Confirm year: 2026
  2. Run:python scripts/fetch_holidays.py --year 2026
  3. Retrieve the notice content from the General Office of the State Council
  4. Organize and output the holiday arrangements

Result:

【2026 年国家法定节假日安排】

一、元旦:1 月 1 日(周四)至 3 日(周六)放假调休,共 3 天。1 月 4 日(周日)上班。
二、春节:2 月 15 日(农历腊月二十八、周日)至 23 日(农历正月初七、周一)放假调休,共 9 天。2 月 14 日(周六)、2 月 28 日(周六)上班。
三、清明节:4 月 4 日(周六)至 6 日(周一)放假,共 3 天。
四、劳动节:5 月 1 日(周五)至 5 日(周二)放假调休,共 5 天。5 月 9 日(周六)上班。
五、端午节:6 月 19 日(周五)至 21 日(周日)放假,共 3 天。
六、中秋节:9 月 25 日(周五)至 27 日(周日)放假,共 3 天。
七、国庆节:10 月 1 日(周四)至 7 日(周三)放假调休,共 7 天。9 月 20 日(周日)、10 月 10 日(周六)上班。

Note: The script returns the original text of the General Office of the State Council notice. The Agent needs to extract key information from it and organize the output:

  • Default case: organize the output according to the above standard format
  • User-specified format: if the user proactively provides output format requirements or specifies an output template, organize the output according to the user's given requirements (such as JSON, table, list, brief reply, etc.)

Example 2: Query holidays for the current year

The user says: "How are the holidays arranged this year?"

Operation:

  1. Confirm year: current year (2026)
  2. Run:python scripts/fetch_holidays.py --year 2026
  3. Output the holiday arrangements

Result: Output the full holiday schedule for 2026 (same format as Example 1)

Example 3: Force refresh cache

User says: "Re-fetch the 2026 holiday data from the network"

Actions:

  1. Confirm year: 2026
  2. Run:python scripts/fetch_holidays.py --year 2026 --force
  3. The script will ignore the local cache and re-fetch data from the government website

Expected output:

$ python scripts/fetch_holidays.py --year 2026 --force
正在从网络获取 2026 年节假日数据...
找到通知:https://www.gov.cn/gongbao/2025/issue_12406/202511/content_7048922.html
正在获取通知内容...
已缓存到:skills/china-holidays/assets/2026.md
# 下方是通知原文内容

Example 4: Query a specific holiday

User says: "How many days off for Spring Festival in 2026?"

Actions:

  1. Confirm year: 2026
  2. Run the script to fetch data
  3. Extract Spring Festival-related information from the returned content

Output example:

2026 年春节放假安排:
2 月 15 日(农历腊月二十八、周日)至 23 日(农历正月初七、周一)放假调休,共 9 天。
2 月 14 日(周六)、2 月 28 日(周六)上班。

Example 5: Compare holiday schedules for two years

User says: "Compare the differences in Spring Festival holiday between 2025 and 2026"

Actions:

  1. Fetch the holiday data for each of the two years separately
  2. Run:python scripts/fetch_holidays.py --year 2025 and python scripts/fetch_holidays.py --year 2026
  3. Extract Spring Festival-related information for comparison

Output example:

2025 年 vs 2026 年春节放假对比:

2025 年春节:1 月 28 日(除夕)至 2 月 4 日(初七)放假,共 8 天
2026 年春节:2 月 15 日(腊月二十八)至 23 日(初七)放假,共 9 天

差异:2026 年比 2025 年多放 1 天,且 2026 年包含腊月二十八

Example 6: Custom output format

User says: "Output all 2026 holiday schedules in JSON format"

Actions:

  1. Run the script to fetch data
  2. Organize the output in the JSON format requested by the user

Output example:

{
  "year": 2026,
  "holidays": [
    {"name": "元旦", "dates": "1 月 1 日 -1 月 3 日", "days": 3, "makeup_work": "1 月 4 日"},
    {"name": "春节", "dates": "2 月 15 日 -2 月 23 日", "days": 9, "makeup_work": "2 月 14 日、2 月 28 日"},
    {"name": "清明节", "dates": "4 月 4 日 -4 月 6 日", "days": 3, "makeup_work": "无"},
    {"name": "劳动节", "dates": "5 月 1 日 -5 月 5 日", "days": 5, "makeup_work": "5 月 9 日"},
    {"name": "端午节", "dates": "6 月 19 日 -6 月 21 日", "days": 3, "makeup_work": "无"},
    {"name": "中秋节", "dates": "9 月 25 日 -9 月 27 日", "days": 3, "makeup_work": "无"},
    {"name": "国庆节", "dates": "10 月 1 日 -10 月 7 日", "days": 7, "makeup_work": "9 月 20 日、10 月 10 日"}
  ]
}

Troubleshooting

No search results

Error symptom: The script returns "No related holiday notice found" or "Search results are empty"

Possible causes:

  • The holiday notice for that year has not yet been published (the next year's schedule is usually published in November-December of the previous year)
  • Network connection issues

How the Agent handles it:

  1. If querying a future year, inform the user that the notice for that year has not yet been published
  2. Suggest the user query a year that has already been published (such as the current year or the previous year)
  3. If it is a network issue, explain the situation to the user and suggest retrying later

Online fetch failed

Error symptom: The script exits and shows a network request failure

Possible causes:

  • Unstable network connection
  • Government website API parameters have changed

How the Agent handles it:

  1. Check the network connection and retry once
  2. If it still fails, explain to the user that "government website data cannot be fetched temporarily"
  3. Suggest the user use cached data (remove the--force parameter) or retry later
  4. If the user needs it, tell the user they can directly visit the government website to view it

Content parsing failed

Error symptom: A URL was obtained but valid content could not be extracted

How the Agent handles it:

  1. Explain to the user that "content parsing failed"
  2. Provide the original URL to the user so they can visit it manually
  3. Suggest the user retry later

Cached data does not exist

Error symptom: No local cache and online fetch failed

How the Agent handles it:

  1. Explain to the user that data for that year cannot be fetched temporarily
  2. Suggest the user query another year
  3. or advise the user to try again later

General handling principles:

  • Any error should clearly explain the cause and suggestions to the user
  • Prioritize using cached data
  • For network issues, advise the user to try again later
  • Provide alternatives (e.g., querying other years, visiting the government website)

Technical notes

  • Data source: officially published notices of the General Office of the State Council from the Chinese government website (www.gov.cn)
  • Data authority: sourced from the State Council Gazette, with official validity
  • Update frequency: usually released in November-December each year for the next year's arrangement
  • Caching strategy: local cache prioritized to reduce network requests and improve response speed

Caching mechanism

The script adoptscache-first strategy:

  1. Prioritize reading the local cache: check whether assets/{年份}.md exists
  2. Cache hit: directly return cached data (millisecond-level response, no network required)
  3. Cache miss: automatically fetch data from the government website and cache it locally

Agent handling suggestions:

  • By default, directly use cached data
  • When the user expresses intentions such as "re-fetch", "refresh data", "check the latest online", etc., it should be understood as requiring forced retrieval of the latest data from the network
  • The cache file is located at assets/{年份}.md, and will be automatically updated after new data is released each year

Tips

  1. Caching strategy: the script prioritizes the local cache for faster response
  2. Release time: the General Office of the State Council usually releases the next year's holiday arrangement in November-December each year
  3. Refresh data: when the user requests "re-fetch" or "refresh", the latest data should be forcibly retrieved from the network
  4. Default year: when the user does not specify a year, proactively ask or use the current year
  5. Offline use: years with existing cache can be queried completely offline
  6. Data authority: all data comes from the Chinese government website (www.gov.cn), with official validity
  7. Cross-year comparison: data from different years can be retrieved separately for comparative analysis
  8. Flexible format: supports output in different formats such as JSON, tables, lists, etc. as requested by the user

Notes

  1. Data timeliness: only years that have been released can be queried; notices for future years require waiting for official release
  2. Official source: all data comes from official government website channels to ensure accuracy
  3. Adjusted workday arrangements: when outputting, be sure to include explanations of adjusted workdays to help users arrange their work