# Public Holidays Scraper (`parseforge/nager-public-holidays-scraper`) Actor

Scrapes public holidays by country and year, available countries, upcoming holidays, or long weekends. Returns each holiday as a flat row with date, local name, English name, and county codes.

- **URL**: https://apify.com/parseforge/nager-public-holidays-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Automation, Travel, Other
- **Stats:** 2 total users, 1 monthly users, 89.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $19.00 / 1,000 result items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### Public Holidays Scraper

**Scrape public holidays for any country and year, or the next 365 days, from Nager.Date.** Each holiday comes with its date, local name, English name, and county-level detail. No API key. Export to CSV, JSON, Excel, or XML.

Nager.Date's public API is rate-limited and needs a key for heavy use. This reads the public holiday feeds directly, filtered by country, year, and sub-country region, and returns each match in one fixed schema.

| Who uses it | What they scrape Nager.Date for |
|---|---|
| HR and payroll teams | Build accurate leave and payroll calendars for every office location |
| Travel and booking platforms | Forecast demand spikes around national holidays in destination countries |
| Market researchers | Compare how many public holidays each country grants its workforce |
| Event planners | Avoid scheduling launches or conferences on a local public holiday |
| Data analysts | Enrich dashboards with holiday flags for time-series forecasting |

### What it does

This Actor collects public holidays from Nager.Date by country, year, or upcoming 365-day window, and returns each holiday as a flat row.

- 🌍 **Four export modes:** public holidays by year and country, the full country list, the next 365 days, and long-weekend bridges.
- 🗓️ **Year range 1975 to 2100:** query historical holidays or plan decades ahead.
- 📍 **County-level filtering:** pass ISO 3166-2 codes like US-CA or CA-ON to keep only regional holidays.
- 🔁 **Multi-country runs:** feed up to 100 country codes in one run and get one combined dataset.
- 📦 **Flat row output:** every holiday is one record with date, names, and county scope, ready for CSV or JSON.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with Nager.Date data

**📅 Build a global HR calendar.**

An HR team runs the Actor for all office countries and the current year, then imports the CSV into their payroll system to block leave on public holidays.

**✈️ Forecast travel demand.**

A booking platform pulls the next 365 days of holidays for top destinations and feeds the dates into a pricing model to raise rates on peak days.

**📊 Compare holiday counts by country.**

A researcher runs the countries mode to get the full list, then queries holidays mode for each country and year to build a comparison table.

**🏖️ Plan long weekends.**

An employee uses the longWeekends mode for their country and year to find all bridge days and plan vacation with minimal leave days.

**📈 Enrich time-series data.**

A data analyst adds holiday flags to daily sales data by running the Actor for the relevant country and years, then joining on date.

### Why choose this scraper

| | What you get |
|---|---|
| **No API key** | Reads the public Nager.Date feeds directly, no registration or rate-limit headaches |
| **Global coverage** | Supports 100+ countries and territories with ISO 3166-1 alpha-2 codes |
| **County detail** | Optional ISO 3166-2 filter returns only holidays observed in a specific state or province |
| **Long-weekend mode** | Finds bridges between public holidays and weekends for leave planning |
| **Upcoming mode** | Pulls the next 365 days of holidays for any country in one run |

### How it compares

No other Store actor targets Nager.Date the same way, so the honest comparison is with the alternatives teams actually weigh.

| | Public Holidays Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When Nager.Date changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |

### Configure the run

Drive the Actor from country codes, years, and optional sub-country codes, and filters run as each holiday is read so only matches reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
 "maxItems": 10,
 "mode": "holidays",
 "countries": [
 "US"
 ],
 "years": [
 "2025"
 ]
}
```

A larger pull:

```json
{
 "maxItems": 200,
 "mode": "holidays",
 "countries": [
 "US"
 ],
 "years": [
 "2025"
 ]
}
```

### Pricing

Pay-per-result: **$0.021 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $2.10 |
| 1,000 results | $21.00 |
| 10,000 results | $210.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [Public Holidays Scraper](https://apify.com/parseforge/nager-public-holidays-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to Nager.Date through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/nager-public-holidays-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check that you selected the correct mode and provided the required inputs. For holidays, upcoming, and longWeekends modes you must pass at least one country code. For holidays and longWeekends, also pass a year or leave it empty for the current year.

**Why are county filters not working?**

Make sure you are using valid ISO 3166-2 codes like US-CA or CA-ON. The filter matches against the holiday's counties field, so if a holiday is nationwide it may not appear when you filter by a specific county.

**Why did I get holidays for the wrong year?**

If you leave the years field empty, the Actor defaults to the current year. Pass an explicit year like 2025 to avoid confusion.

**Why does countries mode ignore my country codes?**

Countries mode returns the full list of available countries and ignores the countries input. Use holidays, upcoming, or longWeekends modes to query specific countries.

**Why is my run slow with many countries?**

The Actor processes each country sequentially. Reduce the number of countries or increase maxItems to speed up the run.

### FAQ

| Question | Answer |
|---|---|
| Do I need an API key for Nager.Date? | No. This Actor reads the public holiday feeds directly, so no key or registration is required. |
| Which countries are supported? | The Actor supports over 100 countries and territories. Use the countries mode to get the full list with ISO 3166-1 alpha-2 codes. |
| Can I get holidays for multiple countries in one run? | Yes. Pass an array of country codes in the countries input field and the Actor returns one combined dataset. |
| What is the difference between holidays and upcoming modes? | Holidays mode returns public holidays for a specific year and country. Upcoming mode returns the next 365 days of holidays from today for the given country. |
| How do I filter by state or province? | Use the counties input with ISO 3166-2 codes like US-CA or CA-ON. The Actor keeps only holidays whose county field contains at least one of those codes. |
| What years can I query? | The supported range is 1975 to 2100. If you leave years empty, the Actor defaults to the current year. |
| What does longWeekends mode return? | It returns public holidays that create a long weekend, typically a Friday or Monday adjacent to a weekend, for the given country and year. |
| What output formats are available? | The Actor exports to CSV, JSON, Excel, and XML. You can choose the format when you run it on Apify. |
| Is there a limit on how many holidays I can scrape? | You can set maxItems up to 1,000,000 per run. The default is 10. |
| Does the Actor include local holiday names? | Yes. Each holiday row includes the local name and the English name, plus the date and county scope. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Nager.Date. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `maxItems` (type: `integer`):

How many holidays to collect per run.

## `mode` (type: `string`):

What to export. Public holidays for a year, the list of available countries, the next 365 days of holidays for a country, or long-weekend bridges.

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

ISO 3166-1 alpha-2 country codes. Required for holidays, upcoming, and longWeekends modes. Ignored for countries mode.

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

Years to query for holidays / longWeekends modes. Range supported: 1975 - 2100. Defaults to the current year if empty.

## `counties` (type: `array`):

Optional ISO 3166-2 sub-country codes (e.g. US-CA, US-NY, CA-ON). When set, holidays are filtered to those whose 'counties' field contains at least one of these. Leave empty for nationwide-only.

## Actor input object example

```json
{
  "maxItems": 10,
  "mode": "holidays",
  "countries": [
    "US"
  ],
  "years": [
    "2025"
  ]
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "maxItems": 10,
    "mode": "holidays",
    "countries": [
        "US"
    ],
    "years": [
        "2025"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/nager-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 = {
    "maxItems": 10,
    "mode": "holidays",
    "countries": ["US"],
    "years": ["2025"],
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/nager-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 '{
  "maxItems": 10,
  "mode": "holidays",
  "countries": [
    "US"
  ],
  "years": [
    "2025"
  ]
}' |
apify call parseforge/nager-public-holidays-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/nager-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/fo3QbNyttlgchg1dm/builds/CYiq38KLf1xi7g5Wd/openapi.json
