ForHosting KIT · Developer Utilities

Count business days

Promising a delivery in 'five business days' means something different in Tokyo, Toronto and Buenos Aires the moment a public holiday lands on the calendar. This business days calculator API counts or adds working days while accounting for weekends and official holidays in more than 100 countries, so that promise holds no matter where the calendar sits.

● StableFree · in your browser
Use it from WebAPIEmailApp soonTelegram soon

Runs in your browser. Free, unlimited — your data never leaves this page.

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 in a specific country, or what date lands N working days from today. 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, a country code, and either a target date to count working days between two points, or a number of working days to add or subtract from the start date. The task queues asynchronously and returns a task_id immediately; the resulting count or date is delivered via signed webhook or a signed link valid for 24 hours, ready to feed straight into an invoice, a shipping label or a leave calendar.

Public holidays are not a fixed list

Unlike weekends, which are stable, public holidays shift: 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. Maintaining an accurate, current holiday calendar for a single country is a real maintenance burden; maintaining it for over a hundred, correctly, year after year, is the specific problem this endpoint exists to absorb so individual applications don't have to.

How it slots into a larger system

Because the endpoint takes a country code as a parameter, a single integration can serve customers or offices across multiple regions without branching logic for 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, covering more than 100 countries' holiday calendars, and dates submitted for calculation are discarded after the delivery window, never used to train models.

SLA and delivery date calculation

Add five working days to an order date in the customer's country to quote an accurate delivery window that accounts for local holidays.

Invoice and payment due dates

Calculate a net-30 business-day due date correctly across countries with different holiday calendars for the same billing cycle.

HR and leave tracking

Count the actual working days between a leave request's start and end dates, excluding weekends and public holidays in the employee's country.

Multi-country logistics planning

Determine the next working day after a shipment leaves the warehouse in each destination country before scheduling customs clearance.

How does this business days calculator API work?

Send a start date, country code and either a target date or a number of days to POST /dev/business-days, and it returns the working-day count or resulting date via webhook or a signed link.

Does it account for public holidays, not just weekends?

Yes, it excludes both weekends and official public holidays for the specified country, not just Saturdays and Sundays.

How many countries' holiday calendars does it support?

It covers public holidays for more than 100 countries, selected by country code in the request.

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 country or date range involved.

Can it add working days to a date, not just count them?

Yes, provide a number of working days instead of a target date and it returns the resulting date after skipping weekends and holidays.

Is the business days API live now?

Yes, it is live and accepting requests across its full set of supported countries.

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.

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.

POSThttps://api.kit.forhosting.com/dev/business-days

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, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/dev/business-days \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"items":["valor-1","valor-2"]}'
{
  "items": [
    "valor-1",
    "valor-2"
  ]
}
{
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →