← FetchFromMath API

API Documentation

Base URL: https://api.fetchfrommath.com · Version: /api/v1. 当前无需认证;匿名限流为每 IP 每分钟 60 次。所有日期使用 YYYY-MM-DD,JSON 字段使用 snake_case。

Response / errors

{"success":true,"data":{...}}
{"success":false,"error":{"code":"INVALID_DATE","message":"..."}}

无效参数返回 422;未加载年份或范围数据返回 404;超限返回 429。GET 响应可缓存 1 小时。

Endpoints

Examples

curl https://api.fetchfrommath.com/api/v1/calendar/2026-10-01
fetch('/api/v1/workdays/count?from=2026-09-01&to=2026-09-30').then(r=>r.json())
$response = file_get_contents('https://api.fetchfrommath.com/api/v1/holidays/2026');

Data and adjustment rules

2026 数据来自国务院办公厅关于2026年部分节假日安排的通知(国办发明电〔2025〕7号,2025-11-04)。日历保存全年每一天:周一至周五默认工作日、周末默认休息,通知的放假和补班日期覆盖默认规则。CORS 对公开只读 GET API 使用 *,不允许跨域凭证。