Count business days
Promising a delivery in 'five business days' means counting actual working days, not calendar days: the moment a weekend or a public holiday lands inside the range, a naive date subtraction is off.
Run — free
This business days calculator API counts the working days between two dates, skipping Saturdays and Sundays and any holiday dates you supply, so the number you quote matches the working calendar you actually operate on.
Why 'business day' is harder than it sounds
A naive version of this math just skips Saturdays and Sundays, which works fine until a national holiday falls on a Wednesday and quietly breaks every SLA, invoice due date and shipping estimate built on top of it. Finance teams calculating settlement dates, logistics platforms quoting delivery windows, and HR systems tracking leave all need the same underlying answer: how many actual working days sit between two dates. Getting it wrong doesn't crash anything, it just quietly produces a date that's off by one, two or three days, which is often worse than an obvious error because nobody notices until a customer complains.
What the request and response look like
POST /dev/business-days accepts a start date, an end date, and an optional list of holiday dates to exclude on top of weekends. The task queues asynchronously and returns a task_id immediately; the resulting working-day count, alongside the plain calendar-day count for the same range, is delivered via signed webhook or a signed link valid for 24 hours, ready to feed straight into an invoice, a shipping estimate or a leave calendar.
Public holidays are the part you supply
Weekends are stable and handled automatically, but public holidays are not a fixed list: some are fixed calendar dates, others follow lunar or religious calendars and move every year, and some are declared by regional or municipal authorities on top of national ones. Rather than assume a holiday calendar that might be wrong for your exact location or year, this endpoint takes the holiday dates that actually apply to you and excludes them alongside Saturdays and Sundays, so the count reflects your real working calendar instead of a guessed one.
How it slots into a larger system
Because the holiday list is just a parameter, a single integration can serve customers or offices in different regions by passing whichever set of dates fits each one, useful for global e-commerce platforms, payroll systems and multinational support desks alike. It composes naturally with scheduling, invoicing or SLA-tracking automation that already calls other endpoints in the same pipeline. Pricing is $0.002 per request, so recalculating due dates across a large batch of orders or invoices stays inexpensive even at volume.
Access and current status
Calling the endpoint requires prepaid balance; without one, requests return HTTP 402 rather than an incomplete calculation, and a failed request is never billed once its retries are exhausted. The endpoint is live now, counting working days between two dates against the holiday list you provide, and dates submitted for calculation are discarded after the delivery window, never used to train models.
What you can do with it
SLA and delivery date checks
Count the working days in a delivery window, excluding weekends and any regional holidays you supply, to confirm a quoted date is actually reachable.
Invoice and payment due dates
Count the working days between an invoice date and its due date, excluding weekends and the holidays that apply, to confirm a net-30-business-day term lands where you think.
HR and leave tracking
Count the actual working days between a leave request's start and end dates, excluding weekends and the holiday dates you supply for the employee's location.
Multi-country logistics planning
Count the working days between a shipment's dispatch and a customs deadline in each destination, supplying that region's holidays so the total reflects the local calendar.
FAQ
How does this business days calculator API work?
Send a start date, an end date and an optional list of holiday dates to POST /dev/business-days, and it returns the working-day count for the range via webhook or a signed link.
Does it account for public holidays, not just weekends?
Yes. It excludes Saturdays and Sundays automatically, plus any holiday dates you include in the request, so both weekends and your holidays are removed from the count.
Does it include a built-in holiday calendar for my country?
No, and that's deliberate. It skips weekends automatically and you pass the specific holiday dates that apply to you, which are excluded too. That keeps the result correct for your exact location and year instead of assuming a calendar that could be wrong.
Is there a free tier for this API?
The tool above runs free in your browser. The API is paid — each call draws from your prepaid ForHosting KIT balance: top up from $10.00 (it never expires), pay each request's published price, and a call with no balance returns HTTP 402. No subscription, no tokens, and a failed task is never charged.
What does the business days API cost?
It costs a flat $0.002 per request regardless of the date range or the number of holidays you supply.
Does it also return the plain calendar-day count?
Yes. Alongside the working-day count it returns the total calendar days between the two dates, so you can compare the two directly.
Is the business days API live now?
Yes, it is live and accepting requests, counting the working days between any two dates you send.
Can I process business day calculations for many orders at once?
Submit one request per calculation; each is queued and priced independently, which suits batch processing across large order or invoice lists.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/dev/business-days \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"start":"2026-07-01","end":"2026-07-31"}'const res = await fetch("https://api.kit.forhosting.com/dev/business-days", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"start": "2026-07-01",
"end": "2026-07-31"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/dev/business-days",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"start": "2026-07-01",
"end": "2026-07-31"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/dev/business-days", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"start":"2026-07-01","end":"2026-07-31"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"start":"2026-07-01","end":"2026-07-31"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/dev/business-days", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"start": "2026-07-01",
"end": "2026-07-31"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "dev.business_days",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |