Download dataset
Guide to downloading datasets
To download an entire dataset via API, you will need to first call the initiate download API, followed by the poll download API.
You may add column and rows filters to get a subset of the dataset, although this is optional.
For datasets that do not have the CSV extension (ie GeoJSON, KML, PDF etc.), you may skip this endpoint and proceed to the Poll Download API below.
ID of the dataset
d_3f960c10fed6145404ca7b821f263b87List of selected columns in filtered dataset.
["uen","uen_status_desc","entity_type_desc","entity_name"]Filters defines how users want to filter their dataset.
Filters is an array of objects which have columnName, type and value attributes.
columnNamerefers to the column where the filter is to be applied.typecan beEQ,LIKE, orILIKE:- EQ: Direct comparison for filter and is case sensitive.
- LIKE: Similar to EQ but includes partial matching. Any words containing the string in the
valueattribute will be matched. - ILIKE: Case-insensitive version of LIKE.
[{"columnName":"uen_status_desc","type":"EQ","value":"Registered"},{"columnName":"entity_type_desc","type":"LIKE","value":"Local"},{"columnName":"entity_name","type":"ILIKE","value":"data"}]Successful response
Response code
Error message (if any)
Request Failure
Rate limit exceeded
GET /v1/public/api/datasets/{datasetId}/initiate-download HTTP/1.1
Host: api-open.data.gov.sg
Content-Type: application/json
Accept: */*
Content-Length: 275
{
"columnNames": [
"uen",
"uen_status_desc",
"entity_type_desc",
"entity_name"
],
"filters": [
{
"columnName": "uen_status_desc",
"type": "EQ",
"value": "Registered"
},
{
"columnName": "entity_type_desc",
"type": "LIKE",
"value": "Local"
},
{
"columnName": "entity_name",
"type": "ILIKE",
"value": "data"
}
]
}{
"code": 1,
"data": {
"message": "text"
},
"errorMsg": "text"
}After initiating the download of a dataset, this endpoint below returns a link to access the dataset
ID of the dataset
d_3f960c10fed6145404ca7b821f263b87List of selected columns in filtered dataset.
["uen","uen_status_desc","entity_type_desc","entity_name"]Filters defines how users want to filter their dataset.
Filters is an array of objects which have columnName, type and value attributes.
columnNamerefers to the column where the filter is to be applied.typecan beEQ,LIKE, orILIKE:- EQ: Direct comparison for filter and is case sensitive.
- LIKE: Similar to EQ but includes partial matching. Any words containing the string in the
valueattribute will be matched. - ILIKE: Case-insensitive version of LIKE.
[{"columnName":"uen_status_desc","type":"EQ","value":"Registered"},{"columnName":"entity_type_desc","type":"LIKE","value":"Local"},{"columnName":"entity_name","type":"ILIKE","value":"data"}]Successful response
Response code
Error message (if any)
Request Failure
Rate limit exceeded
GET /v1/public/api/datasets/{datasetId}/poll-download HTTP/1.1
Host: api-open.data.gov.sg
Content-Type: application/json
Accept: */*
Content-Length: 275
{
"columnNames": [
"uen",
"uen_status_desc",
"entity_type_desc",
"entity_name"
],
"filters": [
{
"columnName": "uen_status_desc",
"type": "EQ",
"value": "Registered"
},
{
"columnName": "entity_type_desc",
"type": "LIKE",
"value": "Local"
},
{
"columnName": "entity_name",
"type": "ILIKE",
"value": "data"
}
]
}{
"code": 1,
"data": {
"status": "text",
"url": "text"
},
"errorMsg": "text"
}Last updated
Was this helpful?