Data source: Nager.Date
Overview
Nager.Date (Holidays) wraps Nager.Date, handling authentication, pagination, and rate limits for you. This tutorial covers all 5 tools with working code examples you can copy and run.
Prerequisites
- Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
- Choose your integration method: MCP protocol or REST API.
Connect via MCP
Add to your MCP client config (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"gnist-nager-date": {
"url": "https://context.gnist.ai/mcp/nager-date/",
"headers": {
"Gnist-API-Key": "YOUR_API_KEY"
}
}
}
}
Tools (5)
check_holiday
Check whether a given date is a public holiday in a country. Args: date: Date to check in ISO 8601 format (YYYY-MM-DD). country_code: ISO 3166-1 alpha-2 country code (e.g. 'NO', 'US', 'DE'). region_code: Optional ISO 3166-2 region code (e.g. 'US-CA', 'DE-BY'). Returns: Dictionary with is_holiday (bool) and holiday_names (list of matching names).
| Parameter | Type | Required | Description |
|---|---|---|---|
date | string | required | Date to check in ISO 8601 format (YYYY-MM-DD). |
country_code | string | required | ISO 3166-1 alpha-2 country code (e.g. 'NO', 'US', 'DE'). |
region_code | any | optional | Optional ISO 3166-2 region code (e.g. 'US-CA', 'DE-BY'). |
curl -X POST "https://context.gnist.ai/mcp/nager-date/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "check_holiday", "arguments": {"date": "2025-01-15", "country_code": "'NO'"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/nager-date/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'country_code': "'NO'", 'date': '2025-01-15'},
'name': 'check_holiday'}},
)
print(resp.json())
list_public_holidays
List all public holidays for a country in a given year. Args: country_code: ISO 3166-1 alpha-2 country code (e.g. 'NO', 'US', 'DE'). year: The year (e.g. 2026). Returns: Dictionary with count and holidays list. Each holiday has date, name, local_name, global flag, counties, and types.
| Parameter | Type | Required | Description |
|---|---|---|---|
country_code | string | required | ISO 3166-1 alpha-2 country code (e.g. 'NO', 'US', 'DE'). |
year | integer | required | The year (e.g. 2026). |
curl -X POST "https://context.gnist.ai/mcp/nager-date/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "list_public_holidays", "arguments": {"country_code": "'NO'", "year": 2026}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/nager-date/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'country_code': "'NO'", 'year': 2026},
'name': 'list_public_holidays'}},
)
print(resp.json())
get_next_business_day
Find the next business day on or after a given date, skipping weekends and holidays. Args: date: Starting date in ISO 8601 format (YYYY-MM-DD). country_code: ISO 3166-1 alpha-2 country code (e.g. 'NO', 'US', 'DE'). Returns: Dictionary with next_business_day date and days_skipped count.
| Parameter | Type | Required | Description |
|---|---|---|---|
date | string | required | Starting date in ISO 8601 format (YYYY-MM-DD). |
country_code | string | required | ISO 3166-1 alpha-2 country code (e.g. 'NO', 'US', 'DE'). |
curl -X POST "https://context.gnist.ai/mcp/nager-date/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_next_business_day", "arguments": {"date": "2025-01-15", "country_code": "'NO'"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/nager-date/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'country_code': "'NO'", 'date': '2025-01-15'},
'name': 'get_next_business_day'}},
)
print(resp.json())
count_business_days
Count business days between two dates (inclusive of start, exclusive of end). Args: start_date: Start date in ISO 8601 format (YYYY-MM-DD). end_date: End date in ISO 8601 format (YYYY-MM-DD). Not included in the count. country_code: ISO 3166-1 alpha-2 country code (e.g. 'NO', 'US', 'DE'). Returns: Dictionary with business_days count and calendar_days in the range.
| Parameter | Type | Required | Description |
|---|---|---|---|
start_date | string | required | Start date in ISO 8601 format (YYYY-MM-DD). |
end_date | string | required | End date in ISO 8601 format (YYYY-MM-DD). Not included in the count. |
country_code | string | required | ISO 3166-1 alpha-2 country code (e.g. 'NO', 'US', 'DE'). |
curl -X POST "https://context.gnist.ai/mcp/nager-date/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "count_business_days", "arguments": {"start_date": "2025-01-15", "end_date": "2025-01-15", "country_code": "'NO'"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/nager-date/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'country_code': "'NO'",
'end_date': '2025-01-15',
'start_date': '2025-01-15'},
'name': 'count_business_days'}},
)
print(resp.json())
report_feedback
Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: general) |
curl -X POST "https://context.gnist.ai/mcp/nager-date/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/nager-date/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())
Common Patterns
Use
list_public_holidays to find items, then get_next_business_day to get full details. This two-step pattern is common for exploring data before drilling down.Use date range parameters to narrow results to a specific time window. Dates are typically in
YYYY-MM-DD format.FAQ
What data does Nager.Date (Holidays) provide?
Public holidays by country and year — dates, names, and types. It exposes 5 tools: check_holiday, list_public_holidays, get_next_business_day, count_business_days, report_feedback.
What do I need to get started?
A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.
What format does the Nager.Date (Holidays) API return?
JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.