National Statutory Holiday Query
Obtain the national statutory holiday arrangement notice issued by the General Office of the State Council from the official website of the Chinese government (
www.gov.cn).
Usage Scenarios
- Query the holiday arrangement of a specific year
- Learn about the work rescheduling dates of statutory holidays
- Get the specific duration of long holidays such as Spring Festival and National Day
- Confirm whether work rescheduling and make-up shifts are required
Workflow
Step 1: Confirm the query year
First confirm the year the user wants to query. If the user does not specify, the current year is used by default.
Step 2: Obtain the holiday notice
Run the script to obtain the holiday arrangement notice issued by the General Office of the State Council:
bash
python scripts/fetch_holidays.py --year {年份}
This script adopts a cache-first strategy:
- Prioritize reading local cache: Check whether exists
- Cache hit: Return the cached holiday data directly (millisecond-level response)
- Cache miss: Fetch data from the government website online and automatically cache it locally
Expected output: The full text of the notice of the General Office of the State Council on the arrangement of some holidays in the year (pure Chinese content)
Force Refresh (Optional)
If you need to force the latest data to be fetched from the network (ignoring the cache), add the
parameter:
bash
python scripts/fetch_holidays.py --year {年份} --force
Trigger scenarios: Use the
parameter when the user mentions the following similar statements:
- "Re-fetch from the network"
- "Force update cache"
- "Refresh the data"
- "Re-download"
- "Update the cache for {year}"
Step 3: Parse and output holiday information
According to the obtained notice content, organize and output according to user requirements:
Standard output format:
【{年份}年国家法定节假日安排】
一、元旦:{具体日期}放假调休,共{天数}天。{调休说明}
二、春节:{具体日期}放假调休,共{天数}天。{调休说明}
三、清明节:{具体日期}放假调休,共{天数}天。{调休说明}
四、劳动节:{具体日期}放假调休,共{天数}天。{调休说明}
五、端午节:{具体日期}放假调休,共{天数}天。{调休说明}
六、中秋节:{具体日期}放假调休,共{天数}天。{调休说明}
七、国庆节:{具体日期}放假调休,共{天数}天。{调休说明}
Examples
Example 1: Query holidays for 2026
User says: "Help me check the holiday arrangement for 2026"
Operation:
- Confirm the year: 2026
- Run:
python scripts/fetch_holidays.py --year 2026
- Obtain the notice content of the General Office of the State Council
- Organize and output the holiday arrangement
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 notice of the General Office of the State Council. The Agent needs to extract key information from it and organize the output:
- Default situation: Organize and output according to the above standard format
- User-specified format: If the user actively provides output format requirements or specifies an output template, organize the output according to the user's given requirements (such as JSON, table, list, short reply, etc.)
Example 2: Query holidays for the current year
User says: "What is the holiday arrangement for this year?"
Operation:
- Confirm the year: current year (2026)
- Run:
python scripts/fetch_holidays.py --year 2026
- Output the holiday arrangement
Result: Output the full-year holiday arrangement for 2026 (the format is the same as Example 1)
Example 3: Force refresh cache
User says: "Re-fetch the 2026 holiday data from the network"
Operation:
- Confirm the year: 2026
- Run:
python scripts/fetch_holidays.py --year 2026 --force
- The script will ignore the local cache and re-fetch data from the government website
Expected output:
bash
$ 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 festival
User says: "How many days off for the Spring Festival in 2026?"
Operation:
- Confirm the year: 2026
- Run the script to obtain data
- Extract Spring Festival related information from the returned content
Output example:
2026 年春节放假安排:
2 月 15 日(农历腊月二十八、周日)至 23 日(农历正月初七、周一)放假调休,共 9 天。
2 月 14 日(周六)、2 月 28 日(周六)上班。
Example 5: Compare holiday arrangements of two years
User says: "Compare the differences between the Spring Festival holidays in 2025 and 2026"
Operation:
- Obtain holiday data for the two years respectively
- Run:
python scripts/fetch_holidays.py --year 2025
and python scripts/fetch_holidays.py --year 2026
- 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 arrangements in JSON format"
Operation:
- Run the script to obtain data
- Organize and output according to the JSON format required by the user
Output example:
json
{
"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 phenomenon: The script returns "No relevant holiday notice found" or "Search result is empty"
Possible reasons:
- The holiday notice for this year has not been released yet (usually the next year's arrangement is released in November-December of the previous year)
- Network connection problem
Agent processing method:
- If querying a future year, prompt the user that the notice for that year has not been released yet
- Suggest users to query published years (such as the current year or the previous year)
- If it is a network problem, explain the situation to the user and suggest trying again later
Online acquisition failed
Error phenomenon: The script exits and shows that the network request failed
Possible reasons:
- Unstable network connection
- The interface parameters of the government website have changed
Agent processing method:
- Check the network connection and try again once
- If it still fails, explain to the user that "the government website data is temporarily unavailable"
- Suggest users to use cached data (remove the parameter) or try again later
- If the user needs, you can tell the user to directly visit the government website to view
Content parsing failed
Error phenomenon: The URL is obtained but valid content cannot be extracted
Agent processing method:
- Explain to the user that "content parsing failed"
- Provide the original URL to the user for manual access
- Suggest the user to try again later
Cache data does not exist
Error phenomenon: No local cache and online acquisition failed
Agent processing method:
- Explain to the user that the data for this year is temporarily unavailable
- Suggest users to query other years
- Or suggest users to try again later
General processing principles:
- Clearly explain the cause and suggestions to the user for any error
- Prioritize trying to use cached data
- Suggest users to try again later for network problems
- Provide alternative solutions (such as querying other years, visiting the government website)
Technical Description
- Data source: Notice of the General Office of the State Council officially released by the official website of the Chinese government (www.gov.cn)
- Data authority: From the State Council Gazette, with official effect
- Update frequency: Usually the next year's arrangement is released in November-December every year
- Cache strategy: Local cache first, reduce network requests, improve response speed
Cache Mechanism
The script adopts a cache-first strategy:
- Prioritize reading local cache: Check whether exists
- Cache hit: Return cached data directly (millisecond-level response, no network required)
- Cache miss: Automatically fetch data from the government website and cache it locally
Agent processing suggestions:
- Use cached data directly by default
- When the user expresses intentions such as "re-fetch", "refresh data", "check the latest from the Internet", it should be understood that the latest data needs to be forcibly obtained from the network
- The cache file is located at , and will be automatically updated after the new data is released every year
Tips
- Cache strategy: The script prioritizes using local cache for faster response
- Release time: The General Office of the State Council usually releases the next year's holiday arrangement in November-December every year
- Refresh data: When the user requests "re-fetch" or "refresh", the latest data should be forcibly obtained from the network
- Default year: When the user does not specify the year, take the initiative to ask or use the current year
- Offline use: Years with existing cache can be queried completely offline
- Data authority: All data comes from the official website of the Chinese government (www.gov.cn), with official effect
- Cross-year comparison: Data of different years can be obtained respectively for comparative analysis
- Flexible format: Support output in different formats such as JSON, table, list according to user requirements
Notes
- Data timeliness: Only published years can be queried, and notices for future years need to wait for official release
- Official source: All data comes from official channels of the government website to ensure accuracy
- Work rescheduling arrangement: Be sure to include the description of the work rescheduling date when outputting, which is convenient for users to arrange work