返回仪表板

API 文档

用于将流行病学周计算集成到您的应用程序中的公共 API。

基础 URL

https://epiweek.com/api/v1

所有端点支持 CORS 并返回 JSON 响应。

GET /api/v1/now

获取当前流行病学周。

查询参数

  • standard (可选)- MMWR 或 ISO。默认为 MMWR
  • date (可选)- YYYY-MM-DD 格式的日期。默认为今天

请求示例

curl https://epiweek.com/api/v1/now?standard=MMWR

响应示例

{
  "week": 1,
  "year": 2026,
  "startDate": "2026-01-04T00:00:00.000Z",
  "endDate": "2026-01-10T00:00:00.000Z",
  "standard": "MMWR"
}

GET /api/v1/convert

将特定日期转换为其流行病学周。

查询参数

  • date (必需)- YYYY-MM-DD 格式的日期
  • standard (可选)- MMWR 或 ISO。默认为 MMWR

请求示例

curl "https://epiweek.com/api/v1/convert?date=2025-12-25&standard=ISO"

响应示例

{
  "week": 52,
  "year": 2025,
  "startDate": "2025-12-22T00:00:00.000Z",
  "endDate": "2025-12-28T00:00:00.000Z",
  "standard": "ISO"
}

GET /api/v1/calendar/[year]

获取特定年份的所有流行病学周。

路径参数

  • year (必需)- 1900-2100 之间的年份

查询参数

  • standard (可选)- MMWR 或 ISO。默认为 MMWR

请求示例

curl https://epiweek.com/api/v1/calendar/2026

响应示例

{
  "year": 2026,
  "standard": "MMWR",
  "totalWeeks": 52,
  "weeks": [
    {
      "week": 1,
      "year": 2026,
      "startDate": "2026-01-04",
      "endDate": "2026-01-10",
      "standard": "MMWR"
    }
  ]
}

日历订阅

在您的日历应用中订阅流行病学周。

订阅 URL

https://epiweek.com/calendar.ics

将此 URL 添加到 Google 日历、Apple 日历或 Outlook 以自动查看流行病学周。

下载 .ics 文件

速率限制

API 请求限制为每个 IP 地址每分钟 100 次请求。如需更高限制,请联系我们: [enable JavaScript].