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

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

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

معلومات بادئة هاتف

GET/api/v2/telecom/phone-numbers/lookup

معلومة مهمة. التحقق من الصيغة وبادئات Google محلياً. لا تكشف هوية المشترك أو نشاط الخط أو المشغّل الحالي أو الموقع الفعلي.

المعاملات

01
stringإلزامي · الاستعلام

رقم مغربي: 06… أو 07… أو +212… أو 00212… تُرمّز علامة + تلقائياً هنا.

1-64 حرفاً
فهم الإجابة

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

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

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

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

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

dataobject

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

data.is_possibleboolean

طول الرقم متوافق مع مخطط الترقيم؛ لا يثبت وجود الرقم.

data.is_valid_formatboolean

الصيغة مطابقة لبيانات المحلل؛ لا تثبت تخصيص الرقم أو إمكانية الاتصال به.

data.is_allocated_rangenull

غير معروف هنا: بيانات البادئات ليست سجلاً رسمياً لتخصيص الأرقام.

القيم المقبولة: null

data.has_known_prefixboolean

توجد بادئة مطابقة في البيانات، بصرف النظر عن صلاحية الرقم.

data.e164string | null

الرقم الدولي الموحد مع +212، رمز الاتصال بالمغرب.

data.national_numberstring | null

الرقم بالصيغة الوطنية المغربية مع الصفر الأول.

data.number_typestring | null

النوع الذي يتعرف عليه المحلل، مثل الهاتف المحمول أو الثابت.

data.reasonstring | null

رمز يوضح سبب رفض الرقم؛ null عند عدم وجود سبب للرفض.

data.matched_prefixstring | null

البادئة الأكثر تحديداً المطابقة لهذا الرقم.

data.original_operatorobject | null

المشغل المرتبط بالبادئة في المصدر؛ قد يختلف عن المشغل الحالي.

data.original_operator.codestring

معرّف المشغل داخل كائن المشغل؛ وبادئة وطنية داخل المنطقة الهاتفية.

data.original_operator.namestring

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

data.current_operatornull

غير معروف: تتيح قابلية نقل الرقم تغيير المشغل مع الاحتفاظ بالرقم.

القيم المقبولة: null

data.geographic_areaobject | null

المنطقة المرتبطة بالبادئة، وليست الموقع الفعلي للمتصل.

data.geographic_area.codestring

معرّف المشغل داخل كائن المشغل؛ وبادئة وطنية داخل المنطقة الهاتفية.

data.geographic_area.international_prefixstring

الصيغة الدولية للبادئة، باستبدال الصفر الأول بـ+212.

data.geographic_area.descriptionobject

وصف البادئة باللغات المتاحة.

data.geographic_area.description.arnull

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

القيم المقبولة: null

data.geographic_area.description.frstring

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

data.geographic_area.description.enstring

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

data.geographic_area.areasobject

المناطق المخدومة حسب المصدر، موزّعة حسب اللغة؛ وليست حدوداً إدارية دقيقة.

data.geographic_area.areas.arnull

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

القيم المقبولة: null

data.geographic_area.areas.frstring[]

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

data.geographic_area.areas.enstring[]

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

data.geographic_area.hcp_codenull

null: لا يتوفر ربط إداري مؤكد مع HCP لهذه المناطق الهاتفية.

القيم المقبولة: null

بنية البيانات
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "data",
    "meta"
  ],
  "properties": {
    "data": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "is_possible",
        "is_valid_format",
        "is_allocated_range",
        "has_known_prefix",
        "e164",
        "national_number",
        "number_type",
        "reason",
        "matched_prefix",
        "original_operator",
        "current_operator",
        "geographic_area"
      ],
      "properties": {
        "is_possible": {
          "type": "boolean",
          "description": "Length compatibility with the numbering plan."
        },
        "is_valid_format": {
          "type": "boolean",
          "description": "Validity against the pinned parser metadata; does not prove line assignment or reachability."
        },
        "is_allocated_range": {
          "type": "string",
          "description": "Unknown: the prefix mapping dataset is not an official allocation registry.",
          "nullable": true,
          "enum": [
            null
          ]
        },
        "has_known_prefix": {
          "type": "boolean",
          "description": "A prefix mapping exists, independently of format validity."
        },
        "e164": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "string",
              "nullable": true,
              "enum": [
                null
              ]
            }
          ]
        },
        "national_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "string",
              "nullable": true,
              "enum": [
                null
              ]
            }
          ]
        },
        "number_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "string",
              "nullable": true,
              "enum": [
                null
              ]
            }
          ]
        },
        "reason": {
          "anyOf": [
            {
              "enum": [
                "INVALID_CHARACTERS",
                "INVALID_LENGTH",
                "NOT_MOROCCAN",
                "INVALID_NUMBER_PATTERN"
              ]
            },
            {
              "type": "string",
              "nullable": true,
              "enum": [
                null
              ]
            }
          ]
        },
        "matched_prefix": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "string",
              "nullable": true,
              "enum": [
                null
              ]
            }
          ]
        },
        "original_operator": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "code",
                "name"
              ],
              "properties": {
                "code": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            },
            {
              "type": "string",
              "nullable": true,
              "enum": [
                null
              ]
            }
          ]
        },
        "current_operator": {
          "type": "string",
          "description": "Cannot be inferred from a prefix after number portability.",
          "nullable": true,
          "enum": [
            null
          ]
        },
        "geographic_area": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "code",
                "international_prefix",
                "description",
                "areas",
                "hcp_code"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 6,
                  "pattern": "^0[5-8][0-9]{0,4}$"
                },
                "international_prefix": {
                  "type": "string"
                },
                "description": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "ar",
                    "fr",
                    "en"
                  ],
                  "properties": {
                    "ar": {
                      "type": "string",
                      "nullable": true,
                      "enum": [
                        null
                      ]
                    },
                    "fr": {
                      "type": "string"
                    },
                    "en": {
                      "type": "string"
                    }
                  }
                },
                "areas": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "ar",
                    "fr",
                    "en"
                  ],
                  "properties": {
                    "ar": {
                      "type": "string",
                      "nullable": true,
                      "enum": [
                        null
                      ]
                    },
                    "fr": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "en": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "hcp_code": {
                  "type": "string",
                  "nullable": true,
                  "enum": [
                    null
                  ]
                }
              }
            },
            {
              "type": "string",
              "nullable": true,
              "enum": [
                null
              ]
            }
          ]
        }
      }
    },
    "meta": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "dataset",
        "total",
        "license",
        "retrieved_at",
        "transformation_version",
        "sources"
      ],
      "properties": {
        "dataset": {
          "enum": [
            "phone-numbers"
          ]
        },
        "total": {
          "type": "integer",
          "minimum": 0
        },
        "license": {
          "enum": [
            "Apache-2.0"
          ]
        },
        "retrieved_at": {
          "type": "string",
          "format": "date"
        },
        "transformation_version": {
          "type": "string"
        },
        "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": [
                  "Apache-2.0"
                ]
              },
              "source_updated_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string",
                    "nullable": true,
                    "enum": [
                      null
                    ]
                  }
                ]
              }
            }
          }
        }
      }
    }
  }
}
المصادر وتقسيم الصفحات 13
metaobject

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

meta.datasetstring

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

القيم المقبولة: "phone-numbers"

meta.totalinteger

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

meta.licensestring

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

القيم المقبولة: "Apache-2.0"

meta.retrieved_atstring

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

meta.transformation_versionstring

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

meta.sourcesobject[]

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

meta.sources[].datasetstring

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

meta.sources[].producerstring

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

meta.sources[].source_urlstring

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

meta.sources[].resource_urlstring

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

meta.sources[].licensestring

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

القيم المقبولة: "Apache-2.0"

meta.sources[].source_updated_atstring | null

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

الأخطاء
  • 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 أو قيم المصادر.