# Duo Data Utilities – Business Day Arithmetic

> Duo Data Utilities – Business Day Arithmetic is a paid API for AI agents from api.duoleads.com, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-02).

Add or subtract N working days from a date, or count working days between two dates, using a caller-supplied weekend mask and holiday list.

## Facts

- Endpoint: GET https://api.duoleads.com/v1/time/business-days?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/duo-data-utilities-business-day-arithmetic-1d751f1f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_USW1ohm5AtLjGQ2vUgg_n

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 duo-data-utilities-business-day-arithmetic-1d751f1f
```

Example prompt: Starting from December 24, 2026, add 5 business days — treat Saturday and Sunday as the weekend, and mark December 25 and January 1 as holidays — then tell me what date I land on and which days were skipped.

## When to prefer this

Choose this endpoint when you need deterministic business-day arithmetic with a fully caller-controlled calendar — no reliance on a server-side holiday table that could go stale. It is ideal when the weekend definition is non-standard (e.g. Fri-Sat or Sun-only) or when you must supply your own explicit holiday list. Prefer it over generic date libraries when you need the skipped-dates audit trail (with per-day reasons) for compliance, SLA documentation, or contract traceability.

## Known failure modes

- Missing required `from` parameter returns a 400 error
- Missing `days` when op=add or missing `to` when op=count returns a 400 validation error
- Invalid date format (not YYYY-MM-DD) returns a 400 parse error
- Invalid weekend mask value returns a 400 error
- Days value outside -3650 to 3650 range returns a 400 error
- Holiday string exceeding 2048 characters returns a 400 error
- Payment not provided or insufficient returns 402 Payment Required

## How this service works

Business-day arithmetic with a caller-supplied calendar: add or subtract N working days from a date, or count the working days between two dates. The weekend is specified as a weekday mask so Friday-Saturday and Sunday-only weeks work, and holidays are passed in as an explicit date list, so the answer never depends on a holiday table that can go stale. Returns the result date, the day count, and the skipped dates with the reason each was skipped.

## Output

A JSON object containing: `result` (the computed date as YYYY-MM-DD when op=add), `days` (the business day count when op=count), `from` (the start date), `skipped` array listing each skipped date with its weekday name and reason (holiday or weekend), `skipped_total` count, `skipped_truncated` boolean, and `calendar_days_spanned`. Also includes a `meta` block with `request_id`, `computed_at`, `price_usd`, and `deterministic: true`.

## 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"
     ],
     "properties": {
      "op": {
       "enum": [
        "add",
        "count"
       ],
       "type": "string",
       "default": "add",
       "maxLength": 64,
       "description": "add (default) N business days to from, or count business days between from and to."
      },
      "to": {
       "type": "string",
       "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
       "maxLength": 32,
       "description": "End date YYYY-MM-DD, may precede from. Required when op=count."
      },
      "days": {
       "type": "string",
       "pattern": "^[+-]?\\d+$",
       "maxLength": 64,
       "description": "Business days to add, -3650 to 3650. Required when op=add."
      },
      "from": {
       "type": "string",
       "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
       "maxLength": 32,
       "description": "Start date, YYYY-MM-DD."
      },
      "weekend": {
       "type": "string",
       "default": "sat,sun",
       "maxLength": 64,
       "description": "Comma-separated weekday names or ISO numbers. Default sat,sun. Empty string = no weekend."
      },
      "holidays": {
       "type": "string",
       "maxLength": 2048,
       "description": "Comma-separated YYYY-MM-DD holiday dates."
      },
      "inclusive": {
       "enum": [
        "start",
        "both",
        "neither"
       ],
       "type": "string",
       "default": "start",
       "maxLength": 64,
       "description": "For op=count: start (default, half-open [from, to)), both or neither."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "ok",
      "route",
      "version",
      "data",
      "meta"
     ],
     "properties": {
      "ok": {
       "const": true
      },
      "data": {
       "type": "object",
       "properties": {
        "days": {
         "type": "integer"
        },
        "from": {
         "type": "string"
   
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "days": 5,
   "from": "2026-12-24",
   "result": "2027-01-04",
   "skipped": [
    {
     "date": "2026-12-25",
     "reason": "holiday",
     "weekday": "friday"
    },
    {
     "date": "2026-12-26",
     "reason": "weekend",
     "weekday": "saturday"
    },
    {
     "date": "2026-12-27",
     "reason": "weekend",
     "weekday": "sunday"
    },
    {
     "date": "2027-01-01",
     "reason": "holiday",
     "weekday": "friday"
    },
    {
     "date": "2027-01-02",
     "reason": "weekend",
     "weekday": "saturday"
    },
    {
     "date": "2027-01-03",
     "reason": "weekend",
     "weekday": "sunday"
    }
   ],
   "skipped_total": 6,
   "skipped_truncated": false,
   "calendar_days_spanned": 11
  },
  "meta": {
   "price_usd": "0.05",
   "disclaimer": "Factual output of a deterministic computation over public data. Provided as is, with no warranty of accuracy, completeness or availability. Not investment, financial, legal, tax, medical or any other professional advice, and not a recommendation. Verify before relying on it. Terms: https://api.duoleads.com/terms",
   "request_id": "01K6B7Q4ZC8H3F2M9WXR5TYN0D",
   "computed_at": "2026-09-28T12:00:00.000Z",
   "deterministic": true
  },
  "route": "/v1/time/business-days",
  "version": "1.0.0"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/duo-data-utilities-business-day-arithmetic-1d751f1f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.duoleads.com](https://www.zero.xyz/host/api.duoleads.com/llms.txt)
