# 2s Business Days Calculator

> 2s Business Days Calculator is a paid API for AI agents from 2s.io, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-12).

Calculates business days between two dates or adds/subtracts business days from an anchor date, accounting for public holidays and weekends by country and region.

## Facts

- Endpoint: GET https://2s.io/api/calendar/business-days?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-business-days-calculator-6ecf96c6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_INqBkSbZmM7jBSCxioOQk

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 2s-business-days-calculator-6ecf96c6
```

Example prompt: How many business days are there between July 2 and August 15, 2026 in the US, and which holidays get skipped?

## When to prefer this

Use this endpoint when you need accurate business-day calculations that respect country-specific public holidays and configurable weekends, especially for scheduling contract deadlines, payment settlement windows, delivery estimates, or legal notice periods. Prefer this over a generic date-math library when holiday awareness by country and optional subdivision is required.

## Known failure modes

- Missing required 'country' or 'start' parameter returns an error
- Invalid ISO date format causes a parse error
- Providing both 'end' and 'addDays' simultaneously (XOR violation) returns an error
- Unsupported country code returns empty or error
- Invalid region/subdivision code may return results without regional holidays

## How this service works

Holiday-aware business-day calculator for 200+ countries. Three modes: pass start + addDays (signed integer) to shift a date by N business days; pass start + end to count business days between two dates (exclusive of start, inclusive of end); pass start alone to check one date (is it a business day, which holiday, next/previous business day). Query: country (ISO 3166-1 alpha-2), start (YYYY-MM-DD), optional region (subdivision code), addDays XOR end, optional weekend (comma-separated days, default sat,sun — e.g. fri,sat for the Gulf), optional types (holiday types treated as closures, default public,bank). Skipped holidays are itemized in the response. Use for payment terms, SLA deadlines, and delivery-date math.

## Output

Returns a JSON object with ok:true, an items array containing for each query: the mode (add or count), start date, result date or business-day count, country, region, list of holidays skipped (each with date and name), and calendar days spanned. Also includes a source object with provider name, license, and URL.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "end": "2026-08-15",
   "start": "2026-07-02",
   "country": "US"
  }
 }
}
```

## 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",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "required": [
      "country",
      "start"
     ],
     "properties": {
      "end": {
       "type": "string",
       "description": "End date YYYY-MM-DD to count business days to (XOR with addDays)."
      },
      "start": {
       "type": "string",
       "description": "Anchor date, YYYY-MM-DD."
      },
      "types": {
       "type": "string",
       "description": "Optional holiday types treated as closures. Default public,bank."
      },
      "region": {
       "type": "string",
       "description": "Optional subdivision code, e.g. CA, BY."
      },
      "addDays": {
       "type": "string",
       "description": "Signed business days to add (XOR with end)."
      },
      "country": {
       "type": "string",
       "description": "ISO 3166-1 alpha-2 country code."
      },
      "weekend": {
       "type": "string",
       "description": "Optional weekend days, comma-separated. Default sat,sun."
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-business-days-calculator-6ecf96c6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
