apyhub
Back

Calculate Business Days Across Countries and Markets

What it does

Business Days Calculator works out working-day dates for 250 countries and territories and 28 stock exchange calendars. Add or subtract business days from a start date, count the business days between two dates, or find the next or previous business day, and see which holidays and closures were skipped.

Choose a calendar with country (an ISO code such as US or DEU) or market (an exchange code such as XNYS), and narrow it with subdivision. Add your own closed dates with exclude (up to 366 dates), choose which holiday categories count, or override the weekend with weekend, for example fri,sat.

Every response lists the skipped holidays with the reason, so a result is easy to explain to your users. Dates use YYYY-MM-DD and default to today in UTC. Add and subtract accept up to 2,500 business days, and counting works for ranges of up to ten years.

Use it for delivery and SLA deadlines, payroll and invoice due dates, settlement dates, and project plans that must respect local holidays.

▣ ENDPOINT 01 / 03
GET
Add or Subtract Business Days
https://api.eu.apyhub.com/callable-labs/calculate-business-days-across-countries-markets-api/v1/business-days/add

QUICKSTART

GUIDE

Quickstart

Add 3 business days to 23 December 2026 in Germany, skipping weekends and public holidays.

curl -X GET "https://api.eu.apyhub.com/callable-labs/calculate-business-days-across-countries-markets-api/v1/business-days/add?days=3&start=2026-12-23&country=DE" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with the resulting date, the start date and days used, the number of calendar_days between them, and skipped_holidays, the holidays and closures that were passed over. It also echoes the calendar settings: country, market, subdivision, weekend, categories, language and calendar_version.

{
  "start": "2026-12-23",
  "days": 3,
  "date": "2026-12-29",
  "calendar_days": 6,
  "country": "DE",
  "market": null,
  "subdivision": null,
  "weekend": ["saturday", "sunday"],
  "categories": ["public"],
  "language": "en",
  "calendar_version": "2026.10",
  "skipped_holidays": [
    { "date": "2026-12-25", "reason": "holiday", "names": ["Christmas Day"] }
  ]
}
TRY ITLIVE · 5 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.
Business days to add; negative subtracts (±2500)

About this endpoint

What it does

Adds business days to a start date, or subtracts them when days is negative, and returns the resulting date. The start date itself is never counted. With days=0 it returns the start date when it is a business day, otherwise the next one. The response lists the holidays and closures that were skipped.

Query Parameter(s)

AttributeTypeDescription
daysIntegerBusiness days to add. Negative values subtract. Range: -2500 to 2500. Required.
startStringStart date, YYYY-MM-DD. Default: today (UTC).
countryStringISO 3166-1 alpha-2 or alpha-3 country code, such as US or DEU. Give country or market.
marketStringExchange MIC or acronym, such as XNYS or NYSE. Give country or market.
subdivisionStringState, province or region code or name, such as CA, BY or Bayern.
categoriesStringComma-separated holiday categories, such as public,bank. Default: the calendar's main category (usually public).
excludeStringExtra closed dates as comma-separated ISO dates (at most 366), for example company shutdown days.
weekendStringOverride the weekend with weekday names or abbreviations, such as sat,sun or fri,sat, or none. Default: the calendar's own weekend.

Response

Returns a JSON object with the resulting business day and the days that were passed over.

ParameterTypeDescription
dateStringThe resulting business day (YYYY-MM-DD).
startStringThe start date used.
daysIntegerBusiness days added (negative when subtracted).
calendar_daysIntegerCalendar days between start and date.
skipped_holidaysObject ArrayHolidays and closures passed over, each with a date and a reason.
weekendString ArrayWeekend days used.
countryStringCountry code of the calendar, or null.
marketStringExchange code of the calendar, or null.
subdivisionStringSubdivision used, if any.
categoriesString ArrayHoliday categories applied.
languageStringLanguage of the holiday names.
calendar_versionStringVersion of the calendar data used.
▣ ENDPOINT 02 / 03
GET
Count Business Days Between Dates
https://api.eu.apyhub.com/callable-labs/calculate-business-days-across-countries-markets-api/v1/business-days/count

QUICKSTART

GUIDE

Quickstart

Count the business days in 2026 on the New York Stock Exchange calendar.

curl -X GET "https://api.eu.apyhub.com/callable-labs/calculate-business-days-across-countries-markets-api/v1/business-days/count?start=2026-01-01&end=2026-12-31&market=XNYS" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with business_days, calendar_days and weekend_days for the range (both ends included), and holidays, the holidays and closures that fell on working weekdays. It also echoes the calendar settings used. Only the first holidays are shown here.

{
  "start": "2026-01-01",
  "end": "2026-12-31",
  "business_days": 251,
  "calendar_days": 365,
  "weekend_days": 104,
  "weekend": ["saturday", "sunday"],
  "market": "XNYS",
  "country": null,
  "subdivision": null,
  "categories": ["public"],
  "language": "en",
  "calendar_version": "2026.10",
  "holidays": [
    { "date": "2026-01-01", "reason": "holiday", "names": ["New Year's Day"] },
    { "date": "2026-01-19", "reason": "holiday", "names": ["Martin Luther King Jr. Day"] }
  ]
}
TRY ITLIVE · 5 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.
Last day, included
First day, included
Exchange MIC or acronym, e.g. `XNYS` or `NYSE`. Give `country` or `market`.
ISO 3166-1 alpha-2 or alpha-3 code, e.g. `US` or `DEU`. Give `country` or `market`.
Extra closed dates, comma-separated ISO dates (at most 366), e.g. company shutdown days

About this endpoint

What it does

Counts the business days from start to end, both included, for ranges of up to ten years. The response also lists the holidays and closures that fell on working weekdays.

Query Parameter(s)

AttributeTypeDescription
startStringFirst day, included (YYYY-MM-DD). Required.
endStringLast day, included (YYYY-MM-DD). Required.
countryStringISO 3166-1 alpha-2 or alpha-3 country code, such as US or DEU. Give country or market.
marketStringExchange MIC or acronym, such as XNYS or NYSE. Give country or market.
subdivisionStringState, province or region code or name, such as CA, BY or Bayern.
categoriesStringComma-separated holiday categories, such as public,bank. Default: the calendar's main category (usually public).
excludeStringExtra closed dates as comma-separated ISO dates (at most 366), for example company shutdown days.
weekendStringOverride the weekend with weekday names or abbreviations, such as sat,sun or fri,sat, or none. Default: the calendar's own weekend.

Response

Returns a JSON object with the count and the days that were not counted.

ParameterTypeDescription
business_daysIntegerBusiness days in the range, both ends included.
calendar_daysIntegerCalendar days in the range.
weekend_daysIntegerWeekend days in the range.
holidaysObject ArrayHolidays and closures on working weekdays, each with a date and a reason.
startStringFirst day of the range.
endStringLast day of the range.
weekendString ArrayWeekend days used.
countryStringCountry code of the calendar, or null.
marketStringExchange code of the calendar, or null.
subdivisionStringSubdivision used, if any.
categoriesString ArrayHoliday categories applied.
languageStringLanguage of the holiday names.
calendar_versionStringVersion of the calendar data used.
▣ ENDPOINT 03 / 03
GET
Find Next or Previous Business Day
https://api.eu.apyhub.com/callable-labs/calculate-business-days-across-countries-markets-api/v1/business-days/next

QUICKSTART

GUIDE

Quickstart

Find the first business day after Christmas Day 2026 in the United States.

curl -X GET "https://api.eu.apyhub.com/callable-labs/calculate-business-days-across-countries-markets-api/v1/business-days/next?date=2026-12-25&country=US" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with the result date, the date the search started from and the direction used. skipped lists every day passed over with the reason. It also echoes the calendar settings used.

{
  "date": "2026-12-25",
  "direction": "next",
  "result": "2026-12-28",
  "skipped": [
    { "date": "2026-12-26", "reason": "weekend" },
    { "date": "2026-12-27", "reason": "weekend" }
  ],
  "country": "US",
  "market": null,
  "subdivision": null,
  "categories": ["public"],
  "language": "en",
  "calendar_version": "2026.10"
}
TRY ITLIVE · 5 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.

About this endpoint

What it does

Returns the first business day after date, or before it when direction=previous. The response lists every day that was passed over and the reason, such as a weekend or a holiday.

Query Parameter(s)

AttributeTypeDescription
dateStringDate to start from (YYYY-MM-DD). Default: today (UTC).
directionStringSearch forwards (next) or backwards (previous). Default: next.
include_dateBooleanReturn date itself when it is a business day. Default: false.
countryStringISO 3166-1 alpha-2 or alpha-3 country code, such as US or DEU. Give country or market.
marketStringExchange MIC or acronym, such as XNYS or NYSE. Give country or market.
subdivisionStringState, province or region code or name, such as CA, BY or Bayern.
categoriesStringComma-separated holiday categories, such as public,bank. Default: the calendar's main category (usually public).
excludeStringExtra closed dates as comma-separated ISO dates (at most 366), for example company shutdown days.
weekendStringOverride the weekend with weekday names or abbreviations, such as sat,sun or fri,sat, or none. Default: the calendar's own weekend.

Response

Returns a JSON object with the result and the days that were skipped.

ParameterTypeDescription
resultStringThe business day found (YYYY-MM-DD).
dateStringThe date the search started from.
directionStringSearch direction used.
skippedObject ArrayDays passed over, each with a date and a reason.
countryStringCountry code of the calendar, or null.
marketStringExchange code of the calendar, or null.
subdivisionStringSubdivision used, if any.
categoriesString ArrayHoliday categories applied.
languageStringLanguage of the holiday names.
calendar_versionStringVersion of the calendar data used.
▣ 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.