# Spain Business Days Calculator

> Spain Business Days Calculator is a paid API for AI agents from es.redtapeapi.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-11-18).

Counts business days, weekend days, and public holidays between two dates for Spain nationally or by autonomous community region.

## Facts

- Endpoint: GET https://es.redtapeapi.com/v1/es/business-days?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/spain-business-days-calculator-6275b15b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6q9oAkw_FBkAAqNPRDmCO

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability spain-business-days-calculator-6275b15b
```

Example prompt: How many business days are there in Catalonia (ES-CT) between December 1 and December 31, 2026, accounting for Spanish public holidays?

## When to prefer this

Use this endpoint when you need an authoritative count of Spanish business days that respects both national and regional autonomous community public holidays. Prefer it over generic calendar libraries when accuracy for specific Spanish regions (e.g. Catalonia, Basque Country, Andalusia) matters, or when building workflows that must comply with Spanish labor law payment/delivery timelines. No API key or account setup required — pay-per-call with USDC via x402.

## Known failure modes

- Missing required 'from' or 'to' query parameters returns a validation error
- Invalid date format (not YYYY-MM-DD) causes a parse error
- Invalid or unrecognized region code returns an error
- Date range where 'from' is after 'to' may return zero or an error
- Payment failure via x402 (insufficient USDC) blocks the call

## How this service works

Pay-per-call Spain and EU utilities for AI agents over x402 (USDC). No accounts, no API keys. Public open data, live official checks (EU VIES) and offline computation; nothing is stored.

## Output

A JSON object containing the requested date range (from/to), the optional region code, the total number of business days, the number of weekend days, and the number of public holidays that fall on weekdays within the range — all computed offline using official Spanish holiday data.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "YYYY-MM-DD"
      },
      "from": {
       "type": "string",
       "description": "YYYY-MM-DD"
      },
      "region": {
       "type": "string",
       "description": "Optional ISO 3166-2 region: ES-AN,ES-AR,ES-AS,ES-CB,ES-CE,ES-CL,ES-CM,ES-CN,ES-CT,ES-EX,ES-GA,ES-IB,ES-MC,ES-MD,ES-ML,ES-NC,ES-PV,ES-RI,ES-VC"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "to": "2026-12-31",
  "from": "2026-12-01",
  "region": "ES-CT",
  "weekendDays": 8,
  "businessDays": 19,
  "holidaysOnWeekdays": 4
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/spain-business-days-calculator-6275b15b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from es.redtapeapi.com](https://www.zero.xyz/host/es.redtapeapi.com/llms.txt)
