{"uid":"cap_USW1ohm5AtLjGQ2vUgg_n","slug":"duo-data-utilities-business-day-arithmetic-1d751f1f","name":"Duo Data Utilities – Business Day Arithmetic","description":"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 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.","url":"https://api.duoleads.com/v1/time/business-days?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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"},"result":{"type":"string"},"skipped":{"type":"array","items":{"type":"object","required":["date","reason","weekday"],"properties":{"date":{"type":"string"},"reason":{"type":"string"},"weekday":{"type":"string"}}}},"direction":{"type":"string"},"holiday_days":{"type":"integer"},"weekend_days":{"type":"integer"},"business_days":{"type":"integer"},"calendar_days":{"type":"integer"},"skipped_total":{"type":"integer"},"holidays_matched":{"type":"array","items":{"type":"string"}},"skipped_truncated":{"type":"boolean"},"calendar_days_spanned":{"type":"integer"}}},"meta":{"type":"object","required":["request_id","computed_at","price_usd","deterministic","disclaimer"],"properties":{"sources":{"type":"array","items":{"type":"object","required":["id","version","published"]}},"price_usd":{"type":"string"},"disclaimer":{"type":"string"},"request_id":{"type":"string"},"computed_at":{"type":"string","description":"RFC 3339 UTC with milliseconds"},"deterministic":{"type":"boolean"}}},"route":{"const":"/v1/time/business-days"},"version":{"type":"string"}}}}}}},"responseSchema":{"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"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_fiXDs-gBxbw6IeJw3JrW0","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Contract notice period deadline","prompt":"Our contract requires 30 business days notice before termination. If we send notice today, March 3 2025, what date does the 30-day period end? Skip Saturdays and Sundays, and treat May 26 and July 4 as holidays."},{"title":"SLA response window count","prompt":"Count how many business days there are between January 15 2025 and February 28 2025 — standard Monday-to-Friday week, with January 20 and February 17 as public holidays. I need the exact working-day count for our SLA report."},{"title":"Middle-East work week delivery date","prompt":"Our supplier operates a Sunday–Thursday work week, so Friday and Saturday are their weekend. If an order ships on Wednesday April 2 2025, when does it arrive after 7 business days? Also flag April 18 as a regional holiday."}],"resultDescription":"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`.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T00:46:10.918Z","isFirstParty":false,"canonicalSlug":"duo-data-utilities-business-day-arithmetic-1d751f1f"}