دليل واجهة برمجة التطبيقات لبيانات الجهة الحكومية المفتوحة
استخدم واجهات برمجة التطبيقات التالية للتفاعل مع مجموعات بيانات الحكومة المفتوحة.
المصادقة
الى package_create, package_patch, و package_update, تحتاج إلى تضمين مفتاح واجهة برمجة التطبيقات الخاص بك في ترويسات الطلب :
Authorization: <YOUR-API-KEY>
يجب على المستخدم تسجيل الدخول أولاً لإنشاء رمز واجهة برمجة التطبيقات الخاص به، إذا لم يتم إنشاؤه مسبقًا تسجيل الدخول الآن
نقاط النهاية
تفاصيل مجموعة البيانات
استرجاع تفاصيل مجموعة البيانات.
https://opendata.gov.jo/api/3/action/package_show?id={dataset_id}
import requests
url = "https://opendata.gov.jo/api/3/action/package_show"
data = {"id": "dataset_id"}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=data, headers=headers)
print(response.json())
fetch("https://opendata.gov.jo/api/3/action/package_show", {
method: "GET",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"id": "dataset_id"})
})
.then(response => response.json())
.then(data => console.log(data));
curl -X GET "https://opendata.gov.jo/api/3/action/package_show" \
-H "Content-Type: application/json" \
-d '{"id": "dataset_id"}'
قائمة مجموعات البيانات
البحث عن مجموعات البيانات. يعرض قائمة مجموعات البيانات.
https://opendata.gov.jo/api/3/action/package_search
import requests
url = "https://opendata.gov.jo/api/3/action/package_search"
headers = {"Content-Type": "application/json"}
response = requests.get(url, json={}, headers=headers)
print(response.json())
fetch("https://opendata.gov.jo/api/3/action/package_search", {
method: "GET",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({})
})
.then(response => response.json())
.then(data => console.log(data));
curl -X GET "https://opendata.gov.jo/api/3/action/package_search" \
-H "Content-Type: application/json"
إنشاء مجموعة بيانات
إنشاء مجموعة بيانات جديدة. (للمستخدمين الذين لديهم مفتاح API مصرح به فقط)
import requests
url = "https://opendata.gov.jo/api/3/action/package_create"
data = {
"name": "example-name",
"title":"Example Title",
#..... all other mandatory fields
}
headers = {"Authorization": "YOUR-API-KEY", "Content-Type": "application/json"}
response = requests.post(url, json=data, headers=headers)
print(response.json())
fetch("https://opendata.gov.jo/api/3/action/package_create", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "YOUR-API-KEY"
},
body: JSON.stringify({
"name": "example-name",
"title":"Example Title",
//..... all other mandatory fields
} )
})
.then(response => response.json())
.then(data => console.log(data));
curl -X POST "https://opendata.gov.jo/api/3/action/package_create" \
-H "Authorization: YOUR-API-KEY" \
-H "Content-Type: application/json" \
-d '{"name": "example-name", "title":"Example Title", ... other mandatory metadata fields}'
تحديث مجموعة البيانات
تحديث مجموعة بيانات موجودة. (للمستخدمين الذين لديهم مفتاح API مصرح به فقط)
import requests
url = "https://opendata.gov.jo/api/3/action/package_update"
data = {
"id": "dataset_id",
"name": "example-name",
"title":"Example Title",
#..... all other mandatory fields
}
headers = {"Authorization": "YOUR-API-KEY", "Content-Type": "application/json"}
response = requests.post(url, json=data, headers=headers)
print(response.json())
fetch("https://opendata.gov.jo/api/3/action/package_update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "YOUR-API-KEY"
},
body: JSON.stringify({
"id": "dataset_id",
"name": "example-name",
"title":"Example Title",
//..... all other mandatory fields
} )
})
.then(response => response.json())
.then(data => console.log(data));
curl -X POST "https://opendata.gov.jo/api/3/action/package_update" \
-H "Authorization: YOUR-API-KEY" \
-H "Content-Type: application/json" \
-d '{"id": "dataset_id", "name": "example-name", "title":"Example Title", ... other mandatory metadata fields}'
استجابة نموذجية
{
"success": true,
"result": {
"id": "12345678",
"name": "example-dataset",
"title": "Example Dataset",
"metadata_created": "2025-01-30T14:30:00",
"metadata_modified": "2025-01-30T15:00:00",
...,
...,
# all the metadata fields along with resources
}
}

ضوء التباين
التباين المعكوس
التباين المظلم
تشبع منخفض
تحديد الروابط
ضبط تباعد الأحرف
حجم الخط
نوع الخط
القراءة
ارتفاع الخط
محاذاة النص
محاذاة لليسار
محاذاة الوسط
ملأ السطر