Working Days API
Range + offset
US / DE / IN
Custom holidays

Count business days.With holidays handled.

Range mode for counting working days between two dates, offset mode for adding or subtracting them. Built-in holiday calendars for US, DE, and IN — plus a custom holiday list when yours differ.

2 modes · range + offset3 regions · built-inCustom · holiday listsBatch · supported

Why Working Days API

Date math that respects the holidays.

Range Mode
Count the working days between two dates. Toggle include_start to choose whether the first day counts.
Offset Mode
Add or subtract working days from a base date. Set direction to "forward" or "backward".
Regional Holidays
Built-in calendars for US, DE, and IN. Pick a region and the holidays for that locale are excluded.
Custom Holidays
Pass an array of additional dates (e.g. company holidays) to exclude on top of regional ones.
Flexible Formats
ISO 8601, US slash, European slash, or any dayjs format — pass date_format if it's non-standard.
Batch Processing
Calculate many ranges/offsets in a single POST. Same shape — just wrap them in a `batch` array.

/api/v1/working-days

Endpoints, at a glance.

Same calculation logic across GET and POST. Pick the shape your client speaks.

POST/working-days/calculate
Calculate (single or batch)
Range or offset mode. Pass a single object or wrap multiple calls in a `batch` array. JSON body, JSON out.
PRIMARY
GET/working-days/calculate
Calculate via query
Same logic, query-param shape. Good for tooling and quick checks.
GET/working-days/calculate/batch
Batch via query
URL-encoded JSON array of requests. Use for automated pipelines that don't send bodies.
GET/health
Service health
Status, version, uptime. Root / redirects here.
GET/metrics
Prometheus metrics
Calculation counters, durations, region distribution.
ParameterTypeRequiredDescription
start_datestringyesBase date. ISO 8601 by default; use date_format for others.
end_datestringeither*End date (range mode). Must be ≥ start_date.
days_offsetnumbereither*Working days to add/subtract (offset mode). Integer.
directionstringno"forward" or "backward" for offset mode. Default forward.
regionstringnoISO 3166-1 alpha-2 code. "US", "DE", "IN" supported. Default US.
custom_holidaysarraynoAdditional holiday dates to exclude on top of regional calendar.
include_startbooleannoWhether to count start_date in range mode. Default true.
api_keystringyesAPI key via query string. Alternatively pass as x-api-key header.

*Provide either end_date (range) or days_offset (offset).

Requests & responses.

Range or offset, single or batch — same calculate endpoint handles all of it.

Range mode
Working days between Jan 15 and Jan 31 in the US calendar.
POST https://datpaq.com/api/v1/working-days/calculate
Content-Type: application/json

{
  "start_date": "2026-01-15",
  "end_date": "2026-01-31",
  "region": "US",
  "include_start": true
}
Offset & batch
Add 10 working days in Germany, or batch up to three calls.
POST https://datpaq.com/api/v1/working-days/calculate
Content-Type: application/json

{
  "start_date": "2026-02-01",
  "days_offset": 10,
  "direction": "forward",
  "region": "DE"
}
Health
https://datpaq.com/api/v1/working-days/health
Metrics
https://datpaq.com/api/v1/working-days/metrics

Error reference

Predictable errors, always structured.

Every error response includes a correlationId for request tracing and a clear error message.

400Missing Parameters
start_date plus one of end_date or days_offset is required. Mixing both is also rejected.
400Invalid Date Format
Date string didn't match the auto-detected formats. Pass date_format to specify a custom pattern.
400Invalid Region
Region must be one of "US", "DE", or "IN". Use custom_holidays for other locales.
400End Before Start
In range mode, end_date must be on or after start_date.
401Unauthorized
API key missing or invalid. Pass api_key as a query param or x-api-key as a header.
500Processing Error
Internal calculation failure. CorrelationId in the response helps with debugging.
Example error response
{
  "success": false,
  "error": "end_date must be on or after start_date",
  "correlationId": "req_abc123def456"
}

FAQ

API questions developers ask first.

How do I authenticate with this API?

Create an API key in your Datpaq dashboard and send it with each request as a bearer token in the Authorization header.

Is there a free tier?

Yes. Datpaq APIs include a free tier for building, testing, and small production workloads before you move to a paid plan.

What format do requests and responses use?

Datpaq APIs use REST over HTTPS and return JSON by default. Endpoint docs show the supported methods, query parameters, request bodies, and response fields.

Where can I see limits and errors?

Each API documents rate limits, validation rules, and error responses in the landing page and API docs so integrations can retry and fail cleanly.

Calendar-aware date math.

Stop building business-day logic by hand. Range mode for counts, offset mode for deadlines, regional holidays handled.