apyhub
Back
▣ FINANCE · STANDARD DATA

Business Days Calculator API.

What it does

The Business Days Calculator API does date math that skips weekends and public holidays. Add or subtract business days from a date, count the business days between two dates, check whether a single date is a business day, or list a country's holidays for a year, all from one endpoint.

It uses real public holiday calendars for seven countries: the United States (US), United Kingdom (GB), Canada (CA), Australia (AU), Germany (DE), France (FR) and India (IN). Pick what you want with the mode field:

  • add takes a date and a number of days and returns the resulting business day. Use a negative number to go backwards, for example to find the last business day before a deadline.
  • count takes a start and end date and returns the number of business days between them. The end date is not included in the count.
  • is_business_day takes a date and tells you whether it is a working day in that country.
  • holidays takes a year and returns that country's public holidays.

All dates use YYYY-MM-DD. The response includes the result date, its result_weekday, the business_days count, and holidays_skipped with the date and name of every holiday the calculation stepped over, so you can show users why a deadline moved.

Common uses include working out what date is 5, 10 or 30 business days from today, setting payment and settlement dates, calculating SLA and support deadlines, estimating shipping and delivery dates, and checking whether a bank or office will be open on a given day.

To count working days between two dates with a full breakdown of weekends and holidays, you can also use the Working Day Calculator, and the Public Holidays API lists holiday dates by country. For recurring jobs that should run on a schedule, see the Advanced Schedule Cron API.

You can try it right here in the playground. Start for free with 5 API calls a day, no card required, and test it with your own dates before you commit.

The API is also available through ApyHub MCP, so AI agents can work out business-day deadlines directly instead of guessing.

POST
Business-day math with real public-holiday calendars (US/GB/CA/AU/DE/FR/IN).
https://api.eu.apyhub.com/creightonnick0/business-day-math

QUICKSTART

GUIDE

Quickstart

Add a small number of business days to a date.

curl -X POST "https://api.eu.apyhub.com/creightonnick0/business-day-math" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"add","date":"2026-12-23","days":3,"country":"US"}'

Note: Supported countries: US, GB, CA, AU, DE, FR, and IN. Holiday calendars: Public holidays are calculated for these countries using country-specific holiday rules. Countries outside this list are not currently supported.

What you'll get back

Returns a JSON object with these top-level fields: mode and input as strings, result and country as strings, business_days as an integer, result_weekday as a string, and holidays_skipped as an array of objects with date and name string fields.

{
  "mode": "add",
  "input": "2026-12-23",
  "result": "2026-12-28",
  "country": "US",
  "business_days": 3,
  "result_weekday": "Monday",
  "holidays_skipped": []
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body
Range end YYYY-MM-DD, exclusive (count mode)
The base date YYYY-MM-DD (add / is_business_day modes)
Business days to add. Use a negative value to subtract (add mode).

About this endpoint

What it does

Calculates business-day results using public-holiday calendars for the supported countries. Depending on mode, it can add business days to a date, count business days in a range, check whether a date is a business day, or return holidays for a year.

Request Body

ParameterTypeDescription
endStringRange end in YYYY-MM-DD, exclusive. Used in count mode.
dateStringBase date in YYYY-MM-DD. Used in add and is_business_day modes.
daysIntegerBusiness days to add. Use a negative value to subtract. Used in add mode.
modeStringOperation mode. Allowed values: add, count, is_business_day, holidays.
yearIntegerYear for holidays mode.
startStringRange start in YYYY-MM-DD. Used in count mode.
countryStringISO country code for the holiday calendar. Allowed values: US, GB, CA, AU, DE, FR, IN.

Response

Returns a JSON object with mode, input, result, and country string fields, plus business_days as an integer, result_weekday as a string, and holidays_skipped as an array of objects. Each object in holidays_skipped contains date and name string fields.

ParameterTypeDescription
modeStringOperation mode used for the response.
inputStringInput value associated with the request.
resultStringComputed result value.
countryStringISO country code associated with the holiday calendar.
business_daysIntegerNumber of business days calculated.
result_weekdayStringWeekday for the computed result.
holidays_skippedObject ArrayHolidays skipped during the calculation. Each item contains date and name string fields.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.