# Singapore Open Data API

> data.gov.sg: 4,600+ Singapore government datasets with metadata and row queries, e.g. HDB resale pri

- Vendor: `singaporeopendataapi` · version 1.0 · category Government Data · tags singapore open data api, data.gov.sg api, singapore government data api, hdb resale prices api, open datasets api, singapore statistics api
- Datasource: custom HTTP routes
- Marketplace page: https://apiclay.com/api/singaporeopendataapi
- This document: https://apiclay.com/docs/singaporeopendataapi.md
- OpenAPI 3.1: https://apiclay.com/api/singaporeopendataapi/openapi.json
- MCP: connect https://api.apiclay.com/v1/mcp (see https://apiclay.com/llms.txt), then `apiclay_describe_api` with vendor `singaporeopendataapi`
- Updated: 2026-11-18

## About

## Singapore Open Data API

Singapore's national open data portal (data.gov.sg): about 4,677 datasets from government agencies, for example HDB resale flat prices (245,000+ transactions since 2017). List datasets and collections, read a dataset's metadata and columns, and query its rows with full-text search, field filters, sorting and paging. Live weather and air-quality readings are a separate listing.

Data comes from **data.gov.sg** (https://data.gov.sg). Every route calls the source's own public API and returns it unchanged.

Typical flow: `/datasets?page=1` for a `datasetId`, then `/dataset?dataset_id=` for its columns and `/rows?resource_id=&amp;limit=20&amp;q=BEDOK`.

### Routes

#### GET `/datasets` - Datasets
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| page | query | number | no | Page, from 1 (10 datasets per page). |

Returns: `data.datasets` (`datasetId`, `name`, `description`, `format`, `managedByAgencyName`, `lastUpdatedAt`) and `data.pages`, `data.totalRowCount`.

#### GET `/dataset` - Dataset
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| dataset_id | path | string | yes | `datasetId` from `/datasets`, e.g. `d_8b84c4ee58e3cfc0ece0d773c8ca6abc`. |

Returns: `data`: name, description, agency, licence, coverage dates and `columnMetadata`.

#### GET `/collections` - Collections
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| page | query | number | no | Page, from 1. |

Returns: `data.collections`: groups of related datasets with `collectionId`, `name` and `description`.

#### GET `/collection` - Collection
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| collection_id | path | string | yes | `collectionId` from `/collections`. |

Returns: `data.collectionMetadata` with its `childDatasets` ids.

#### GET `/rows` - Rows
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| resource_id | query | string | yes | A tabular `datasetId`. |
| q | query | string | no | Full-text search across the row, e.g. `BEDOK`. |
| filters | query | string | no | JSON object of exact matches, e.g. `{"town":"BEDOK","flat_type":"4 ROOM"}`. |
| fields | query | string | no | Comma-separated columns to return. |
| sort | query | string | no | e.g. `month desc`. |
| limit | query | number | no | Rows per page. |
| offset | query | number | no | Rows to skip. |

Returns: `result.fields` (column ids and types), `result.records` and `result.total`.

### Caveats

- Anonymous calls share data.gov.sg's low rate limit; a burst can return 429, so space calls out.
- Data is under the Singapore Open Data Licence; credit the agency named in `/dataset`.
- Upstream responses can change over time. Verify fields before relying on them.
- Not affiliated with or endorsed by data.gov.sg.

## Pricing

- Pay as you go: 0.0012 credits/request
- Trial: 1 free requests per buyer
- Billing order: trial requests -> subscribed plan requests -> pay as you go. 1 credit's USD value is shown on the marketplace page.

## HTTP routes

Only the public, buyer-facing parts of each route are listed; vendor-side credentials stay on the gateway.

### GET /datasets — Datasets
- Gateway: `GET https://api.apiclay.com/v1/api/singaporeopendataapi/datasets`
- Public query params: `page` (number)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /dataset — Dataset
- Gateway: `GET https://api.apiclay.com/v1/api/singaporeopendataapi/dataset`
- Public query params: `dataset_id` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /collections — Collections
- Gateway: `GET https://api.apiclay.com/v1/api/singaporeopendataapi/collections`
- Public query params: `page` (number)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /collection — Collection
- Gateway: `GET https://api.apiclay.com/v1/api/singaporeopendataapi/collection`
- Public query params: `collection_id` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /rows — Rows
- Gateway: `GET https://api.apiclay.com/v1/api/singaporeopendataapi/rows`
- Public query params: `resource_id` (string, required), `q` (string), `filters` (string), `fields` (string), `sort` (string), `limit` (number), `offset` (number)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

## Call example

```bash
curl -X GET "https://api.apiclay.com/v1/api/singaporeopendataapi/datasets" \
  -H "token: <YOUR_APICLAY_TOKEN>"
```

Index of every published API: https://apiclay.com/llms.txt
