PROGovernment ยท HDB via data.gov.sg

HDB Resale Flat Prices

Every HDB resale transaction from 2017 onward: month, town, flat type, block, street, storey range, floor area, remaining lease and resale price. The canonical dataset behind SG property analytics.

How to authenticate

2 stops to a working call

  1. 1No key needed.
  2. 2Query the datastore_search endpoint with this resource_id and optional filters/q/limit/offset params.

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":{"records":[{"_id":1,"month":"2017-01","town":"ANG MO KIO","flat_type":"2 ROOM","floor_area_sqm":"44","resale_price":232000}]}}

datastore_search: working example

The dataset ID d_8b84c4ee58e3cfc0ece0d773c8ca6abc is passed as resource_id. No key is needed.

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

Real response, truncated:

{"success":true,"result":{"resource_id":"d_8b84c4ee58e3cfc0ece0d773c8ca6abc",
 "fields":[{"type":"text","id":"month"},{"type":"text","id":"town"},...,{"type":"numeric","id":"resale_price"},{"type":"int4","id":"_id"}],
 "records":[{"_id":1,"month":"2017-01","town":"ANG MO KIO","flat_type":"2 ROOM","block":"406",
  "street_name":"ANG MO KIO AVE 10","storey_range":"10 TO 12","floor_area_sqm":"44",
  "flat_model":"Improved","lease_commence_date":"1979","remaining_lease":"61 years 04 months",
  "resale_price":"232000"}, ...],
 "_links":{"start":"...","next":"/api/action/datastore_search?resource_id=...&offset=2&limit=2"},
 "total":241251,"limit":2}}

Fields: month, town, flat_type, block, street_name, storey_range, floor_area_sqm, flat_model, lease_commence_date, remaining_lease, resale_price, _id. Most values come back as strings, including resale_price. The dataset covers registrations from Jan 2017 onwards.

Parameters: limit, offset, q, filters, sort

  • limit: rows per page. The documented default is 100.
  • offset: rows to skip. Follow result._links.next to page.
  • q: full text search, for example q=ANG MO KIO.
  • filters: URL-encoded JSON of exact matches, for example {"town":"BEDOK"}.
  • sort: field names with ordering, for example month desc.
  • fields: comma-separated columns to return.
curl 'https://data.gov.sg/api/action/datastore_search?resource_id=d_8b84c4ee58e3cfc0ece0d773c8ca6abc&limit=1&filters=%7B%22town%22%3A%22BEDOK%22%7D'

Use result.total to know how many pages remain. For all 240,000+ rows, use the CSV download below instead of paging.

datastore_search_sql: we called https://data.gov.sg/api/action/datastore_search_sql on 2026-09-25 and got an HTML page, not JSON. It is not listed in the current data.gov.sg developer guide. Use filters, q and sort, or download the CSV and query it locally.

CSV download: initiate-download and poll-download

The full CSV comes from the v1 download API on api-open.data.gov.sg. Call initiate, then poll until status is DOWNLOAD_SUCCESS, then fetch data.url.

curl 'https://api-open.data.gov.sg/v1/public/api/datasets/d_8b84c4ee58e3cfc0ece0d773c8ca6abc/initiate-download'
curl 'https://api-open.data.gov.sg/v1/public/api/datasets/d_8b84c4ee58e3cfc0ece0d773c8ca6abc/poll-download'

Real poll-download response, truncated:

{"code":0,"data":{"status":"DOWNLOAD_SUCCESS",
 "url":"https://s3.ap-southeast-1.amazonaws.com/table-downloads-ingest.data.gov.sg/d_8b84c4ee58e3cfc0ece0d773c8ca6abc/6f81...csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&...&X-Amz-Expires=3600&..."}}

The CSV download URL is a signed S3 link. Its X-Amz-Expires=3600 means it lasts one hour, so do not hardcode it. Request a fresh one each run. Dataset metadata is at https://api-production.data.gov.sg/v2/public/api/datasets/d_8b84c4ee58e3cfc0ece0d773c8ca6abc/metadata.

Errors and rate limits

  • 429 / code 24 TOO_MANY_REQUESTS: returned as {"code":24,"name":"TOO_MANY_REQUESTS",...,"errorMsg":"Rate limit exceeded. Please try again in 10 seconds..."}. Limits reset every 10 seconds.
  • 404 Resource not found: wrong resource_id. Check the d_ ID.
  • code 28 Route not found: wrong path, for example /metadata on the v1 host. Metadata is on the v2 host.

Per 10 seconds, per the official rate limit page:

  • Datastore Search: 4 without key, 8 with dev key, 20 with prod key.
  • Dataset Downloads: 2 without key, 4 dev, 10 prod.

The APIs are free. Sign up on data.gov.sg for a key to get higher limits.

HDB Resale Flat Prices: common questions

Is the HDB Resale Flat Prices free?

Yes. HDB via data.gov.sg offers the HDB Resale Flat Prices free of charge.

Does the HDB Resale Flat Prices need an API key?

No. The HDB Resale Flat Prices can be called without an API key or login.

What is the HDB Resale Flat Prices endpoint?

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

How do I use datastore_search for d_8b84c4ee58e3cfc0ece0d773c8ca6abc?

Call https://data.gov.sg/api/action/datastore_search?resource_id=d_8b84c4ee58e3cfc0ece0d773c8ca6abc with optional limit, offset, q, filters and sort. No key is needed.

What is the CSV download URL for HDB resale prices?

There is no fixed URL. Call initiate-download then poll-download on api-open.data.gov.sg/v1/public/api/datasets/d_8b84c4ee58e3cfc0ece0d773c8ca6abc. The response gives a signed S3 link valid for one hour.

What does poll-download return?

JSON with code 0 and data.status. When status is DOWNLOAD_SUCCESS, data.url holds the CSV link.

What is the datastore_search limit?

limit sets rows per page and defaults to 100. The rate limit is 4 calls per 10 seconds without a key, 8 with a dev key and 20 with a prod key.

Does datastore_search_sql work on data.gov.sg?

Not in our test on 25 Sep 2026. It returned an HTML page, and it is not in the current developer guide. Use filters and sort, or download the CSV.

Is there a GitHub example?

We do not link an official one. The curl commands on this page work as written, and data.gov.sg dataset pages show a Python requests example.

Verified 2026-09-25 against data.gov.sg, guide.data.gov.sg, guide.data.gov.sg

Notes for AI agents

resale_price is numeric but floor_area_sqm is text; cast before math. Earlier periods (1990-2016) live in separate resource ids in the same collection.

Machine-readable version: /api/apis/hdb-resale-prices

On the same line