Service status
Good to know. Check service health and the deployed version.
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 5
[] means each item in a list. null means unknown or unavailable, never zero. The guide language does not translate source values.
dataobjectRequested result: a single object or a list.
data.statusstringService state; ok means the service is responding.
Accepted values:
"ok"data.servicestringName of the responding service.
Accepted values:
"MoroccoAPI"data.versionstringSoftware release version, separate from the API path version.
data.timestampstringResponse date and time in ISO 8601 format.
Data structure
{
"type": "object",
"additionalProperties": false,
"required": [
"data",
"meta"
],
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"status",
"service",
"version",
"timestamp"
],
"properties": {
"status": {
"enum": [
"ok"
]
},
"service": {
"enum": [
"MoroccoAPI"
]
},
"version": {
"type": "string"
},
"timestamp": {
"type": "string",
"format": "date-time"
}
}
},
"meta": {
"type": "object",
"additionalProperties": false,
"required": [
"request_id"
],
"properties": {
"request_id": {
"type": "string"
}
}
}
}
}Sources and pagination 2
metaobjectResult context: sources, dates, license and pagination where applicable.
meta.request_idstringIdentifier for this request, useful when reporting a problem.
Errors
Errors return error.code, error.message and error.request_id.