Dataset APIs
To find the datasetId, refer to the URL of dataset.
For this dataset:
https://beta.data.gov.sg/collections/522/datasets/d_11e68bba3b3c76733475a72d09759eeb/view
or
https://beta.data.gov.sg/datasets/d_11e68bba3b3c76733475a72d09759eeb/view
The datasetId is:
d_11e68bba3b3c76733475a72d09759eeb
Dataset Search
This API allows you to search for data within a dataset or scan through the rows of the dataset in a paginated manner.
Note that the following API uses the domain: https://data.gov.sg
For example:
https://data.gov.sg/api/action/datastore_search
If you're looking to query the following dataset: https://beta.data.gov.sg/datasets/d_8b84c4ee58e3cfc0ece0d773c8ca6abc/view Please refer to the URL from the dataset page, taking the dataset_id (starting with d_...), and passing that into your datastore search API query as shown below: https://data.gov.sg/api/action/datastore_search?resource_id=d_8b84c4ee58e3cfc0ece0d773c8ca6abc
Search rows in a dataset
Fetched data
URL that returns a help string for the API action
Whether fetch is succesfully
Resource
Datasets Listing
This API returns a list of all the datasets available on data.gov.sg
Get datasets
Successful response
Dataset Metadata
This API returns the metadata of a single dataset
Get metadata for a dataset
The unique identifier of the dataset
Successful response
Downloads
As Data.gov 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
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.
Initiates download for a dataset
ID of the dataset
Optional request body for filtering dataset
List of selected columns in filtered dataset.
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.
Successful response
Response code
Error message (if any)
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
ID of the dataset
Optional request body for filtering dataset
List of selected columns in filtered dataset.
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.
Successful response
Response code
Error message (if any)
Last updated