DocsTry itStatusPricing

GET /v1/business-days

GET /v1/business-days?country=&from=&to= counts business days between two dates for one country. Both ends of the range count.

Live

Parameters

ParameterNotes
countrySets both the holiday list and the weekend rule.
from, toYYYY-MM-DD, inside 2026. to must be on or after from.

How the count works, with the January numbers

January 2026 in the US has 31 calendar days. 9 of them are weekend days. New Year's Day and Martin Luther King Jr. Day fall on weekdays. 31 minus 9 minus 2 gives 20, and 20 is what the endpoint returns. Run it in the try-it panel and check the arithmetic yourself.

For Saudi Arabia and Israel the weekend is Friday and Saturday, so a Sunday in Riyadh counts and a Friday does not. The business-day rules guide works through the edge cases.

Response fields

FieldMeaning
business_daysCount for the range, both endpoints included.
total_daysCalendar days in the same range.
weekend_daysDays excluded as weekend days.
holidays_in_rangeWeekday holidays inside the range, with dates and names.

Examples you can run

curl:

curl -s "https://api.kingai.work/v1/business-days?country=US&from=2026-01-01&to=2026-01-31"

Python:

import requests
j = requests.get('https://api.kingai.work/v1/business-days',
  params={'country':'US','from':'2026-01-01','to':'2026-01-31'}).json()
print(j['business_days'])  # 20

Error codes

HTTPCodeMeaning
400invalid_parameterA parameter is missing or malformed, for example a date that is not YYYY-MM-DD.
404country_not_foundThe country code is not in the covered set of 12.
404year_not_coveredOnly 2026 is in the dataset. Other years return this error instead of a guess.

Errors use one shape: {"error": {"code": "...", "message": "..."}}. Try the bad-country button in the console to see one.