apyhub
FINANCE · STANDARD DATA

Business Days Calculator API.

What it does

Business Day Math calculates business-day dates and counts using real public-holiday calendars for US, GB, CA, AU, DE, FR, and IN. Send a base date and a mode, and get a calendar-aware result back without having to hard-code weekend or holiday rules.

Use add mode to move forward or backward by a number of business days from a given date. Use count mode to measure the number of business days between a start and end date, with the end date treated as exclusive. Use is_business_day mode to check whether a date falls on a business day for the selected country. Use holidays mode to list the holidays for a given year and country.

The request body accepts date, start, end, days, mode, year, and country. The response returns mode, input, result, country, business_days, result_weekday, and holidays_skipped. That makes it straightforward to plug Business Day Math into scheduling flows, settlement logic, SLA calculations, or any workflow that needs to skip weekends and country-specific public holidays.

If you need date arithmetic that matches real business calendars instead of generic weekday math, Business Day Math gives you the result in a simple JSON response.

POST
Business-day math with real public-holiday calendars (US/GB/CA/AU/DE/FR/IN).
http://localhost:8080/creightonnick0/business-day-math
QUICKSTARTGUIDE

Quickstart

Add a small number of business days to a date.

curl -X POST "http://localhost:8080/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).
Operation mode.
Year for holidays mode.
Range start YYYY-MM-DD (count mode).
ISO country code for the holiday calendar.

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

ParameterTypeMandatoryDescription
endStringNoRange end in YYYY-MM-DD, exclusive. Used in count mode.
dateStringNoBase date in YYYY-MM-DD. Used in add and is_business_day modes.
daysIntegerNoBusiness days to add. Use a negative value to subtract. Used in add mode.
modeStringNoOperation mode. Allowed values: add, count, is_business_day, holidays.
yearIntegerNoYear for holidays mode.
startStringNoRange start in YYYY-MM-DD. Used in count mode.
countryStringNoISO 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.

ParameterTypeMandatoryDescription
modeStringNoOperation mode used for the response.
inputStringNoInput value associated with the request.
resultStringNoComputed result value.
countryStringNoISO country code associated with the holiday calendar.
business_daysIntegerNoNumber of business days calculated.
result_weekdayStringNoWeekday for the computed result.
holidays_skippedObject ArrayNoHolidays skipped during the calculation. Each item contains date and name string fields.

Body

Name
Type
Description
bodyOPTIONAL
object
▣ 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.