{"uid":"cap_R0RPOoxV16zueLDxr3wPu","slug":"date-math-business-day-check-1fff4166","name":"Date Math – Business Day Check","description":"Date Math: Is a date a business day? If not, why (weekend, or which public holiday). Also the next and previous business day, and the month's business-day count, first and last business day. Use for office-open checks, shipping cut-offs, settlement dates. Country holidays, custom holidays and custom workweeks (e.g. Sun–Thu, Mon–Sat).","url":"https://date-math.datemath.workers.dev/v1/business_day?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"date":{"type":"string","example":"2026-11-07","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"country":{"type":"string","example":"US","pattern":"^[A-Za-z]{2}$","description":"ISO 3166-1 alpha-2 country code (207 countries); its public holidays (2000–2050) are excluded from business days"},"holidays":{"type":"array","items":{"type":"string","example":"2026-11-07","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"maxItems":1000,"description":"Extra dates excluded from business-day counts (rest days from workdays are always excluded)"},"workdays":{"type":"array","items":{"type":"integer","maximum":6,"minimum":0},"example":[1,2,3,4,5],"maxItems":7,"minItems":1,"description":"Working days of the week, 0 = Sunday. Default [1,2,3,4,5] (Mon–Fri); e.g. [0,1,2,3,4] for Sun–Thu or [1,2,3,4,5,6] for Mon–Sat"}}},"responseSchema":{"type":"json","example":{"date":"2026-12-25","month":{"business_days":21,"last_business_day":"2026-12-31","first_business_day":"2026-12-01","business_day_number":null},"reason":"holiday","holiday":"Christmas Day","weekday":"Friday","is_business_day":false,"next_business_day":"2026-12-28","previous_business_day":"2026-12-24"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_2nwQB_Megla13UPCjbCYT","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Determines if a given date is a business day, explains why if not (weekend or named holiday), and returns the next/previous business day plus the month's business-day statistics.","exampleAgentPrompt":"Is November 7, 2026 a business day in the US? If not, tell me why and give me the next and previous business days, plus how many business days are in that month.","exampleUseCases":[{"title":"Shipping cut-off date validation","prompt":"Our carrier cut-off is November 11, 2026 — is that actually a business day in the US? If not, what's the next one we should use instead?"},{"title":"Financial settlement date check","prompt":"We need to settle a trade on December 25, 2026 in the UK — is that a valid business day, and if not, what's the previous business day we should settle on?"},{"title":"Middle-East office open check","prompt":"Does our Dubai office need to be open on March 20, 2026? They work Sunday through Thursday — tell me if that's a business day for them and what day of the week it falls on."}],"resultDescription":"A JSON object confirming whether the date is a business day, the reason if not (weekend or named holiday), the holiday name, the weekday name, the next and previous business days (as YYYY-MM-DD strings), and the month's total business-day count, its first business day, its last business day, and the date's ordinal position within the month's business days.","failureModes":["Invalid date format returns a validation error","Unsupported or misspelled country code returns an error or falls back to no holidays","Date outside the 2000–2050 holiday coverage range may return incomplete holiday data","Providing an empty workdays array triggers a schema validation error (minItems: 1)","Custom holidays list exceeding 1000 entries is rejected"],"whenToPreferThis":"Choose this endpoint when you need a definitive, country-aware business-day determination for a single date, including rich context like the holiday name, month-level statistics, and adjacent business days. It is superior to generic date libraries when you need 207-country public holiday awareness, custom workweek support (e.g. Sun–Thu for Gulf states, Mon–Sat for retail), or the ability to inject bespoke company holidays. Prefer it for office-open checks, shipping cut-offs, financial settlement scheduling, and SLA boundary detection.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:30:26.724Z","isFirstParty":false,"canonicalSlug":"date-math-business-day-check-1fff4166"}