calendar.business-days
Count business days in [startDate, endDate) or add signed business days from startDate. Weekends and observed public holidays are excluded.
https://api.kanagu.dev/v1/calendar/business-days- Price
- $0.001 per successful call
- Without a key
- 10 free calls per IP per UTC day, shared by REST and MCP.
- MCP tool
calendar.business-daysathttps://api.kanagu.dev/mcp- Markdown
- /docs/calendar.business-days.md
curl https://api.kanagu.dev/v1/calendar/business-days \
-H "Content-Type: application/json" \
-d '{"country":"US","startDate":"2026-11-25","days":2}'curl https://api.kanagu.dev/v1/calendar/business-days \
-H "Authorization: Bearer $KANAGU_KEY" \
-H "Content-Type: application/json" \
-d '{"country":"US","startDate":"2026-11-25","days":2}'const res = await fetch("https://api.kanagu.dev/v1/calendar/business-days", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KANAGU_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"country": "US",
"startDate": "2026-11-25",
"days": 2
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const result = await res.json();{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "calendar.business-days",
"arguments": {
"country": "US",
"startDate": "2026-11-25",
"days": 2
}
}
}{
"country": "US",
"startDate": "2026-11-25",
"days": 2
}Request body
application/json
country"AD" | "AE" | "AG" | "AI" | "AL" | "AM" | … (207 values)required- Country or territory code. GB defaults to England and Wales.
subdivisionstring (max 24 chars)- date-holidays subdivision code, e.g. CA or US-CA, BY or DE-BY, SCT or GB-SCT.
startDatestring (date)required- Calendar date (YYYY-MM-DD), 2020–2035.
Then exactly one of these 2 shapes:
1. With endDate
endDatestring (date)required- Exclusive end date (2020–2035).
2. With days
daysinteger (-4000 to 4000)required- Signed number of business days. The start date is skipped.
Response
200 · application/json
country"AD" | "AE" | "AG" | "AI" | "AL" | "AM" | … (207 values)required- Country or territory code. GB defaults to England and Wales.
businessDaysinteger (-9007199254740991 to 9007199254740991)- Count mode result.
datestring (date)- Add mode result.
Try it
Errors
Errors are JSON {"error":{"code","message"}}. An operation may add its own 400 codes; the message says what to fix.
| Status | Code and meaning |
|---|---|
| 400 | invalid_inputThe body does not match the request schema. The message names each field. |
| 400 | invalid_jsonThe body is missing or is not valid JSON. |
| 400 | invalid_idempotency_keyIdempotency-Key must be 1–128 visible ASCII characters. |
| 401 | invalid_api_keyThe Bearer key is missing, malformed, invalid or inactive. |
| 402 | free_allowance_exhaustedThis month's free usage is used up and the account has no subscription. Subscribe from the dashboard, or wait for the next UTC month; Retry-After gives the seconds left. |
| 404 | not_foundNo operation at this path. |
| 409 | idempotency_conflictThe Idempotency-Key was already used with a different body. |
| 413 | payload_too_largeJSON bodies may be at most 64 KiB. |
| 429 | trial_limitThe anonymous trial allows 10 calls per IP per UTC day, shared by REST and MCP. Retry-After gives the seconds left. |
| 500 | internal_errorThe call failed on our side. It is not billed; retry with the same Idempotency-Key. |
JSON Schema
Request schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "object",
"properties": {
"country": {
"type": "string",
"enum": [
"AD",
"AE",
"AG",
"AI",
"AL",
"AM",
"AO",
"AR",
"AS",
"AT",
"AU",
"AW",
"AX",
"AZ",
"BA",
"BB",
"BD",
"BE",
"BF",
"BG",
"BH",
"BI",
"BJ",
"BL",
"BM",
"BN",
"BO",
"BQ",
"BR",
"BS",
"BW",
"BY",
"BZ",
"CA",
"CC",
"CD",
"CF",
"CG",
"CH",
"CI",
"CK",
"CL",
"CM",
"CN",
"CO",
"CR",
"CU",
"CV",
"CW",
"CX",
"CY",
"CZ",
"DE",
"DJ",
"DK",
"DM",
"DO",
"DZ",
"EC",
"EE",
"EG",
"EH",
"ER",
"ES",
"ET",
"FI",
"FJ",
"FO",
"FR",
"GA",
"GB",
"GD",
"GE",
"GF",
"GG",
"GH",
"GI",
"GL",
"GM",
"GN",
"GP",
"GQ",
"GR",
"GT",
"GU",
"GW",
"GY",
"HK",
"HN",
"HR",
"HT",
"HU",
"IC",
"ID",
"IE",
"IL",
"IM",
"IN",
"IR",
"IS",
"IT",
"JE",
"JM",
"JP",
"KE",
"KM",
"KN",
"KR",
"KY",
"KZ",
"LC",
"LI",
"LK",
"LR",
"LS",
"LT",
"LU",
"LV",
"LY",
"MA",
"MC",
"MD",
"ME",
"MF",
"MG",
"MK",
"ML",
"MQ",
"MR",
"MS",
"MT",
"MU",
"MW",
"MX",
"MY",
"MZ",
"NA",
"NC",
"NE",
"NF",
"NG",
"NI",
"NL",
"NO",
"NZ",
"PA",
"PE",
"PF",
"PH",
"PK",
"PL",
"PM",
"PR",
"PT",
"PY",
"RE",
"RO",
"RS",
"RU",
"RW",
"SA",
"SC",
"SD",
"SE",
"SG",
"SH",
"SI",
"SJ",
"SK",
"SL",
"SM",
"SN",
"SO",
"SR",
"SS",
"ST",
"SV",
"SX",
"SZ",
"TC",
"TD",
"TG",
"TH",
"TN",
"TO",
"TR",
"TT",
"TW",
"TZ",
"UA",
"UG",
"US",
"UY",
"UZ",
"VA",
"VC",
"VE",
"VG",
"VI",
"VN",
"VU",
"WF",
"XK",
"YT",
"ZA",
"ZM",
"ZW"
],
"description": "Country or territory code. GB defaults to England and Wales."
},
"subdivision": {
"description": "date-holidays subdivision code, e.g. CA or US-CA, BY or DE-BY, SCT or GB-SCT.",
"type": "string",
"maxLength": 24,
"pattern": "^[A-Z0-9]+(?:-[A-Z0-9]+){0,2}$"
},
"startDate": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
"description": "Calendar date (YYYY-MM-DD), 2020–2035."
},
"endDate": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
"description": "Exclusive end date (2020–2035)."
}
},
"required": [
"country",
"startDate",
"endDate"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"country": {
"type": "string",
"enum": [
"AD",
"AE",
"AG",
"AI",
"AL",
"AM",
"AO",
"AR",
"AS",
"AT",
"AU",
"AW",
"AX",
"AZ",
"BA",
"BB",
"BD",
"BE",
"BF",
"BG",
"BH",
"BI",
"BJ",
"BL",
"BM",
"BN",
"BO",
"BQ",
"BR",
"BS",
"BW",
"BY",
"BZ",
"CA",
"CC",
"CD",
"CF",
"CG",
"CH",
"CI",
"CK",
"CL",
"CM",
"CN",
"CO",
"CR",
"CU",
"CV",
"CW",
"CX",
"CY",
"CZ",
"DE",
"DJ",
"DK",
"DM",
"DO",
"DZ",
"EC",
"EE",
"EG",
"EH",
"ER",
"ES",
"ET",
"FI",
"FJ",
"FO",
"FR",
"GA",
"GB",
"GD",
"GE",
"GF",
"GG",
"GH",
"GI",
"GL",
"GM",
"GN",
"GP",
"GQ",
"GR",
"GT",
"GU",
"GW",
"GY",
"HK",
"HN",
"HR",
"HT",
"HU",
"IC",
"ID",
"IE",
"IL",
"IM",
"IN",
"IR",
"IS",
"IT",
"JE",
"JM",
"JP",
"KE",
"KM",
"KN",
"KR",
"KY",
"KZ",
"LC",
"LI",
"LK",
"LR",
"LS",
"LT",
"LU",
"LV",
"LY",
"MA",
"MC",
"MD",
"ME",
"MF",
"MG",
"MK",
"ML",
"MQ",
"MR",
"MS",
"MT",
"MU",
"MW",
"MX",
"MY",
"MZ",
"NA",
"NC",
"NE",
"NF",
"NG",
"NI",
"NL",
"NO",
"NZ",
"PA",
"PE",
"PF",
"PH",
"PK",
"PL",
"PM",
"PR",
"PT",
"PY",
"RE",
"RO",
"RS",
"RU",
"RW",
"SA",
"SC",
"SD",
"SE",
"SG",
"SH",
"SI",
"SJ",
"SK",
"SL",
"SM",
"SN",
"SO",
"SR",
"SS",
"ST",
"SV",
"SX",
"SZ",
"TC",
"TD",
"TG",
"TH",
"TN",
"TO",
"TR",
"TT",
"TW",
"TZ",
"UA",
"UG",
"US",
"UY",
"UZ",
"VA",
"VC",
"VE",
"VG",
"VI",
"VN",
"VU",
"WF",
"XK",
"YT",
"ZA",
"ZM",
"ZW"
],
"description": "Country or territory code. GB defaults to England and Wales."
},
"subdivision": {
"description": "date-holidays subdivision code, e.g. CA or US-CA, BY or DE-BY, SCT or GB-SCT.",
"type": "string",
"maxLength": 24,
"pattern": "^[A-Z0-9]+(?:-[A-Z0-9]+){0,2}$"
},
"startDate": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
"description": "Calendar date (YYYY-MM-DD), 2020–2035."
},
"days": {
"type": "integer",
"minimum": -4000,
"maximum": 4000,
"description": "Signed number of business days. The start date is skipped."
}
},
"required": [
"country",
"startDate",
"days"
],
"additionalProperties": false
}
],
"examples": [
{
"country": "US",
"startDate": "2026-11-25",
"days": 2
}
],
"type": "object"
}Response schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"country": {
"type": "string",
"enum": [
"AD",
"AE",
"AG",
"AI",
"AL",
"AM",
"AO",
"AR",
"AS",
"AT",
"AU",
"AW",
"AX",
"AZ",
"BA",
"BB",
"BD",
"BE",
"BF",
"BG",
"BH",
"BI",
"BJ",
"BL",
"BM",
"BN",
"BO",
"BQ",
"BR",
"BS",
"BW",
"BY",
"BZ",
"CA",
"CC",
"CD",
"CF",
"CG",
"CH",
"CI",
"CK",
"CL",
"CM",
"CN",
"CO",
"CR",
"CU",
"CV",
"CW",
"CX",
"CY",
"CZ",
"DE",
"DJ",
"DK",
"DM",
"DO",
"DZ",
"EC",
"EE",
"EG",
"EH",
"ER",
"ES",
"ET",
"FI",
"FJ",
"FO",
"FR",
"GA",
"GB",
"GD",
"GE",
"GF",
"GG",
"GH",
"GI",
"GL",
"GM",
"GN",
"GP",
"GQ",
"GR",
"GT",
"GU",
"GW",
"GY",
"HK",
"HN",
"HR",
"HT",
"HU",
"IC",
"ID",
"IE",
"IL",
"IM",
"IN",
"IR",
"IS",
"IT",
"JE",
"JM",
"JP",
"KE",
"KM",
"KN",
"KR",
"KY",
"KZ",
"LC",
"LI",
"LK",
"LR",
"LS",
"LT",
"LU",
"LV",
"LY",
"MA",
"MC",
"MD",
"ME",
"MF",
"MG",
"MK",
"ML",
"MQ",
"MR",
"MS",
"MT",
"MU",
"MW",
"MX",
"MY",
"MZ",
"NA",
"NC",
"NE",
"NF",
"NG",
"NI",
"NL",
"NO",
"NZ",
"PA",
"PE",
"PF",
"PH",
"PK",
"PL",
"PM",
"PR",
"PT",
"PY",
"RE",
"RO",
"RS",
"RU",
"RW",
"SA",
"SC",
"SD",
"SE",
"SG",
"SH",
"SI",
"SJ",
"SK",
"SL",
"SM",
"SN",
"SO",
"SR",
"SS",
"ST",
"SV",
"SX",
"SZ",
"TC",
"TD",
"TG",
"TH",
"TN",
"TO",
"TR",
"TT",
"TW",
"TZ",
"UA",
"UG",
"US",
"UY",
"UZ",
"VA",
"VC",
"VE",
"VG",
"VI",
"VN",
"VU",
"WF",
"XK",
"YT",
"ZA",
"ZM",
"ZW"
],
"description": "Country or territory code. GB defaults to England and Wales."
},
"businessDays": {
"description": "Count mode result.",
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"date": {
"description": "Add mode result.",
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
}
},
"required": [
"country"
],
"additionalProperties": false
}