Holidays for a year
Good to know. Religious holidays require official confirmation. An estimate is not confirmation. Weekends: Saturday and Sunday; date ranges are limited to 366 days.
Understand the context
The common public-administration calendar uses Saturday and Sunday as weekends. Religious holidays may await official confirmation: null means unknown, not a guaranteed working day. Business calendars may differ.
Read the response
data: The requested results, as an object or an array.
meta: Dataset sources, license and dates. null means unknown or unavailable.
API v2 is the canonical path. Older /api/v1 paths remain compatibility aliases for the currently published behavior, including pagination; no removal date is scheduled.
Response fields 11
[] means each item in a list. null means unknown or unavailable, never zero. The guide language does not translate source values.
dataobject[]Requested result: a single object or a list.
data[].idstringIdentifier of this item in the dataset; not necessarily an official code.
data[].datestring | nullCalendar date in YYYY-MM-DD format; null if awaiting confirmation.
data[].namesobjectHoliday names in the available languages.
data[].names.arstringArabic value; null when no translation is provided.
data[].names.frstringFrench value; null when no translation is provided.
data[].names.enstringEnglish value; null when no translation is provided.
data[].typestringnational: national civic holiday; religious: religious holiday whose date may await an official announcement.
Accepted values:
"national""religious"data[].statusstringfixed: fixed calendar date; confirmed: confirmed religious date; pending_confirmation: date not yet confirmed.
Accepted values:
"fixed""confirmed""pending_confirmation"data[].dayintegerDay within a multi-day holiday: 1 for the first day, 2 for the second.
data[].source_urlsstring[]Links to publications supporting this holiday and its date.
Data structure
{
"type": "object",
"additionalProperties": false,
"required": [
"data",
"meta"
],
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"date",
"names",
"type",
"status",
"day",
"source_urls"
],
"properties": {
"id": {
"type": "string"
},
"date": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"format": "date"
},
{
"type": "string",
"nullable": true,
"enum": [
null
]
}
]
},
"names": {
"type": "object",
"additionalProperties": false,
"required": [
"ar",
"fr",
"en"
],
"properties": {
"ar": {
"type": "string"
},
"fr": {
"type": "string"
},
"en": {
"type": "string"
}
}
},
"type": {
"type": "string",
"enum": [
"national",
"religious"
]
},
"status": {
"type": "string",
"enum": [
"fixed",
"confirmed",
"pending_confirmation"
]
},
"day": {
"type": "integer",
"minimum": 1,
"maximum": 2
},
"source_urls": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
}
}
},
"meta": {
"type": "object",
"additionalProperties": false,
"required": [
"dataset",
"total",
"license",
"license_url",
"reviewed_at",
"transformation_version",
"scope",
"weekend_days",
"years",
"calendar_complete",
"pending_holiday_days",
"sources",
"limitations"
],
"properties": {
"dataset": {
"enum": [
"moroccan-public-holidays"
]
},
"total": {
"type": "integer",
"minimum": 0
},
"license": {
"type": "string"
},
"license_url": {
"type": "string"
},
"reviewed_at": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"format": "date"
},
"transformation_version": {
"type": "string"
},
"scope": {
"enum": [
"public-administration-common-calendar"
]
},
"weekend_days": {
"type": "array",
"items": {
"type": "string",
"enum": [
"Saturday",
"Sunday"
]
}
},
"years": {
"type": "array",
"items": {
"type": "integer"
}
},
"calendar_complete": {
"type": "boolean"
},
"pending_holiday_days": {
"type": "integer",
"minimum": 0
},
"sources": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"producer",
"source_url",
"source_updated_at"
],
"properties": {
"producer": {
"type": "string"
},
"source_url": {
"type": "string"
},
"source_updated_at": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"format": "date"
},
{
"type": "string",
"nullable": true,
"enum": [
null
]
}
]
}
}
}
},
"limitations": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}Sources and pagination 17
metaobjectResult context: sources, dates, license and pagination where applicable.
meta.datasetstringName of the dataset for this result or source.
Accepted values:
"moroccan-public-holidays"meta.totalintegerNumber of matching records before pagination; not the size of this page.
meta.licensestringReuse license. mixed means licenses differ: inspect each source.
meta.license_urlstringLink to the license terms; null when no URL is supplied.
meta.reviewed_atstringDate the calendar sources were last reviewed.
meta.transformation_versionstringVersion of the dataset conversion rules; separate from the API version.
meta.scopestringScope covered by the dataset; does not imply universal coverage.
Accepted values:
"public-administration-common-calendar"meta.weekend_daysstring[]Weekend day names in meta; in data, the number of weekend days in the interval.
meta.yearsinteger[]Years covered by the calendar.
meta.calendar_completebooleantrue when all required dates in the requested calendar are confirmed.
meta.pending_holiday_daysintegerNumber of holiday days whose dates await official confirmation.
meta.sourcesobject[]Sources used for this result, with their publishers and licenses.
meta.sources[].producerstringOrganization publishing the original data.
meta.sources[].source_urlstringSource publication or dataset landing page.
meta.sources[].source_updated_atstring | nullLast update reported by the source; not the retrieval date.
meta.limitationsstring[]Known source or coverage limitations; read before using the data.
Errors
400: Invalid or missing parameter.
Errors return error.code, error.message and error.request_id.
errorobjectDetails of a failed request; replaces data and meta.
error.codestringStable error code, such as RESOURCE_NOT_FOUND; use it in application logic.
error.messagestringHuman-readable error explanation; use code for application logic.
error.request_idstringIdentifier for this request, useful when reporting a problem.