Public holidays

$0.001 per call · USDC via x402 · GET /api/public-holidays

Public holidays for a country and year via Nager.Date (keyless, 100+ countries): date, local name, English name, nationwide flag, and holiday types. Send GET /api/public-holidays with the required fields country and year and pay $0.001 per call over x402 or MPP (there is no free tier). It returns a JSON object with country, year, count and holidays.

Pairs with /api/business-days and /api/country-info. ?country=US&year=2026

Category: Time & scheduling · Tags: holidays public-holidays calendar country time nager

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
countrystringyesISO 3166-1 alpha-2 country code, e.g. US, DE, JP Also accepted as countryCode, country_code, cc, iso, nation.
yearintegeryescalendar year (1975-2099)

Example request

curl -i "https://agent402.tools/api/public-holidays?country=US&year=2026"

Without payment this returns HTTP 402 Payment Required with the exact price for public-holidays; any x402 v2 or MPP client pays it and retries.

Example response

{
  "country": "US",
  "year": 2026,
  "count": 17,
  "holidays": [
    {
      "date": "2026-01-01",
      "localName": "New Year's Day",
      "name": "New Year's Day",
      "global": true,
      "counties": null,
      "types": [
        "Public",
        "Bank"
      ]
    }
  ]
}
FieldTypeAlways presentIn the example
countrystringyesUS
yearnumberyes2026
countnumberyes17
holidaysarray of objectsyes1 item in the example

From an MCP client

catalog.call {
  "slug": "public-holidays",
  "params": {
    "country": "US",
    "year": 2026
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for public-holidays; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/public-holidays?country=US&year=2026");

Part of these workflows

Public holidays is one step in this skill pack, each sold as a single call:

Related tools

Date arithmetic

FREE w/ compute · or $0.001 · POST /api/add-time

Add (or subtract) a duration to a date. duration like "2d", "-3h", "1w 2d", "90m". Returns the resulting UTC ISO timesta…

Age calculator

FREE w/ compute · or $0.001 · POST /api/age

Compute a precise age (years, months, days) from a birth date to today (or a given date), plus total days.

Business days

FREE w/ compute · or $0.001 · POST /api/business-days

Count business days (Mon–Fri) between two dates, inclusive of the start, exclusive of the end. Optional list of holiday …

Cron next runs

FREE w/ compute · or $0.001 · POST /api/cron-next

Parse a 5-field cron expression and return the next N run times (UTC).

Date difference

FREE w/ compute · or $0.001 · POST /api/date-diff

Difference between two dates/times in ms, seconds, minutes, hours, days, and a human summary.

Duration parse/humanize

FREE w/ compute · or $0.001 · POST /api/duration

Parse a duration like "2h30m" / "1d4h" / "90s" to seconds, or humanize a number of seconds.