Business days calculator: add or count working days with your weekend mask and holiday list
Business days calculator 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 a weekday mask (Friday-Saturday and Sunday-only weeks work) and holidays are an explicit date list, so nothing depends on a stale holiday table. Returns the result date, the day count and the skipped dates with reasons. The skipped list is capped at 1,000 entries (skipped_truncated flags it); skipped_total is always exact.
Output (data): add: result (YYYY-MM-DD), from, days, calendar_days_spanned, skipped [{date, reason weekend|holiday, weekday}] (first 1,000), skipped_total, skipped_truncated. count: business_days, calendar_days, weekend_days, holiday_days, holidays_matched, direction (forward|backward) (holidays on a weekend are reported as weekend, never as holiday). count is half-open [from, to) unless inclusive says otherwise; when to precedes from the same interval is counted backwards and business_days is still a non-negative count. skipped is in the order the dates were traversed and lists at most 1,000 entries; skipped_total is the full count and skipped_truncated is true when the list was cut (the cap only binds for days beyond roughly 1,400 working-day skips, e.g. days near 3,650 with a two-day weekend); result, calendar_days_spanned and skipped_total are always exact.
Deterministic: identical input returns identical output, so the response is served with Cache-Control: private, max-age=31536000, immutable (the paying client may cache it indefinitely; shared caches must not, because the response is paid).
Price: $0.05 USDC per call (x402, Base). Route contract version 1.0.0. Docs: https://api.duoleads.com/docs#time-business-days
Request
- Base URL: https://api.duoleads.com
- URL: https://api.duoleads.com/v1/time/business-days
- Auth: none declared
Query parameters
add (default) N business days to from, or count business days between from and to. Accepted: add, count.
Start date, YYYY-MM-DD. Accepted: a calendar date as YYYY-MM-DD.
Business days to add, -3650 to 3650. Required when op=add. Accepted: integer between -3650 and 3650.
End date YYYY-MM-DD, may precede from. Required when op=count. Accepted: a calendar date as YYYY-MM-DD.
Comma-separated weekday names or ISO numbers. Default sat,sun. Empty string = no weekend. Accepted: comma-separated weekday names (mon..sun) or ISO numbers 1-7.
Comma-separated YYYY-MM-DD holiday dates. Accepted: comma-separated YYYY-MM-DD dates, at most 2048 characters.
For op=count: start (default, half-open [from, to)), both or neither. Accepted: start, both, neither.
Response
Paid and settled. data is route-specific; a route that judges its input returns 200 with data.valid: false for a bad value.
Changes
No recorded changes to this operation across all 1 revision of this API.