MoroccoAPIDocumentation
API reference

Choose a resource. Set the parameters. Try it.

No API keyJSON responsesOpen CORS

Check a date

GET/api/v2/holidays/check

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.

Parameters

01
stringRequired · Query

Civil date in YYYY-MM-DD format.

date
Pattern^\d{4}-\d{2}-\d{2}$
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 16

[] 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.datestring

Calendar date in YYYY-MM-DD format; null if awaiting confirmation.

data.is_weekendboolean

true if the date is Saturday or Sunday in this calendar.

data.is_holidayboolean | null

true for a holiday, false otherwise, null when an unconfirmed date prevents a conclusion.

data.is_business_dayboolean | null

Working day excluding weekends and holidays; null if the calendar cannot determine it.

data.holidaysobject[]

Known holidays matching the requested date.

data.holidays[].idstring

Identifier of this item in the dataset; not necessarily an official code.

data.holidays[].datestring | null

Calendar date in YYYY-MM-DD format; null if awaiting confirmation.

data.holidays[].namesobject

Holiday names in the available languages.

data.holidays[].names.arstring

Arabic value; null when no translation is provided.

data.holidays[].names.frstring

French value; null when no translation is provided.

data.holidays[].names.enstring

English value; null when no translation is provided.

data.holidays[].typestring

national: national civic holiday; religious: religious holiday whose date may await an official announcement.

Accepted values: "national" "religious"

data.holidays[].statusstring

fixed: fixed calendar date; confirmed: confirmed religious date; pending_confirmation: date not yet confirmed.

Accepted values: "fixed" "confirmed" "pending_confirmation"

data.holidays[].dayinteger

Day within a multi-day holiday: 1 for the first day, 2 for the second.

data.holidays[].source_urlsstring[]

Links to publications supporting this holiday and its date.

Data structure
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "data",
    "meta"
  ],
  "properties": {
    "data": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "date",
        "is_weekend",
        "is_holiday",
        "is_business_day",
        "holidays"
      ],
      "properties": {
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "format": "date"
        },
        "is_weekend": {
          "type": "boolean"
        },
        "is_holiday": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "nullable": true,
              "enum": [
                null
              ]
            }
          ]
        },
        "is_business_day": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "nullable": true,
              "enum": [
                null
              ]
            }
          ]
        },
        "holidays": {
          "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
metaobject

Result context: sources, dates, license and pagination where applicable.

meta.datasetstring

Name of the dataset for this result or source.

Accepted values: "moroccan-public-holidays"

meta.totalinteger

Number of matching records before pagination; not the size of this page.

meta.licensestring

Reuse license. mixed means licenses differ: inspect each source.

meta.license_urlstring

Link to the license terms; null when no URL is supplied.

meta.reviewed_atstring

Date the calendar sources were last reviewed.

meta.transformation_versionstring

Version of the dataset conversion rules; separate from the API version.

meta.scopestring

Scope 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_completeboolean

true when all required dates in the requested calendar are confirmed.

meta.pending_holiday_daysinteger

Number of holiday days whose dates await official confirmation.

meta.sourcesobject[]

Sources used for this result, with their publishers and licenses.

meta.sources[].producerstring

Organization publishing the original data.

meta.sources[].source_urlstring

Source publication or dataset landing page.

meta.sources[].source_updated_atstring | null

Last 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.

errorobject

Details of a failed request; replaces data and meta.

error.codestring

Stable error code, such as RESOURCE_NOT_FOUND; use it in application logic.

error.messagestring

Human-readable error explanation; use code for application logic.

error.request_idstring

Identifier for this request, useful when reporting a problem.

Your request

GET · JSON

Base URL

Response

The live response will appear here.

Language changes the guide, not JSON keys or source values.