# Holiday Calendar API

Official public holidays per European country — dates, local names and type, each country's full holiday list included. Backed by the same Nager.Date / OpenHolidaysAPI service (7-day cache, locally-computed Kosovo calendar) that powers the nakordoni.eu holiday calendar page and the prediction system's calendar factors. One country -> a flat object; several -> the same shape wrapped in a list. upcoming=1 switches to a flat, date-sorted cross-country feed; compare_to switches to a same-vs-different comparison across countries — useful for checking whether a date is a holiday on both sides of a border crossing or just one.

**Endpoint:** `GET /api/v1/data/holiday-calendar`
**Quota class:** cheap — 1000/day (Explorer), 50000/day (PAYG)

---

## Parameters

| Name | Description |
|------|-------------|
| `country` | ISO-2 country code, or comma-separated list of up to 15, e.g. PL or PL,DE,UA. Omit for the default core set (UA,PL,SK,HU,RO,MD,DE,CZ,BG,AT). One resolved country returns a flat object; several return a list. |
| `compare_to` | ISO-2 country code, or comma-separated list, to compare against `country`. Switches to compare mode: returns which holiday dates are shared by ALL selected countries (`same`) vs only some of them (`different`, with per-date in/not_in lists) |
| `year` | YYYY (default: current year) |
| `upcoming` | 1 = switch to a flat, date-sorted list of upcoming holidays across the selected countries within `days` (optional) |
| `days` | Horizon in days for upcoming mode, 1-180. Omitted or 0 = no limit (everything the underlying service can see: this year + next) |
| `lang` | Language(s) for the localized `name` field (default en) — same translator as the nakordoni.eu holiday calendar page (25 site languages plus hr, nl, pt). Falls back to the local/English name for anything not yet cached; for hr, nl, pt a foreign holiday falls back to English. Comma-separated for several, up to 10, e.g. lang=en,uk,pl — `name` stays the first requested language; every holiday also gets a `names` object keyed by language code with all of them. |


## Example

```bash
curl "https://nakordoni.eu/api/v1/data/holiday-calendar?country=PL&compare_to=UA&year=2026&lang=en" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Response fields

Inside the `data` object of the envelope. A field is `null`, absent or an empty list when we hold no value for it — never a placeholder.

| Field | Description |
|-------|-------------|
| `data.countries` | The countries compared — the one you asked about and compare_to. |
| `data.same[]` | Days that are a public holiday in BOTH countries: date, weekday, names (one per country). |
| `data.different[]` | Days that are a holiday in one country only: date, weekday, in (where it applies), not_in, names. These are the border-traffic days that catch drivers out. |
| `data.same_count` | Size of same, with different_count for different. |
| `data.window` | Period covered, inside data.year. |
| `data.mode` | Single-country listing or two-country comparison. |


## Response envelope

```json
{
  "ok": true,
  "api_version": "1",
  "product": "holiday-calendar",
  "attribution": "Data by nakordoni.eu",
  "data": [ ... ]
}
```

---

Full docs: https://nakordoni.eu/en/developers/docs#holiday-calendar
*Auto-generated 2026-12-05 — regenerate: `sudo -u www-data php /var/www/html/helpers/push_github_docs.php`*