Dataset OpenAPI
This API allows you to search for data within a dataset or scan through the rows of the dataset in a paginated manner.
ℹ️
All the following APIs use the following domain: https://data.mef.gov.kh/api (opens in a new tab)
Get rows in a dataset
GET
v1/public-datasets/{datasetId}/json
ℹ️
To find the datasetId
, refer to the URL of dataset.
In this dataset:
https://data.mef.gov.kh/datasets/pd_66a9f37836d76b00019fe84b (opens in a new tab)The datasetId is :
pd_66a9f37836d76b00019fe84b
Query parameters
page
(integer): Page number (optional, must be 1 or more)page_size
(integer): Page size (optional, must be 1 or more)
Request
javascript
const response = await fetch('{domain}/v1/public-datasets/{datasetId}/json');
const data = await response.json();
Response
{
"items": [],
"total_items": integer,
"page": integer,
"page_size": integer,
"total_pages": integer
}
Datasets Listing
This API returns a list of all the datasets available on Data.gov.kh
GET
v1/public-datasets
Query parameters
page
(integer): Page number (optional, must be 1 or more)page_size
(integer): Page size (optional, must be 1 or more)
Request
javascript
const response = await fetch('{domain}/v1/public-datasets');
const data = await response.json();
Response
{
"data":[
{
"id": string,
"name": string,
"description": string,
"source": string,
"organization_id": integer,
"column_data_id": integer,
"is_active": boolean,
"frequency": string,
"coverage_start": string,
"coverage_end": string,
"format": string,
"file_url": string,
"file_size": integer,
"created_at": string,
"updated_at": string,
"deleted_at": string,
"download_count": integer,
"dashboard_id": string,
"organization": {
"full_file_url": string,
"organization_id": integer,
"name_kh": string,
"name_en": string,
"abbreviation": string,
"format": string,
"file_url": string,
"is_active": boolean,
"deleted_at": string
},
"column_data": {
"column_data_id": number,
"created_at": string,
"last_updated_at": string,
"data": [
{
"title": string,
"type": string,
"description": string
}
]
}
}
]
}