apyhub
Back
▣ HR · STANDARD DATA

Working Day Calculator API

Hosted on ApyHub

What it does

The Working Day Calculator API counts the business days between two dates for a country. Send a country code, a start date and an end date, and get back the number of working days with weekends and that country's public holidays already excluded.

It is one GET endpoint with three required parameters: country, such as DE, and start and end dates in YYYY-MM-DD format. The response gives you the full breakdown in a data object: total_days for the calendar days in the range, counting both the start and end date, weekends for the Saturdays and Sundays, holidays for the public holidays that fall on a weekday, and working_days for the Monday to Friday days that remain. For January 2025 in Germany, that is 31 total days, 8 weekend days, 1 holiday and 22 working days.

Common uses include calculating pay periods and prorated salaries in payroll, measuring SLA and support response windows in business days, estimating delivery and lead times, counting leave days in HR tools, and setting deadlines that skip non-working days. Because the holidays come from each country's calendar, you do not have to maintain your own holiday list for every market you operate in.

To see which dates are holidays, not just how many there are, use the Public Holidays API. For more business-day math, try the Business Days Calculator. If your team works across regions, the Convert Timezone and Meeting Planner helps you find times that work for everyone.

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

The API is also available through ApyHub MCP, so AI agents can count working days directly when they plan deadlines or schedules.

GET
Count working days between two dates
https://api.eu.apyhub.com/apyhub/count-working-days

QUICKSTART

GUIDE

Quickstart

Count the working days between two dates for a country.

curl -X GET "https://api.eu.apyhub.com/apyhub/count-working-days?country=DE&start=2025-01-01&end=2025-01-31" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with a data object containing holidays, weekends, total_days, and working_days integer fields.

{
  "data": {
    "holidays": 1,
    "weekends": 8,
    "total_days": 31,
    "working_days": 22
  }
}
TRY ITLIVE · 15 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

Calculates the number of working days between two dates for a given country. The response returns a data object with the calendar-day breakdown and the resulting working-day count.

Query Parameter(s)

AttributeTypeMandatoryDescription
countryStringYesCountry code.
startStringYesStart date in date format.
endStringYesEnd date in date format.

Response

Returns a JSON object with a data object field. The data object contains integer counts for holidays, weekends, total_days, and working_days.

AttributeTypeMandatoryDescription
dataObjectNoResult object containing the working-day breakdown.
data.holidaysIntegerNoPublic holidays that fell on a weekday (reduced working day count).
data.weekendsIntegerNoSaturday and Sunday days in the range.
data.total_daysIntegerNoCalendar days between start and end (inclusive).
data.working_daysIntegerNoMon–Fri days excluding public holidays.
▣ 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.