# Business Days & Public Holidays (200+ countries) (`finaldynamics/business-days-calculator-api`) Actor

Business days calculator and public holiday API for 200+ countries: working days between dates, add business days, SLA deadlines and holiday lists.

- **URL**: https://apify.com/finaldynamics/business-days-calculator-api.md
- **Developed by:** [Final Dynamics](https://apify.com/finaldynamics) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 result item (one holiday or one calculation)s

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

## Business Days & Public Holidays (200+ countries)

A business days calculator and public holiday API for more than 200 countries, with
regional calendars (US states, German Länder, Australian states, Canadian provinces and
more). Ask it which holidays fall in a year, how many working days sit between two dates,
what date is N working days from now, or when an SLA clock runs out.

Useful for invoice due dates, delivery promises, SLA tracking, payroll and scheduling, and
for filling a spreadsheet with a country's holidays without maintaining the list yourself.

### What you get

One row per holiday or per calculation, depending on `mode`.

| Mode                  | Answers                                          | Row example                                                                            |
| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------- |
| `holidays`            | Which public holidays fall in a country and year | `2026-02-16`, `Washington's Birthday`, local name `Presidents Day`, types `["public"]` |
| `businessDaysBetween` | Working days between two dates                   | `2026-01-01` to `2026-03-31`: 89 days, 60 business days, 26 weekend days, 3 holidays   |
| `addBusinessDays`     | The date N working days after (or before) a date | `2026-12-24` + 5 = `2027-01-04`, skipping 4 weekend days and 2 holidays                |
| `sla`                 | When a deadline expires in working days or hours | start `2027-03-25T16:40+01:00`, 2 working hours, deadline `2027-03-30T10:40+01:00`     |

Weekends and public holidays are excluded from every calculation. Every row carries
`country` and `region`.

### How to use it

**Holidays for a few countries:**

```json
{
  "mode": "holidays",
  "countries": ["US", "FR", "DE"],
  "years": [2026, 2027]
}
```

Add `"language": "fr"` for localised names, or `"types": ["public"]` to keep only public
holidays.

**Working days between dates:**

```json
{
  "mode": "businessDaysBetween",
  "countries": ["US", "DE"],
  "ranges": [{ "start": "2026-01-01", "end": "2026-03-31" }]
}
```

**Add working days (negative counts backwards):**

```json
{
  "mode": "addBusinessDays",
  "countries": ["US", "GB"],
  "dates": ["2026-12-24"],
  "days": 5
}
```

**SLA deadline in working hours:**

```json
{
  "mode": "sla",
  "countries": ["DE"],
  "region": "DE-BY",
  "starts": ["2026-12-23T09:00:00Z"],
  "offset": 8,
  "unit": "hours",
  "dayStart": "08:00",
  "dayEnd": "16:00"
}
```

Start times need a `Z` or a numeric UTC offset. The working window defaults to 09:00 to
17:00.

**Regional calendars:** set `region` to an ISO 3166-2 code such as `US-TX`, `DE-BY` or
`AU-NSW`. It applies to every country in the run, so use one country per run when you want
regional data.

### Quick start

No code needed; about two minutes from input to spreadsheet. For a longer walkthrough with
example output, read the guide
[Build a holiday calendar and calculate working dates](https://finaldynamics.com/business-days-guide.html).

1. Open the example "US public holidays 2026 and 2027" on this actor's page, or paste one
   of the inputs above into the input form.
2. Click **Start** and wait until the run shows **Succeeded**.
3. Open the **Output** tab to see the holidays as a table.
4. Click **Export**, choose CSV or Excel, and download the file.
5. In Google Sheets, choose **File > Import > Upload** and select the file.

### Automate it

**A holiday sheet that stays current:** save the countries and years you need in a task.
Click **Save as a new task**, then add a schedule for that task under **Schedules** in
Apify Console (for example every Monday at 07:00). Run it once a month or once a quarter;
governments add and move holidays during the year, and each run returns the current
calendar.

**Into Google Sheets with n8n:** add the **Apify** node with the **On new Apify Event**
trigger, choose your task and the succeeded event, then add an **Apify** node with **Get
Dataset Items** using the run's `defaultDatasetId`, and finish with a **Google Sheets**
node that appends the rows. Every scheduled run then adds its holidays to the same sheet.
Make and Zapier have Apify integrations that work the same way.

### Pricing

$0.002 per row: one holiday, or one calculation. There are no platform usage charges on
top. A year of US holidays is about $0.02; holidays for 50 countries for two years is
about $2. `maxItems` (default 10,000) caps a run.

### Coverage and data

Holiday data covers more than 200 countries, with regional subdivisions where countries
publish them. Data for India, Thailand, Malaysia, Trinidad and Tobago, and the Cayman
Islands is marked partial upstream: holidays set by lunar calendars or announced by decree
may be missing. Check an official source before relying on those for compliance or
contractual deadlines.

Data comes from [Nager.Date](https://github.com/nager/Nager.Date) (MIT) and
[date-holidays](https://github.com/commenthol/date-holidays) (ISC; holiday definitions
CC-BY-3.0), served through the Business Days & Holidays API. The same API is available
directly on RapidAPI if you would rather call it from your own code.

### FAQ

**How do I calculate business days between two dates?**

Set `mode` to `businessDaysBetween`, give the country and both dates. The row shows total
days, business days, weekend days and holidays in between.

**How do I add business days to a date?**

Use `addBusinessDays` with a start date and a number of days (negative to count back).
Weekends and the country's public holidays are skipped.

**Which public holidays 2027 calendars are included?**

Every country the data covers, for any year you ask, with regional calendars where
countries publish them, such as US states and German Länder.

Questions or a missing holiday? Open an issue on the actor page with the country and date.

# Actor input Schema

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

Which calculation to run.

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

Two-letter ISO 3166-1 country codes, for example US, GB, DE.

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

Calendar years from 2000 through 2060. Defaults to the current year. Duplicate years are ignored.

## `types` (type: `array`):

Filter to these holiday types, for example public, bank, optional, observance. Leave empty for all types.

## `language` (type: `string`):

Two-letter language code for localised holiday names, for example fr or de.

## `ranges` (type: `array`):

List of {"start": "YYYY-MM-DD", "end": "YYYY-MM-DD"} objects.

## `dates` (type: `array`):

Dates in YYYY-MM-DD form to shift forward or backward.

## `days` (type: `integer`):

Non-zero number of business days to add. Use a negative value to move backwards.

## `starts` (type: `array`):

ISO 8601 date-times, for example 2026-01-05T09:00:00Z.

## `offset` (type: `integer`):

How many units of working time the SLA allows.

## `unit` (type: `string`):

Whether the offset is counted in business days or business hours.

## `dayStart` (type: `string`):

Start of the working day as HH:MM. Defaults to 09:00 and must be before the end.

## `dayEnd` (type: `string`):

End of the working day as HH:MM. Defaults to 17:00.

## `region` (type: `string`):

Optional ISO 3166-2 subdivision code, for example US-TX or DE-BY. Applies to every country in the run.

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

The most rows one run delivers. The run stops after the current batch when it reaches this limit or your spending limit. One run can make at most 10,000 calculations.

## Actor input object example

```json
{
  "mode": "holidays",
  "countries": [
    "US",
    "GB",
    "DE"
  ],
  "years": [
    2026
  ],
  "ranges": [
    {
      "start": "2026-01-01",
      "end": "2026-03-31"
    }
  ],
  "days": 5,
  "offset": 2,
  "unit": "days",
  "maxItems": 10000
}
```

# Actor output Schema

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

Crawled data stored in default dataset

## `files` (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 = {
    "countries": [
        "US",
        "GB",
        "DE"
    ],
    "years": [
        2026
    ],
    "ranges": [
        {
            "start": "2026-01-01",
            "end": "2026-03-31"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("finaldynamics/business-days-calculator-api").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 = {
    "countries": [
        "US",
        "GB",
        "DE",
    ],
    "years": [2026],
    "ranges": [{
            "start": "2026-01-01",
            "end": "2026-03-31",
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("finaldynamics/business-days-calculator-api").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 '{
  "countries": [
    "US",
    "GB",
    "DE"
  ],
  "years": [
    2026
  ],
  "ranges": [
    {
      "start": "2026-01-01",
      "end": "2026-03-31"
    }
  ]
}' |
apify call finaldynamics/business-days-calculator-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,finaldynamics/business-days-calculator-api"
        }
    }
}
```

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/aJb2AA1gXQwvCd1sx/builds/GrMEFAxnydo3t7w0K/openapi.json
