# US & Puerto Rico Holidays + Business Days API (`jbstudio/openday-api`) Actor

Official US federal, state (50 + DC) and Puerto Rico holidays with business-day math, Federal Reserve bank days, and Spanish names. Every date cites its legal source. Pay only for successful requests.

- **URL**: https://apify.com/jbstudio/openday-api.md
- **Developed by:** [JB Studio](https://apify.com/jbstudio) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 api requests

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## OpenDay API by JB Studio: US & Puerto Rico Holidays + Business Days

**Every holiday and business day for the US and Puerto Rico, from the official sources.**

OpenDay API answers "is it a business day?" and "what date is N business days from now?" for US federal, all 50 states + DC, Federal Reserve bank days and Puerto Rico, with every date tied to the law or official calendar it comes from.

### What you can build

- **Payroll dates.** Move a payday that falls on a holiday to the right business day, using the state-employee calendar for each state, or Puerto Rico's government calendar (with its Sunday-to-Monday rule).
  *Example:* July 4, 2027 is a Sunday. In Puerto Rico it is observed on Monday, July 5, so `is-business-day` for `2027-07-05` and region `PR` returns `false`.
- **ACH and bank settlement.** Bank transfers follow the Federal Reserve calendar, where a Saturday holiday is not moved to Friday. Use `calendar=banking`.
  *Example:* Friday, July 3, 2026 is a federal day off, but a banking business day.
- **Delivery estimates.** "Arrives in 10 business days" from any start date, skipping weekends and holidays.
  *Example:* 10 business days after December 20, 2027 is January 5, 2028 on the federal calendar, and January 3, 2028 on the banking calendar.
- **Legal and contract deadlines.** "Within 10 business days" for a specific state or for Puerto Rico, counting only the days that state's offices are open.
  *Example:* count business days between two dates in `US-TX`, where weekend holidays are never moved to a weekday.
- **Puerto Rico addresses and sales tax.** Find the municipio of a ZIP code, list all 78 municipios, and get IVU rates with their legal citations.
  *Example:* ZIP `00680` is 94% in Mayagüez (primary), with small parts in San Germán and Añasco.

### Why OpenDay

- **Every date cites its official law or calendar**, with a link and a source type (`official` or `secondary-copy`).
- **Puerto Rico done right:** three calendars (legal, government, banking), the Sunday-to-Monday rule, and the yearly government memo.
- **All 50 states + DC**, using each state's own state-employee calendar and weekend rule.
- **Bank days, not just holidays:** Federal Reserve rules.
- **Bilingual:** every holiday has English and Spanish names.
- **Puerto Rico toolkit:** municipios, ZIP code lookup and IVU rates from the Census Bureau and the Puerto Rico tax code.
- **Honest data:** every year is labeled `official`, `computed` or `projected`.

### Coverage

| Region                                          | Calendars                                                           | Years     | Verification                                                                                                                 |
| ----------------------------------------------- | ------------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------- |
| US federal (`US`)                               | `federal` (default): 11 federal holidays; optional Inauguration Day | 2000-2100 | 2026 and 2027 `official` (checked against the federal holiday calendar); other years `computed` from 5 U.S.C. 6103           |
| US banking (`US`, `calendar=banking`)           | Federal Reserve holiday schedule                                    | 2000-2100 | `computed` from the Federal Reserve rules                                                                                    |
| 50 states + DC (`US-CA`, `US-TX`, ..., `US-DC`) | `state` (default): state-employee holidays; `banking`               | 2026-2100 | 2026: 35 `official`, 16 `computed`. 2027: 16 `official`, 26 `computed`, 9 `projected`. Later years `computed` or `projected` |
| Puerto Rico (`PR`)                              | `government` (default), `legal`, `banking`                          | 2000-2100 | `government` 2027 `official` (OATRH memo); other years and calendars `computed`                                              |
| Puerto Rico toolkit (`/v1/pr/...`)              | 78 municipios, 132 ZIP codes, IVU rates                             | Current   | `official` (Census 2020; Código de Rentas Internas de 2011)                                                                  |

The `regions` endpoint lists every region, its calendars, supported years and the verification status for each year.

### How to use it

#### Standby (HTTP API)

Call the Actor's Standby URL with your API token. The endpoints are the same as the REST API:

| Endpoint                                                                     | Purpose                                                           |
| ---------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| `GET /v1/holidays?country=PR&year=2027`                                      | Holidays for a year (`calendar`, `dateBasis`, `include` optional) |
| `GET /v1/is-business-day?date=2027-07-05&region=PR`                          | Is this date a business day?                                      |
| `GET /v1/business-days/add?start=2027-12-20&days=10&region=US`               | Add or subtract business days                                     |
| `GET /v1/business-days/between?start=2027-01-01&end=2027-01-31&region=US-TX` | Count business days between two dates                             |
| `GET /v1/regions`                                                            | Supported regions, calendars, years and sources                   |
| `GET /v1/pr/municipios`, `GET /v1/pr/municipios/{id}`                        | Puerto Rico municipios                                            |
| `GET /v1/pr/zip/00680`                                                       | Municipio(s) of a Puerto Rico ZIP code                            |
| `GET /v1/pr/ivu`                                                             | IVU sales and use tax rates with citations                        |

```
GET https://<your-standby-url>/v1/is-business-day?date=2027-07-05&region=PR
Authorization: Bearer <YOUR_API_TOKEN>
```

```json
{
  "data": {
    "date": "2027-07-05",
    "region": "PR",
    "calendar": "government",
    "isBusinessDay": false,
    "reason": "holiday",
    "dayOfWeek": 1,
    "holidays": [
      {
        "id": "independence-day",
        "date": "2027-07-04",
        "observedDate": "2027-07-05",
        "nameEn": "US Independence Day",
        "nameEs": "Día de la Independencia de los Estados Unidos",
        "type": "legal",
        "source": "Ley 26-2017, Art. 2.05, as amended by Ley 8-2021 and Ley 117-2022; OATRH Memorando Especial 12-2026 (July 17, 2026)",
        "sourceUrl": "https://docs.pr.gov/files/OATRH/Contenido%20Nuevo/Memos/ME%2012-2026..pdf",
        "sourceType": "official"
      }
    ]
  },
  "meta": {
    "calendar": "government",
    "verificationStatus": "official",
    "note": "Confirm official proclamations."
  }
}
```

(Shortened. Full responses include every field, such as `scope`, `paidDayOff` and `meta.references`.)

Errors use one shape: `{ "error": { "code", "message", "details" } }`, for example `VALIDATION_ERROR` with a list of the parameters to fix.

#### Batch (run with input)

Send up to 1,000 requests in one run. Each request is an endpoint plus the same parameters as the HTTP API:

```json
{
  "requests": [
    { "endpoint": "holidays", "params": { "country": "PR", "year": 2027 } },
    { "endpoint": "is-business-day", "params": { "date": "2027-07-05", "region": "US" } },
    {
      "endpoint": "business-days/add",
      "params": { "start": "2027-12-20", "days": 10, "region": "US", "calendar": "banking" }
    }
  ]
}
```

Each request becomes one dataset item:

```json
{
  "endpoint": "business-days/add",
  "params": { "start": "2027-12-20", "days": 10, "region": "US", "calendar": "banking" },
  "ok": true,
  "summary": "2027-12-20 +10 business days = 2028-01-03",
  "data": {
    "start": "2027-12-20",
    "days": 10,
    "region": "US",
    "calendar": "banking",
    "result": "2028-01-03"
  },
  "meta": {
    "calendar": "banking",
    "verificationStatus": "computed",
    "note": "Confirm official proclamations."
  }
}
```

An invalid request returns `"ok": false` with the same error shape and does not stop the run.

### Puerto Rico toolkit

Reference data for Puerto Rico addresses and sales tax, from official sources only:

| Endpoint                     | Batch name      | What it returns                                                                                                    |
| ---------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------ |
| `GET /v1/pr/municipios`      | `pr/municipios` | All 78 municipios with code, official name (with accents), ASCII name and slug                                     |
| `GET /v1/pr/municipios/{id}` | `pr/municipio`  | One municipio by code (`72097`) or name (`Mayagüez`, `mayaguez`); accents and case do not matter                   |
| `GET /v1/pr/zip/{zip}`       | `pr/zip`        | Every municipio a ZIP code covers, with its land-area `share` and the `primary` one marked                         |
| `GET /v1/pr/ivu`             | `pr/ivu`        | IVU rates (state 10.5%, municipal 1%, total 11.5%, services 4%), each citing the Código de Rentas Internas section |

- **Address cleanup:** turn a ZIP code into the right municipio, even when the ZIP crosses municipio lines.
- **Forms and dropdowns:** the official names with accents, plus ASCII names and slugs for URLs.
- **Checkout and invoicing:** show the IVU rate together with the section of law behind it.

```
GET https://<your-standby-url>/v1/pr/zip/00680
Authorization: Bearer <YOUR_API_TOKEN>
```

```json
{
  "data": {
    "zip": "00680",
    "primary": {
      "code": "72097",
      "name": "Mayagüez",
      "nameAscii": "Mayaguez",
      "slug": "mayaguez",
      "share": 0.9415,
      "primary": true
    },
    "municipios": [
      {
        "code": "72097",
        "name": "Mayagüez",
        "nameAscii": "Mayaguez",
        "slug": "mayaguez",
        "share": 0.9415,
        "primary": true
      },
      {
        "code": "72125",
        "name": "San Germán",
        "nameAscii": "San German",
        "slug": "san-german",
        "share": 0.0343,
        "primary": false
      },
      {
        "code": "72011",
        "name": "Añasco",
        "nameAscii": "Anasco",
        "slug": "anasco",
        "share": 0.0241,
        "primary": false
      }
    ]
  },
  "meta": {
    "dataset": "pr-zip-municipios",
    "sourceUrl": "https://www2.census.gov/geo/docs/maps-data/data/rel2020/zcta520/tab20_zcta520_county20_natl.txt",
    "verificationStatus": "official",
    "verificationNote": "Based on 2020 Census ZIP Code Tabulation Areas (ZCTAs), which closely approximate USPS ZIP codes; ...",
    "note": "Confirm official proclamations."
  }
}
```

In a batch run: `{ "endpoint": "pr/zip", "params": { "zip": "00680" } }` gives the summary `ZIP 00680: Mayagüez 94%, San Germán 3%, Añasco 2%`.

Sources: US Census Bureau 2020 county FIPS codes and 2020 ZCTA to County relationship file; Código de Rentas Internas de Puerto Rico de 2011 (consolidated text from the Departamento de Hacienda). ZIP codes are matched with Census ZIP Code Tabulation Areas, which closely approximate USPS ZIP codes. The IVU data is general information, not tax advice.

### Sources and accuracy

- Every holiday includes `source` (the statute, regulation or official calendar), `sourceUrl` and `sourceType`. News sites are never used as a source.
- **`official`**: the dates were confirmed on the jurisdiction's own official calendar for that year.
- **`computed`**: calculated from statute or written policy.
- **`projected`**: the list is set each year (for example by a governor), or a practice shown on an official calendar is applied to later years. The note names the official year it is based on.
- Each response's `meta.verificationStatus` tells you which applies.
- **Known gaps:** county-level days (for example, Mardi Gras in some counties), bargaining-unit-only days, and days granted year by year without an official list are not included yet. In the Puerto Rico toolkit, PO box-only ZIP codes (no Census ZCTA) return 404, and IVU exemptions and special rates are not included.

Results come from law and published schedules and may differ from a specific year's proclamation or an employer's own schedule. Confirm official proclamations.

### Pricing

Pay per successful request. See the Pricing tab.

Errors, health checks and documentation requests are never charged.

### En español

**¿Es día laborable? La respuesta oficial para Puerto Rico y los 50 estados.**

- **Feriados de Puerto Rico correctos, con la ley citada en cada fecha.** Calendario legal, de gobierno y bancario, con la regla de domingo a lunes y el memorando anual de la OATRH.
- **Calendario de gobierno, banca y feriados legales, en un solo API.** También días bancarios de la Reserva Federal y los calendarios de empleados estatales de los 50 estados y DC.
- **Nombres en español** para cada feriado, y cálculo de días laborables: ¿qué fecha será dentro de 10 días laborables?
- **Herramientas de Puerto Rico:** los 78 municipios (con acentos), el municipio de cada código postal y las tasas del IVU con su cita legal. Fuentes: Censo 2020 y Departamento de Hacienda. Información general, no constituye asesoría contributiva.

Se paga por cada solicitud exitosa. Consulte la pestaña de precios (Pricing).

# Changelog

This Actor's version history is a separate document: https://apify.com/jbstudio/openday-api/changelog.md

# Actor input Schema

## `requests` (type: `array`):

Up to 1,000 items. Each item is {"endpoint": ..., "params": {...}}. Endpoints: holidays, is-business-day, business-days/add, business-days/between, regions, pr/municipios, pr/municipio (params: id), pr/zip (params: zip), pr/ivu. Params are the same as the HTTP query parameters, for example {"country": "PR", "year": 2027}. If left empty, a small sample runs (Puerto Rico 2027 holidays and one business-day check).

## Actor input object example

```json
{
  "requests": [
    {
      "endpoint": "holidays",
      "params": {
        "country": "PR",
        "year": 2027
      }
    },
    {
      "endpoint": "is-business-day",
      "params": {
        "date": "2027-07-05",
        "region": "US"
      }
    }
  ]
}
```

# Actor output Schema

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

One item per request: endpoint, params, ok, data or error, and source metadata.

## `api` (type: `string`):

Base URL of the live HTTP API. See /docs for the full reference.

# 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 = {
    "requests": [
        {
            "endpoint": "holidays",
            "params": {
                "country": "PR",
                "year": 2027
            }
        },
        {
            "endpoint": "is-business-day",
            "params": {
                "date": "2027-07-05",
                "region": "US"
            }
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jbstudio/openday-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 = { "requests": [
        {
            "endpoint": "holidays",
            "params": {
                "country": "PR",
                "year": 2027,
            },
        },
        {
            "endpoint": "is-business-day",
            "params": {
                "date": "2027-07-05",
                "region": "US",
            },
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("jbstudio/openday-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 '{
  "requests": [
    {
      "endpoint": "holidays",
      "params": {
        "country": "PR",
        "year": 2027
      }
    },
    {
      "endpoint": "is-business-day",
      "params": {
        "date": "2027-07-05",
        "region": "US"
      }
    }
  ]
}' |
apify call jbstudio/openday-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jbstudio/openday-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/4FaGIOMIlOm7p3mSd/builds/naVI3q3f3osTrHipk/openapi.json
