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

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

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

محطة حسب معرّف OSM

GET/api/v2/transport/rail/stations/{id}

معلومة مهمة. نسخة مؤرخة من OpenStreetMap برخصة ODbL. الأسماء والمدن الغائبة بقيمة null. تشمل مواقع غير مستعملة أو مخططاً لها؛ خدمة المسافرين والربط الحالي غير مؤكدين.

المعاملات

01
stringإلزامي · المسار

معرّف OSM من القائمة، مثل osm-node-2328486902؛ ليس رمز ONCF أو UIC.

النمط^osm-(node|way|relation)-[1-9][0-9]*$
فهم الإجابة

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

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

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

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

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

dataobject

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

data.idstring

معرّف عنصر OSM الرئيسي، وليس رمز ONCF أو UIC.

data.namestring | null

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

data.namesobject

الأسماء اللغوية المذكورة صراحة في OSM؛ دون ترجمة مولدة.

data.names.arstring | null

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

data.names.frstring | null

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

data.names.enstring | null

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

data.aliasesstring[]

أسماء أخرى للمورد نفسه تساعد في التعرّف عليه أو البحث عنه.

data.typestring

station: محطة؛ halt: موقف قطار صغير.

القيم المقبولة: "station" "halt"

data.citystring | null

المدينة المحددة عبر addr:city أو is_in:city في OSM؛ null عند غيابها.

data.operatorstring | null

المشغّل المسجل في OSM دون تأكيد رسمي حالي.

data.networkstring | null

اسم الشبكة المسجل في OSM عند توفره.

data.locationobject

إحداثيات الموقع الواردة في المصدر، عند توفرها.

data.location.latitudenumber

خط العرض وفق WGS 84 بالدرجات العشرية: موجب شمالاً وسالب جنوباً.

data.location.longitudenumber

خط الطول وفق WGS 84 بالدرجات العشرية: موجب شرقاً وسالب غرباً.

data.location.methodstring

osm_point: نقطة المصدر؛ bounding_box_center: مركز نطاق العنصر وليس مدخلاً.

القيم المقبولة: "osm_point" "bounding_box_center"

data.osm_statusstring

الحالة المذكورة صراحة في OSM؛ unknown لا تؤكد العمل.

القيم المقبولة: "unknown" "disused" "abandoned" "construction" "proposed" "demolished"

data.wikidata_idstring | null

معرّف Wikidata الموجود في OSM دون إضافة خارجية.

data.passenger_servicenull

null: خدمة المسافرين الحالية غير متحقق منها.

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

data.connectionsnull

null: الربط غير متاح، وليس قائمة فارغة تثبت انعدامه.

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

data.sourcesobject[]

عناصر OSM التي توثق السجل؛ الأول يحدد معرّفه وموقعه.

data.sources[].osm_typestring

نوع عنصر OpenStreetMap: node أو way أو relation.

القيم المقبولة: "node" "way" "relation"

data.sources[].osm_idinteger

المعرّف الرقمي لـOSM ويُستخدم مع osm_type.

data.sources[].versioninteger

إصدار عنصر OSM في هذه النسخة.

data.sources[].updated_atstring

آخر تعديل لعنصر OSM؛ ليس تحققاً ميدانياً.

data.sources[].urlstring

رابط عنصر OSM؛ قد تكون نسخته على الإنترنت تغيّرت.

data.sources[].fieldsstring[]

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

بنية البيانات
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "data",
    "meta"
  ],
  "properties": {
    "data": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "names",
        "aliases",
        "type",
        "city",
        "operator",
        "network",
        "location",
        "osm_status",
        "wikidata_id",
        "passenger_service",
        "connections",
        "sources"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^osm-(node|way|relation)-[1-9][0-9]*$"
        },
        "name": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "string",
              "nullable": true,
              "enum": [
                null
              ]
            }
          ]
        },
        "names": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "ar",
            "fr",
            "en"
          ],
          "properties": {
            "ar": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "string",
                  "nullable": true,
                  "enum": [
                    null
                  ]
                }
              ]
            },
            "fr": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "string",
                  "nullable": true,
                  "enum": [
                    null
                  ]
                }
              ]
            },
            "en": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "string",
                  "nullable": true,
                  "enum": [
                    null
                  ]
                }
              ]
            }
          }
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "type": {
          "type": "string",
          "enum": [
            "station",
            "halt"
          ]
        },
        "city": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "string",
              "nullable": true,
              "enum": [
                null
              ]
            }
          ],
          "description": "Explicit OSM addr:city or is_in:city, not a geocoded administrative assignment."
        },
        "operator": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "string",
              "nullable": true,
              "enum": [
                null
              ]
            }
          ]
        },
        "network": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "string",
              "nullable": true,
              "enum": [
                null
              ]
            }
          ]
        },
        "location": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "latitude",
            "longitude",
            "method"
          ],
          "properties": {
            "latitude": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "longitude": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            },
            "method": {
              "type": "string",
              "enum": [
                "osm_point",
                "bounding_box_center"
              ]
            }
          }
        },
        "osm_status": {
          "type": "string",
          "enum": [
            "unknown",
            "disused",
            "abandoned",
            "construction",
            "proposed",
            "demolished"
          ],
          "description": "Explicit source lifecycle only; unknown is not confirmation of current service."
        },
        "wikidata_id": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^Q[1-9][0-9]*$"
            },
            {
              "type": "string",
              "nullable": true,
              "enum": [
                null
              ]
            }
          ]
        },
        "passenger_service": {
          "type": "string",
          "description": "Current passenger service is not verified.",
          "nullable": true,
          "enum": [
            null
          ]
        },
        "connections": {
          "type": "string",
          "description": "Unavailable, not an empty set of connections. No timetable feed is integrated.",
          "nullable": true,
          "enum": [
            null
          ]
        },
        "sources": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "osm_type",
              "osm_id",
              "version",
              "updated_at",
              "url",
              "fields"
            ],
            "properties": {
              "osm_type": {
                "type": "string",
                "enum": [
                  "node",
                  "way",
                  "relation"
                ]
              },
              "osm_id": {
                "type": "integer",
                "minimum": 1
              },
              "version": {
                "type": "integer",
                "minimum": 1
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "OSM edit timestamp, not a verification of current service."
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "fields": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          }
        }
      }
    },
    "meta": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "dataset",
        "total",
        "license",
        "license_url",
        "attribution",
        "snapshot_at",
        "retrieved_at",
        "transformation_version",
        "source_record_count",
        "snapshot_record_count",
        "scope",
        "limitations",
        "sources"
      ],
      "properties": {
        "dataset": {
          "enum": [
            "osm-geofabrik-morocco-rail"
          ]
        },
        "total": {
          "type": "integer",
          "minimum": 0
        },
        "license": {
          "enum": [
            "ODbL-1.0"
          ]
        },
        "license_url": {
          "enum": [
            "https://opendatacommons.org/licenses/odbl/1-0/"
          ]
        },
        "attribution": {
          "enum": [
            "© OpenStreetMap contributors"
          ]
        },
        "snapshot_at": {
          "enum": [
            "2026-11-13T21:22:20Z"
          ]
        },
        "retrieved_at": {
          "enum": [
            "2026-11-14"
          ]
        },
        "transformation_version": {
          "enum": [
            "1.0.0"
          ]
        },
        "source_record_count": {
          "enum": [
            178
          ]
        },
        "snapshot_record_count": {
          "enum": [
            151
          ]
        },
        "scope": {
          "type": "string",
          "minLength": 1
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "sources": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "producer",
              "source_url",
              "resource_url",
              "license",
              "source_updated_at",
              "sha256"
            ],
            "properties": {
              "producer": {
                "type": "string",
                "minLength": 1
              },
              "source_url": {
                "type": "string",
                "format": "uri"
              },
              "resource_url": {
                "type": "string",
                "format": "uri"
              },
              "license": {
                "enum": [
                  "ODbL-1.0"
                ]
              },
              "source_updated_at": {
                "type": "string",
                "format": "date-time"
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            }
          }
        }
      }
    }
  }
}
المصادر وتقسيم الصفحات 20
metaobject

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

meta.datasetstring

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

القيم المقبولة: "osm-geofabrik-morocco-rail"

meta.totalinteger

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

meta.licensestring

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

القيم المقبولة: "ODbL-1.0"

meta.license_urlstring

رابط شروط الرخصة؛ null عند غياب الرابط.

القيم المقبولة: "https://opendatacommons.org/licenses/odbl/1-0/"

meta.attributionstring

إشارة النسبة المطلوبة لبيانات OSM.

القيم المقبولة: "© OpenStreetMap contributors"

meta.snapshot_atstring

تاريخ ووقت نسخة OSM، مستقلان عن تعديلات العناصر.

القيم المقبولة: "2026-11-13T21:22:20Z"

meta.retrieved_atstring

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

القيم المقبولة: "2026-11-14"

meta.transformation_versionstring

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

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

meta.source_record_countnumber

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

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

meta.snapshot_record_countnumber

عدد سجلات النسخة بعد الاستبعاد والدمج المراجع وقبل مرشحات الطلب.

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

meta.scopestring

النطاق الذي تغطيه البيانات؛ لا يعني تغطية شاملة.

meta.limitationsstring[]

القيود المعروفة للمصدر أو التغطية؛ اقرأها قبل استخدام البيانات.

meta.sourcesobject[]

مصدر ورخصة النسخة المنزلة.

meta.sources[].producerstring

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

meta.sources[].source_urlstring

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

meta.sources[].resource_urlstring

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

meta.sources[].licensestring

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

القيم المقبولة: "ODbL-1.0"

meta.sources[].source_updated_atstring

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

meta.sources[].sha256string

بصمة SHA-256 لملف PBF الأصلي كاملاً.

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

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

errorobject

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

error.codestring

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

error.messagestring

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

error.request_idstring

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

طلبك

GET · JSON

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

الإجابة

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

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