MoroccoAPIالتوثيق
مرجع الواجهة

اختر مورداً. حدّد المعاملات. جرّب الطلب.

دون مفتاح APIإجابات JSONCORS مفتوح

الفقر متعدد الأبعاد على المستوى الوطني

GET/api/v2/population/national/poverty

معلومة مهمة. إحصاء 2024 والسلاسل التاريخية للمندوبية السامية للتخطيط. راجع meta لمعرفة المصدر والتاريخ.

فهم السياق

RGPH هو الإحصاء العام للسكان الذي تنجزه المندوبية السامية للتخطيط HCP. المقيم ليس بالضرورة مغربي الجنسية. مثال توضيحي: 100 مقيم، منهم 95 مغربياً و5 أجانب، يعني مجموعاً من 100؛ لا تجمعهم مرة ثانية. الأرقام توضيحية.

المعاملات

02
stringاختياري · الاستعلام

وسط الإقامة: all (المجموع) أو urban (حضري) أو rural (قروي).

integerاختياري · الاستعلام

سنة من أربعة أرقام.

فهم الإجابة

data: النتائج المطلوبة، في كائن أو قائمة.

meta: مصادر البيانات ورخصتها وتواريخها. تعني null أن القيمة غير معروفة أو غير متاحة.

API v2 هو المسار المرجعي. تبقى مسارات /api/v1 القديمة أسماء بديلة متوافقة مع السلوك المنشور حالياً، بما فيه تقسيم الصفحات؛ لم يُحدد موعد لحذفها.

حقول الإجابة 31

تشير [] إلى كل عنصر في القائمة. تعني null غير معروف أو غير متاح، ولا تعني صفراً. لغة الدليل لا تترجم قيم المصادر.

dataobject

النتيجة المطلوبة: كائن واحد أو قائمة.

data.territoryobject

المجال الترابي الذي تصفه المؤشرات، مع رموزه واسمه.

data.territory.levelstring

المستوى الترابي: national أو regions أو subdivisions (الأقاليم والعمالات) أو prefectures-of-arrondissements أو communes أو arrondissements.

القيم المقبولة: "national" "regions" "subdivisions" "prefectures-of-arrondissements" "communes" "arrondissements"

data.territory.codestring | null

معرّف المورد في MoroccoAPI؛ استعمله في روابط المورد المناسبة.

data.territory.hcp_codestring | null

رمز المندوبية السامية للتخطيط، جهاز الإحصاء المغربي. احتفظ به كنص للحفاظ على الأصفار الأولى.

data.territory.nameobject

اسم المورد، وقد يكون موزّعاً حسب اللغة.

data.territory.name.arstring

القيمة بالعربية؛ null عند غياب الترجمة.

data.territory.name.frstring

القيمة بالفرنسية؛ null عند غياب الترجمة.

data.territory.name.enstring | null

القيمة بالإنجليزية؛ null عند غياب الترجمة.

data.territory.region_codestring | null

معرّف الجهة الأم، وهي المستوى الإداري الأول في المغرب.

data.territory.province_codestring | null

معرّف الإقليم أو العمالة الأم، تحت الجهة.

data.observationsobject[]

القيم حسب الوسط وسنة الإحصاء؛ يغيب الوسط الذي لا قيمة له في المصدر.

data.observations[].areastring

وسط الإقامة: all (الحضري والقروي معاً) أو urban أو rural.

القيم المقبولة: "all" "urban" "rural"

data.observations[].yearnumber

السنة التي تصفها البيانات، وليست سنة تنزيلها.

القيم المقبولة: 2024 2014

data.observations[].mpinumber | null

مؤشر الفقر متعدد الأبعاد (MPI = H × A) بين 0 و1؛ null عندما لا يوجد أي فقير.

data.observations[].poverty_ratenumber | null

معدل الفقر (H): نسبة السكان في وضعية فقر متعدد الأبعاد.

data.observations[].poverty_intensitynumber | null

شدة الفقر (A): متوسط نسبة الحرمان لدى الفقراء بالنسبة المئوية؛ null عندما لا يوجد أي فقير.

data.observations[].vulnerability_ratenumber | null

نسبة السكان المعرضين للفقر متعدد الأبعاد.

data.observations[].deprivation_ratesobject

نسبة السكان المحرومين في كل مؤشر من المؤشرات العشرة للمؤشر.

data.observations[].deprivation_rates.child_mortalitynumber | null

نسبة السكان المحرومين في وفيات الأطفال (الصحة).

data.observations[].deprivation_rates.disabilitynumber | null

نسبة السكان المحرومين في الإعاقة (الصحة).

data.observations[].deprivation_rates.school_attendancenumber | null

نسبة السكان المحرومين في تمدرس الأطفال (التعليم).

data.observations[].deprivation_rates.years_of_schoolingnumber | null

نسبة السكان المحرومين في عدد سنوات التمدرس (التعليم).

data.observations[].deprivation_rates.electricitynumber | null

نسبة السكان المحرومين في الكهرباء (ظروف العيش).

data.observations[].deprivation_rates.waternumber | null

نسبة السكان المحرومين في الماء (ظروف العيش).

data.observations[].deprivation_rates.sanitationnumber | null

نسبة السكان المحرومين في التطهير (ظروف العيش).

data.observations[].deprivation_rates.housingnumber | null

نسبة السكان المحرومين في السكن (ظروف العيش).

data.observations[].deprivation_rates.cooking_fuelnumber | null

نسبة السكان المحرومين في طريقة الطهي (ظروف العيش).

data.observations[].deprivation_rates.communication_assetsnumber | null

نسبة السكان المحرومين في وسائل الاتصال (الممتلكات).

data.observations[].mpi_trendstring | null

قراءة HCP لتطور المؤشر بين 2014 و2024: decrease أو increase أو stagnation أو new_urban_centre؛ null لسنة 2014.

data.observations[].aligned_with_dakhlaboolean

تكون true لقيم 2014 لأربع جماعات وحّدتها HCP مع جماعة الداخلة بسبب التنقل الموسمي أثناء الإحصاء.

بنية البيانات
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "data",
    "meta"
  ],
  "properties": {
    "data": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "territory",
        "observations"
      ],
      "properties": {
        "territory": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "level",
            "code",
            "hcp_code",
            "name",
            "region_code",
            "province_code"
          ],
          "properties": {
            "level": {
              "enum": [
                "national",
                "regions",
                "subdivisions",
                "prefectures-of-arrondissements",
                "communes",
                "arrondissements"
              ]
            },
            "code": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "string",
                  "nullable": true,
                  "enum": [
                    null
                  ]
                }
              ],
              "description": "MoroccoAPI geography code; null for the national total."
            },
            "hcp_code": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "string",
                  "nullable": true,
                  "enum": [
                    null
                  ]
                }
              ],
              "description": "HCP geographic code in the dotted form used by the geography endpoints; null for the national total."
            },
            "name": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "ar",
                "fr",
                "en"
              ],
              "properties": {
                "ar": {
                  "type": "string"
                },
                "fr": {
                  "type": "string"
                },
                "en": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "string",
                      "nullable": true,
                      "enum": [
                        null
                      ]
                    }
                  ]
                }
              }
            },
            "region_code": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "string",
                  "nullable": true,
                  "enum": [
                    null
                  ]
                }
              ]
            },
            "province_code": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "string",
                  "nullable": true,
                  "enum": [
                    null
                  ]
                }
              ]
            }
          }
        },
        "observations": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "area",
              "year",
              "mpi",
              "poverty_rate",
              "poverty_intensity",
              "vulnerability_rate",
              "deprivation_rates",
              "mpi_trend",
              "aligned_with_dakhla"
            ],
            "properties": {
              "area": {
                "enum": [
                  "all",
                  "urban",
                  "rural"
                ],
                "description": "all (urban and rural together), urban or rural."
              },
              "year": {
                "enum": [
                  2024,
                  2014
                ],
                "description": "Census year: 2024, or 2014 as revised by HCP for comparison."
              },
              "mpi": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "string",
                    "nullable": true,
                    "enum": [
                      null
                    ]
                  }
                ],
                "description": "Multidimensional poverty index (MPI = H × A), between 0 and 1. HCP leaves it empty (null) when no one is poor."
              },
              "poverty_rate": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  },
                  {
                    "type": "string",
                    "nullable": true,
                    "enum": [
                      null
                    ]
                  }
                ],
                "description": "H: percentage of the population in multidimensional poverty."
              },
              "poverty_intensity": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  },
                  {
                    "type": "string",
                    "nullable": true,
                    "enum": [
                      null
                    ]
                  }
                ],
                "description": "A: average share of deprivations among poor people, in percent. Null when no one is poor."
              },
              "vulnerability_rate": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  },
                  {
                    "type": "string",
                    "nullable": true,
                    "enum": [
                      null
                    ]
                  }
                ],
                "description": "Percentage of the population vulnerable to multidimensional poverty."
              },
              "deprivation_rates": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "child_mortality",
                  "disability",
                  "school_attendance",
                  "years_of_schooling",
                  "electricity",
                  "water",
                  "sanitation",
                  "housing",
                  "cooking_fuel",
                  "communication_assets"
                ],
                "description": "Percentage of the population deprived in each of the ten indicators.",
                "properties": {
                  "child_mortality": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          null
                        ]
                      }
                    ]
                  },
                  "disability": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          null
                        ]
                      }
                    ]
                  },
                  "school_attendance": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          null
                        ]
                      }
                    ]
                  },
                  "years_of_schooling": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          null
                        ]
                      }
                    ]
                  },
                  "electricity": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          null
                        ]
                      }
                    ]
                  },
                  "water": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          null
                        ]
                      }
                    ]
                  },
                  "sanitation": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          null
                        ]
                      }
                    ]
                  },
                  "housing": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          null
                        ]
                      }
                    ]
                  },
                  "cooking_fuel": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          null
                        ]
                      }
                    ]
                  },
                  "communication_assets": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          null
                        ]
                      }
                    ]
                  }
                }
              },
              "mpi_trend": {
                "anyOf": [
                  {
                    "enum": [
                      "decrease",
                      "increase",
                      "stagnation",
                      "new_urban_centre"
                    ]
                  },
                  {
                    "type": "string",
                    "nullable": true,
                    "enum": [
                      null
                    ]
                  }
                ],
                "description": "HCP's reading of the MPI change between 2014 and 2024, on 2024 observations only; null on 2014 observations."
              },
              "aligned_with_dakhla": {
                "type": "boolean",
                "description": "True for the 2014 values of four communes that HCP aligned on the commune of Dakhla because of seasonal mobility during the 2014 census."
              }
            }
          },
          "description": "One entry per area and year with source values, all areas first and 2024 before 2014."
        }
      }
    },
    "meta": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "dataset",
        "total",
        "license",
        "retrieved_at",
        "transformation_version",
        "sources"
      ],
      "properties": {
        "dataset": {
          "enum": [
            "population-poverty"
          ]
        },
        "total": {
          "type": "integer",
          "minimum": 0
        },
        "license": {
          "enum": [
            "CC-BY-4.0"
          ]
        },
        "retrieved_at": {
          "enum": [
            "2026-10-26"
          ]
        },
        "transformation_version": {
          "enum": [
            "1.0.0"
          ]
        },
        "sources": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "dataset",
              "producer",
              "source_url",
              "resource_url",
              "license",
              "source_updated_at"
            ],
            "properties": {
              "dataset": {
                "type": "string"
              },
              "producer": {
                "type": "string"
              },
              "source_url": {
                "type": "string",
                "format": "uri"
              },
              "resource_url": {
                "type": "string",
                "format": "uri"
              },
              "license": {
                "enum": [
                  "CC-BY-4.0"
                ]
              },
              "source_updated_at": {
                "type": "string",
                "format": "date"
              }
            }
          }
        }
      }
    }
  }
}
المصادر وتقسيم الصفحات 13
metaobject

سياق النتيجة: المصادر والتواريخ والرخصة وتقسيم الصفحات عند الاقتضاء.

meta.datasetstring

اسم مجموعة البيانات الخاصة بالنتيجة أو المصدر.

القيم المقبولة: "population-poverty"

meta.totalinteger

عدد النتائج المطابقة للمرشحات قبل تقسيم الصفحات؛ وليس حجم هذه الصفحة.

meta.licensestring

رخصة إعادة الاستخدام. تعني mixed وجود رخص مختلفة: راجع كل مصدر.

القيم المقبولة: "CC-BY-4.0"

meta.retrieved_atstring

تاريخ جلب المشروع لملف المصدر؛ وليس تاريخ رصد البيانات.

القيم المقبولة: "2026-10-26"

meta.transformation_versionstring

إصدار قواعد تحويل مجموعة البيانات؛ مستقل عن إصدار الواجهة.

القيم المقبولة: "1.0.0"

meta.sourcesobject[]

المصادر المستخدمة لهذه النتيجة مع الجهات المنتجة والرخص.

meta.sources[].datasetstring

اسم مجموعة البيانات الخاصة بالنتيجة أو المصدر.

meta.sources[].producerstring

الجهة التي تنشر البيانات الأصلية.

meta.sources[].source_urlstring

صفحة نشر المصدر أو التعريف ببياناته.

meta.sources[].resource_urlstring

رابط الملف أو المورد المستخدم فعلياً.

meta.sources[].licensestring

رخصة إعادة الاستخدام. تعني mixed وجود رخص مختلفة: راجع كل مصدر.

القيم المقبولة: "CC-BY-4.0"

meta.sources[].source_updated_atstring

آخر تحديث معلن من المصدر؛ وليس تاريخ جلب الملف.

الأخطاء
  • 400: معامل غير صالح أو مفقود.

تتضمن الأخطاء error.code وerror.message وerror.request_id.

errorobject

تفاصيل الطلب الفاشل؛ تحل محل data وmeta.

error.codestring

رمز ثابت للخطأ، مثل RESOURCE_NOT_FOUND؛ استعمله في منطق التطبيق.

error.messagestring

شرح مقروء للخطأ؛ استعمل code في منطق التطبيق.

error.request_idstring

معرّف هذا الطلب، يفيد عند الإبلاغ عن مشكلة.

طلبك

GET · JSON

العنوان الأساسي

الإجابة

ستظهر الإجابة الفعلية هنا.

تغيّر اللغة نص التوثيق فقط، دون مفاتيح JSON أو قيم المصادر.