MoroccoAPIDocumentation
API reference

Choose a resource. Set the parameters. Try it.

No API keyJSON responsesOpen CORS

Service status

GET/api/v2/status

Good to know. Check service health and the deployed version.

Parameters

00

No parameters needed.

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.

dataobject

Requested result: a single object or a list.

data.statusstring

Service state; ok means the service is responding.

Accepted values: "ok"

data.servicestring

Name of the responding service.

Accepted values: "MoroccoAPI"

data.versionstring

Software release version, separate from the API path version.

data.timestampstring

Response 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
metaobject

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

meta.request_idstring

Identifier for this request, useful when reporting a problem.

Errors

    Errors return error.code, error.message and error.request_id.

    Your request

    GET · JSON

    Base URL

    Response

    The live response will appear here.

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