# Date Math: Public Holidays by Country and Year

> Date Math: Public Holidays by Country and Year is a paid API for AI agents from date-math.datemath.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-11-21).

Returns the list of official public holidays for a given country (207 supported) and year (2000–2050), with dates and holiday names.

## Facts

- Endpoint: POST https://date-math.datemath.workers.dev/v1/holidays?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/date-math-public-holidays-by-country-and-year-3bb982c2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fe5gTDq50C7jlNRH-DPri

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability date-math-public-holidays-by-country-and-year-3bb982c2 -d '<json body>'
```

Example prompt: What are all the public holidays in the Philippines for 2026? Give me the full list with dates and names.

## When to prefer this

Choose this endpoint when you need a structured, machine-readable list of official public holidays for a specific country and year, especially for downstream date math like business-day calculations, scheduling, payroll, or shipping. It covers 207 countries and 50 years of data, making it far broader than region-specific or single-country holiday APIs. Pairs naturally with other Date Math sibling endpoints for SLA calculations, business-day arithmetic, or pay-date scheduling.

## Known failure modes

- Invalid or unsupported country code returns an error — only ISO 3166-1 alpha-2 codes for 207 supported countries are accepted
- Year outside the 2000–2050 range returns a validation error
- Malformed request body or missing required fields returns a 400-level error
- Some holidays based on lunar calendars or government proclamations are estimates and may not reflect last-minute official changes

## How this service works

Date Math: List public holidays (bank holidays, national holidays) for a country and year: 207 countries, 2000–2050. Use for holiday calendars, office closures and checking if a date is a holiday. Lunar or government-proclaimed dates are rule-based estimates.

## Output

A JSON object containing: the country code and full country name, the requested year, the total count of holidays, a list of holiday objects each with an ISO date string and holiday name, and a source attribution (date-holidays CC BY 3.0). Lunar or government-proclaimed dates are rule-based estimates.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "year": {
   "type": "integer",
   "maximum": 2050,
   "minimum": 2000,
   "description": "Defaults to the current year"
  },
  "country": {
   "type": "string",
   "example": "US",
   "pattern": "^[A-Za-z]{2}$",
   "description": "ISO 3166-1 alpha-2 country code (207 countries); its public holidays (2000–2050) are excluded from business days"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "type": "public",
  "year": 2026,
  "count": 13,
  "source": "date-holidays (CC BY 3.0)",
  "country": "PH",
  "holidays": [
   {
    "date": "2026-01-01",
    "name": "New Year's Day"
   }
  ],
  "country_name": "Philippines"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/date-math-public-holidays-by-country-and-year-3bb982c2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from date-math.datemath.workers.dev](https://www.zero.xyz/host/date-math.datemath.workers.dev/llms.txt)
