# Public Holidays Scraper - 200+ Countries, Any Year (`eliai/public-holidays-scraper`) Actor

Public holidays for 200+ countries and any year from 1975 to 2075: date, weekday, weekend flag, local and English names, nationwide vs regional with the subdivision list. Bulk countries and years. $0.002 per holiday.

- **URL**: https://apify.com/eliai/public-holidays-scraper.md
- **Developed by:** [Broke to Built](https://apify.com/eliai) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 holidays scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Public Holidays Scraper — 200+ Countries, Any Year

Public holidays for **over 200 countries** and any year from **1975 to 2075**: the date, the
weekday, a weekend flag, the **local and English names**, and whether it is nationwide or
restricted to particular regions.

No API key, no account. **$0.002 per holiday** — a country/year pair with no holidays is recorded
and **not charged**.

### Input

```json
{ "country": "US", "year": 2026 }
```

Every country against every year, in one run:

```json
{ "countries": ["US", "DE", "JP", "GB"], "years": [2026, 2027] }
```

| Field | Type | Notes |
|---|---|---|
| `country` | string | ISO 3166-1 alpha-2 — `US`, `DE`, `JP`. |
| `countries` | string\[] | Bulk. Over 200 supported. |
| `year` | integer | 1975–2075. Defaults to the current year. |
| `years` | integer\[] | Bulk. Every country is fetched for every year. |

### Output

```json
{
  "ok": true,
  "country": "US",
  "countryName": "United States",
  "year": 2026,
  "date": "2026-07-03",
  "weekday": "Friday",
  "isWeekend": false,
  "localName": "Independence Day",
  "name": "Independence Day",
  "global": true,
  "counties": null,
  "fixed": false,
  "launchYear": null,
  "types": ["Public"]
}
```

### What it gets right

- ⭐ **Duplicates are merged before you are billed.** The upstream source genuinely repeats
  holidays — US 2026 returns **Good Friday twice** and **Columbus Day twice**, once nationwide and
  once regional. Passing that through would charge you twice for one holiday. Rows are
  de-duplicated by date and name, keeping the nationwide record and **merging the county lists**
  so no regional detail is lost.
- **Observed dates are real dates.** Independence Day 2026 falls on a Saturday, so the US observes
  it on Friday **2026-07-03** — and that is what you get. This reports the calendar as observed,
  not an idealised one.
- **`weekday` and `isWeekend` are computed in UTC** and asserted to agree with the date, so they
  cannot drift into decoration. They are the two fields every planner derives by hand.
- **Regional holidays keep their subdivisions.** `global: false` always comes with a `counties`
  list, so a nationwide planner never mistakes a state holiday for a federal one.
- **`localName` is the local language** — `Tag der Deutschen Einheit`, not a translation — with the
  English `name` alongside.

### Pricing

**$0.002 per holiday returned.** A full year for one country is about 17 rows — roughly 3 cents.
An unsupported country code produces an `ok: false` record and **is not charged**.

### Limits

- 200 country × year combinations per run.
- 1975–2075. Outside that range the input is rejected rather than silently returning nothing.
- Public/bank holidays. Not observances, school terms or religious calendars beyond those a
  country designates public.
- Historic years reflect today's best record, not contemporaneous law.

### FAQ

**Do I need an API key?** No.

**Why is Independence Day on the 3rd?** Because that is the day it is observed in 2026. See above.

**Which countries?** Over 200, ISO alpha-2. An unsupported code returns a clear error.

### Changelog

- **0.1 (2026-09-10)** — first release. Country × year cross product, upstream duplicate merging,
  derived weekday/weekend, regional subdivisions preserved.

# Actor input Schema

## `country` (type: `string`):

ISO 3166-1 alpha-2 country code, e.g. US, DE, JP, GB.

## `countries` (type: `array`):

Several countries in one run, e.g. US, DE, JP. Over 200 are supported.

## `year` (type: `integer`):

Calendar year between 1975 and 2075. Defaults to the current year.

## `years` (type: `array`):

Several years in one run. Every country is fetched for every year.

## Actor input object example

```json
{
  "country": "US",
  "countries": [],
  "years": []
}
```

# Actor output Schema

## `results` (type: `string`):

Every item this run produced, as JSON.

## `resultsCsv` (type: `string`):

The same items as a spreadsheet-ready CSV.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "country": "US",
    "countries": [],
    "years": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("eliai/public-holidays-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "country": "US",
    "countries": [],
    "years": [],
}

# Run the Actor and wait for it to finish
run = client.actor("eliai/public-holidays-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "country": "US",
  "countries": [],
  "years": []
}' |
apify call eliai/public-holidays-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,eliai/public-holidays-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/qBVJuuU11ej4MkbB7/builds/gWk1KnsYLaBPbhYGc/openapi.json
