Count or add business days
Exactdates_business_daysDeterministic and authoritative — the canonical answer for this input.
Count business days in [start, end] inclusive (pass end), or return the date N business days from start (pass days; negative goes back). end and days are mutually exclusive — passing both returns an invalid-input result, not a silent mode choice (as does passing neither). Skips weekends (configurable via weekend; a weekend covering all 7 days is rejected) and an optional holiday list — holidays_applied counts the holidays inside the computed range, not the supplied list length. days is capped at ±100,000 and count ranges at 100,000 days. Processing multiple inputs? Use `dates_business_days_batch` to do up to 1000 in one call.
Parameters
startstringrequiredISO 8601 start date.
endstringoptionalISO 8601 end date — count mode (inclusive).
daysintegeroptionalBusiness days to add — add mode (negative = back).
holidaysarrayoptionalISO dates to skip as holidays.
weekendarrayoptionalWeekday numbers treated as weekend (Mon=0…Sun=6). Default [5, 6].
Call it
curl -X POST https://api.snipget.ai/v1/dates/business-days \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"start":"2024-03-04","end":"2024-03-15","holidays":["2024-03-08"]}'The Batch tab sends up to 1000 inputs in one call via /v1/dates/business-days/batch.
Example response
{
"input": "2024-03-04",
"is_valid": true,
"mode": "count",
"business_days": 9,
"weekend": [
5,
6
],
"holidays_applied": 1
}FAQ
Why not just count the days?
Business-day math means skipping weekends and holidays, which is tedious and easy to get wrong by hand or with a language model. This tool counts working days in a range, or finds the date a set number of working days away, reliably.
Does it have two modes?
Yes. Pass end to count the business days between start and end (inclusive). Pass days instead to get the date that many business days from start, where negative numbers go backward. Pass exactly one: supplying both end and days — or neither — is rejected as an unbilled invalid-input error rather than a guessed mode.
Can I include my own holidays?
Yes. Pass holidays as a list of ISO dates like ['2024-03-08'] and they are skipped. There is no built-in holiday calendar, so you supply the dates you observe. The result's holidays_applied counts how many of your holidays actually fell inside the computed range, so a list entry outside the range is visibly not applied.
What counts as a weekend?
Saturday and Sunday by default. You can change this with the weekend option using weekday numbers where Monday is 0 and Sunday is 6, for regions with different working weeks.
Is the count exact?
Yes. It is deterministic and authoritative given your start, end, weekend, and holiday inputs. Invalid dates return confidence 0 with a why_invalid reason rather than an error.