GOVGovernment ยท GovTech / data.gov.sg

data.gov.sg Datastore Search API

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

4 stops to a working call

  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"}]}}

data.gov.sg Datastore Search API: common questions

Is the data.gov.sg Datastore Search API free?

Yes. GovTech / data.gov.sg offers the data.gov.sg Datastore Search API free of charge.

Does the data.gov.sg Datastore Search API need an API key?

No. The data.gov.sg Datastore Search API can be called without an API key or login.

What is the data.gov.sg Datastore Search API endpoint?

The base URL is https://data.gov.sg/api/action/datastore_search. A working example: curl 'https://data.gov.sg/api/action/datastore_search?resource_id=d_8b84c4ee58e3cfc0ece0d773c8ca6abc&limit=1'

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

On the same line