Open Government Data API Guide
Use the following APIs to interact with Open Government Data datasets.
Authentication
For package_create, package_patch, and package_update, you need to include your API key in the request headers:
Authorization: <YOUR-API-KEY>
User needs to login first to generate his/her API-Token, if not already generaed: Login Now
Endpoints
Dataset Details
Retrieve details of a dataset.
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"}'
Datasets List
Search for datasets. Returns the list of datasets.
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"
Create Dataset
Create a new dataset. (Only for users with authorized API key)
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}'
Update Dataset
Update an existing dataset. (Only for users with authorized API key)
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}'
For Detailed Usage of payload and filtering options visit CKAN Docs:
CKAN API GuideSample Response
{
"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
}
}

Light Contrast
Invert Contrast
Dark Contrast
Low Saturation
Highlight Links
Adjust Text Spacing
Font Size
Font Type
Reading
Line Height
Text Alignment
Align Left
Align Center
Justify