apyhub
HR · STANDARD DATA

Working Day Calculator API

Hosted on ApyHub

What it does

Working Day Counter calculates how many working days fall between two dates for a given country. Send country, start, and end, and it returns the calendar-day span plus a breakdown of working_days, weekends, and holidays.

Use it when you need date-based business logic that respects local public holidays. For example, payroll systems can compute pay periods, procurement workflows can estimate SLA windows, and scheduling tools can skip non-working days when assigning deadlines.

The response is simple and explicit. total_days gives the inclusive calendar range, weekends counts Saturday and Sunday days in that range, holidays counts public holidays that fall on weekdays, and working_days gives the final Mon–Fri count after excluding those holidays.

Working Day Counter is useful anywhere you need consistent working-time calculations without maintaining your own holiday calendar for every country.

GET
Count working days between two dates
http://localhost:8080/apyhub/count-working-days
QUICKSTARTGUIDE

Quickstart

Count the working days between two dates for a country.

curl -X GET "http://localhost:8080/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.

Query parameters

Name
Type
Description
endREQUIRED
string
startREQUIRED
string
countryREQUIRED
string
▣ 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.