Download dataset

Guide to downloading datasets

circle-info

As data.gov.sg is a public shared service, we will apply quotas to ensure that they are fairly used by all users. If you exceed the quota of 5 requests per minute, you’ll likely receive a 429 Error. For higher rate limits - create an API key

This API initiates the download of a single dataset, with optional filtering by columns and rows. 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.

circle-info

After initiating the download of a dataset, this endpoint below returns a link to access the dataset

Poll download for a dataset after download has been initiated

get
Path parameters
datasetIdstringRequired

ID of the dataset

Body
columnNamesstring[]Optional

List of selected columns in filtered dataset.

Example: ["name","title","address","email_address"]
filtersarrayOptional

Filters defines how users want to filter their dataset. Filters is an array of objects which have columnName,type and value attributes. columnName refers to the column where the filter is to be applied. The values for type can be EQ, LIKE, or ILIKE. EQ is direct comparison for filter and is case sensitive. LIKE is similar to EQ but includes partial matching. Any words containing the string in the value attribute will be matched. ILIKE is the case-insensitive version of LIKE.

Example: {"fitlers":[{"columnName":"epi_week","type":"EQ","value":2},{"columnName":"status","type":"ILIKE","value":"covid"},{"columnName":"epi_year","type":"LIKE","value":23}]}
Responses
chevron-right
201

Successful response

application/json
get
/v1/public/api/datasets/{datasetId}/poll-download

Last updated

Was this helpful?