Business Days

Premium
ℹ️

Note: This is a premium API section. You need an active subscription to access these endpoints. View pricing

Calculate business days across countries and regions, accounting for weekends, public holidays, and regional variations. Supports general business days, banking days, and government days.

Standards Used

  • ISO 8601
  • ISO 3166-1
  • ISO 3166-2

Additional Information#

Day Types#

TypeExcludes
businessWeekends + public holidays
bankingWeekends + public holidays + bank holidays
governmentWeekends + public holidays + authority holidays

Regional Precision#

Querying a region (e.g., US-CA) includes both national and regional holidays. California's César Chávez Day (March 31) affects US-CA but not US-TX.

Workweek Handling#

Each location has a standard workweek. Most countries use Monday-Friday. Israel and much of the Middle East use Sunday-Thursday. The workweek field in responses makes this explicit and can be used programmatically.

Conditional Fields#

The check endpoint only includes next_business_day and prev_business_day when the queried date is not a business day.

Endpoints#

Path Parameters

ParameterTypeRequiredDescription
locationpathstringYesCountry code (alpha-2) or region code
Example: US

Query Parameters

ParameterTypeRequiredDescription
datequerystringNoDate to check in YYYY-MM-DD format (defaults to today).
Example: 2025-01-15
typequeryanyNoType of day to check: business, banking, or government.
Example: business

Response

FieldTypeRequiredDescription
datestringYesThe date that was checked.
Example: 2025-01-15
holidaynull | objectNo
is_business_daybooleanYesWhether the date is a business day.
Example: true
locationstringYesLocation code (country alpha-2 or region code).
Example: US
next_business_daystringNoNext business day if the date is not a business day.
Example: 2025-01-16
prev_business_daystringNoPrevious business day if the date is not a business day.
Example: 2025-01-14
reasonstringNoReason if not a business day: "weekend" or "holiday".
Example: holiday
typestringYesThe type of day checked.
Example: business
workweekstring[]YesDays of the week that are working days in this location.
Example: ["monday","tuesday","wednesday","thursday","friday"]

Example Request

const response = await fetch(
  'https://worlddataapi.com/v1/business-days/US?date=2025-01-15&type=business',
  {
    headers: {
      'X-API-Key': 'YOUR_API_KEY'
    }
  }
);

const data = await response.json();

Error Responses

StatusDescription
400Invalid parameters
402Premium subscription required
404Location not found
429Rate limit exceeded

Path Parameters

ParameterTypeRequiredDescription
locationpathstringYesCountry code (alpha-2) or region code
Example: US

Query Parameters

ParameterTypeRequiredDescription
startquerystringNoStart date in YYYY-MM-DD format (defaults to today).
Example: 2025-01-15
daysqueryinteger (int32)YesNumber of business days to add (must be positive).
Example: 5
typequeryanyNoType of day to count: business, banking, or government.
Example: business

Response

FieldTypeRequiredDescription
daysinteger (int32)YesNumber of business days added.
Example: 5
locationstringYesLocation code (country alpha-2 or region code).
Example: US
resultstringYesThe resulting date after adding business days.
Example: 2025-01-22
startstringYesThe starting date.
Example: 2025-01-15
typestringYesThe type of day counted.
Example: business
workweekstring[]YesDays of the week that are working days in this location.
Example: ["monday","tuesday","wednesday","thursday","friday"]

Example Request

const response = await fetch(
  'https://worlddataapi.com/v1/business-days/US/add?start=2025-01-15&days=5',
  {
    headers: {
      'X-API-Key': 'YOUR_API_KEY'
    }
  }
);

const data = await response.json();

Error Responses

StatusDescription
400Invalid parameters
402Premium subscription required
404Location not found
429Rate limit exceeded

Path Parameters

ParameterTypeRequiredDescription
locationpathstringYesCountry code (alpha-2) or region code
Example: US

Query Parameters

ParameterTypeRequiredDescription
startquerystringYesStart date (inclusive) in YYYY-MM-DD format.
Example: 2025-01-01
endquerystringYesEnd date (inclusive) in YYYY-MM-DD format.
Example: 2025-01-31
typequeryanyNoType of day to count: business, banking, or government.
Example: business

Response

FieldTypeRequiredDescription
business_daysinteger (int64)YesNumber of business days in the range.
Example: 22
endstringYesEnd date of the range.
Example: 2025-01-31
holiday_listobject[]YesList of holidays within the range.
holidaysinteger (int64)YesNumber of holidays that fall on weekdays.
Example: 1
locationstringYesLocation code (country alpha-2 or region code).
Example: US
startstringYesStart date of the range.
Example: 2025-01-01
total_daysinteger (int64)YesTotal calendar days in the range.
Example: 31
typestringYesThe type of day counted.
Example: business
weekend_daysinteger (int64)YesNumber of weekend days in the range.
Example: 8
workweekstring[]YesDays of the week that are working days in this location.
Example: ["monday","tuesday","wednesday","thursday","friday"]

Example Request

const response = await fetch(
  'https://worlddataapi.com/v1/business-days/US/count?start=2025-01-01&end=2025-01-31',
  {
    headers: {
      'X-API-Key': 'YOUR_API_KEY'
    }
  }
);

const data = await response.json();

Error Responses

StatusDescription
400Invalid parameters
402Premium subscription required
404Location not found
429Rate limit exceeded

Path Parameters

ParameterTypeRequiredDescription
locationpathstringYesCountry code (alpha-2) or region code
Example: US

Query Parameters

ParameterTypeRequiredDescription
fromquerystringNoStart date in YYYY-MM-DD format (defaults to today).
Example: 2025-01-15
typequeryanyNoType of day to find: business, banking, or government.
Example: business

Response

FieldTypeRequiredDescription
days_untilinteger (int64)YesNumber of calendar days until the next business day.
Example: 1
fromstringYesThe starting date.
Example: 2025-01-15
locationstringYesLocation code (country alpha-2 or region code).
Example: US
nextstringYesThe next business day.
Example: 2025-01-16
typestringYesThe type of day searched.
Example: business

Example Request

const response = await fetch(
  'https://worlddataapi.com/v1/business-days/US/next?from=2025-01-15&type=business',
  {
    headers: {
      'X-API-Key': 'YOUR_API_KEY'
    }
  }
);

const data = await response.json();

Error Responses

StatusDescription
400Invalid parameters
402Premium subscription required
404Location not found
429Rate limit exceeded

Path Parameters

ParameterTypeRequiredDescription
locationpathstringYesCountry code (alpha-2) or region code
Example: US

Query Parameters

ParameterTypeRequiredDescription
startquerystringNoStart date in YYYY-MM-DD format (defaults to today).
Example: 2025-01-15
daysqueryinteger (int32)YesNumber of business days to subtract (must be positive).
Example: 5
typequeryanyNoType of day to count: business, banking, or government.
Example: business

Response

FieldTypeRequiredDescription
daysinteger (int32)YesNumber of business days subtracted.
Example: 5
locationstringYesLocation code (country alpha-2 or region code).
Example: US
resultstringYesThe resulting date after subtracting business days.
Example: 2025-01-08
startstringYesThe starting date.
Example: 2025-01-15
typestringYesThe type of day counted.
Example: business
workweekstring[]YesDays of the week that are working days in this location.
Example: ["monday","tuesday","wednesday","thursday","friday"]

Example Request

const response = await fetch(
  'https://worlddataapi.com/v1/business-days/US/subtract?start=2025-01-15&days=5',
  {
    headers: {
      'X-API-Key': 'YOUR_API_KEY'
    }
  }
);

const data = await response.json();

Error Responses

StatusDescription
400Invalid parameters
402Premium subscription required
404Location not found
429Rate limit exceeded