data.gov.sg Datastore Search API

Government

by GovTech / data.gov.sg

Generic query API over thousands of Singapore government datasets: pass any dataset's resource id to get filtered, paginated JSON records. One API shape unlocks the whole data.gov.sg catalogue.

How to authenticate

  1. 1No key needed for standard queries.
  2. 2Find a dataset id (d_xxx...) from its data.gov.sg dataset page URL.
  3. 3GET datastore_search with resource_id, plus optional limit, offset, q and filters params.
  4. 4Optional: request an API key from data.gov.sg for higher rate limits (x-api-key header).

Example request

Request
curl 'https://data.gov.sg/api/action/datastore_search?resource_id=d_8b84c4ee58e3cfc0ece0d773c8ca6abc&limit=1'

Example response

Response (truncated)
{"success":true,"result":{"resource_id":"d_8b84c4ee58e3cfc0ece0d773c8ca6abc","fields":[{"type":"text","id":"month"}],"records":[{"_id":1,"month":"2017-01"}]}}

Notes for AI agents

filters param takes URL-encoded JSON, e.g. filters={"town":"ANG MO KIO"}. For file-type datasets (GeoJSON, CSV downloads) use the poll-download API on api-open.data.gov.sg instead.

Machine-readable version: /api/apis/datagovsg-datastore-search

Related APIs