# Singapore HDB Resale Flat Prices Scraper (`crawlergang/hdb-resale-scraper`) Actor

Scrape Singapore HDB resale flat transaction data from the official data.gov.sg open API. Filter by town, flat type, price range, floor area, and date range. No auth, no proxy required.

- **URL**: https://apify.com/crawlergang/hdb-resale-scraper.md
- **Developed by:** [Crawler Gang](https://apify.com/crawlergang) (community)
- **Categories:** Automation, Developer tools, Real estate
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Singapore HDB Resale Flat Prices Scraper

Extract official Singapore HDB (Housing Development Board) resale flat transaction data directly from the Singapore Government's open data portal ([data.gov.sg](https://data.gov.sg/dataset/resale-flat-prices)). No authentication, no proxy, and no rate limits — it's a fully open government API.

### What This Actor Does

This actor queries the official HDB resale flat prices dataset published by Singapore's Housing Development Board. It supports filtering by town, flat type, price range, floor area, and date range, and returns structured transaction records including a derived price-per-sqm field.

The data covers HDB resale transactions from 2017 to present. HDB (public housing) accounts for over 80% of Singapore's residential housing stock, making this one of the most comprehensive property transaction datasets in Southeast Asia.

### Data Source

**Source:** [data.gov.sg — Resale Flat Prices](https://data.gov.sg/dataset/resale-flat-prices)\
**API:** Singapore Government CKAN open data API (no auth required)\
**Coverage:** All 26 HDB towns, all flat types (1 ROOM to EXECUTIVE), 2017–present\
**Update frequency:** Monthly by HDB

### Input Parameters

| Field | Type | Description |
|-------|------|-------------|
| `mode` | select | `search` (filter transactions) or `byTown` (all records for one town) |
| `town` | select | HDB town name — e.g. TAMPINES, BISHAN, JURONG WEST |
| `flatType` | select | Flat type — 1 ROOM, 2 ROOM, 3 ROOM, 4 ROOM, 5 ROOM, EXECUTIVE, MULTI-GENERATION |
| `minPrice` | integer | Minimum resale price in SGD |
| `maxPrice` | integer | Maximum resale price in SGD |
| `dateFrom` | string | Start month in YYYY-MM format (e.g. 2024-01) |
| `dateTo` | string | End month in YYYY-MM format (e.g. 2024-12) |
| `minFloorArea` | number | Minimum floor area in square metres |
| `maxFloorArea` | number | Maximum floor area in square metres |
| `maxItems` | integer | Maximum number of records to return (default: 100, max: 10,000) |

### Output Fields

Each output record contains:

| Field | Type | Description |
|-------|------|-------------|
| `month` | string | Transaction month (YYYY-MM) |
| `town` | string | HDB town name (e.g. TAMPINES) |
| `flatType` | string | Flat type (e.g. 4 ROOM) |
| `block` | string | Block number |
| `streetName` | string | Street name |
| `storeyRange` | string | Storey range (e.g. "07 TO 09") |
| `floorAreaSqm` | number | Floor area in square metres |
| `flatModel` | string | Flat model (e.g. Improved, New Generation) |
| `leaseCommenceDate` | integer | Year lease commenced |
| `remainingLease` | string | Remaining lease (e.g. "61 years 04 months") |
| `resalePrice` | integer | Resale price in SGD |
| `pricePerSqm` | number | Derived: resalePrice / floorAreaSqm |
| `sourceUrl` | string | Fixed: https://data.gov.sg/dataset/resale-flat-prices |
| `scrapedAt` | string | UTC ISO timestamp of when the record was fetched |
| `recordType` | string | Always "transaction" |

### Example Output

```json
{
  "month": "2024-03",
  "town": "TAMPINES",
  "flatType": "4 ROOM",
  "block": "123",
  "streetName": "TAMPINES AVE 4",
  "storeyRange": "07 TO 09",
  "floorAreaSqm": 93.0,
  "flatModel": "New Generation",
  "leaseCommenceDate": 1988,
  "remainingLease": "61 years 04 months",
  "resalePrice": 490000,
  "pricePerSqm": 5268.82,
  "sourceUrl": "https://data.gov.sg/dataset/resale-flat-prices",
  "scrapedAt": "2026-06-07T12:00:00+00:00",
  "recordType": "transaction"
}
```

### Use Cases

- **Property market research** — Track HDB resale price trends by town, flat type, or floor area
- **Investment analysis** — Identify undervalued towns or flat types by comparing price-per-sqm
- **Real estate reporting** — Generate price indices and statistics for Singapore public housing
- **Academic research** — Study Singapore's public housing market and affordability trends
- **Buyer/seller tools** — Compare recent transactions before making purchase or sale decisions

### Frequently Asked Questions

**Q: Does this require any API key or login?**\
No. The data.gov.sg API is fully open. No authentication, no API key, no cookies.

**Q: Does it work without a proxy?**\
Yes. The data.gov.sg API is a government open data service with no bot protection or geo-blocking.

**Q: How current is the data?**\
HDB updates the dataset monthly. The latest transactions are typically available within 30 days of the transaction month.

**Q: What is the full date range covered?**\
The dataset covers resale transactions from January 2017 to the present.

**Q: How many records are available?**\
The full dataset contains over 170,000 transactions (and grows monthly).

**Q: Can I get all transactions for a town?**\
Yes — set `mode` to `byTown`, select the town, and set `maxItems` to 10000.

**Q: What is `pricePerSqm`?**\
It is a derived field calculated as `resalePrice / floorAreaSqm`, rounded to 2 decimal places. Useful for comparing value across different flat sizes.

**Q: Are HDB flats freehold?**\
No. All HDB flats are on 99-year leases. The `leaseCommenceDate` and `remainingLease` fields tell you how much lease is left.

# Actor input Schema

## `mode` (type: `string`):

How to query the data. Use `search` to filter by any combination of town/flat type/price/date. Use `byTown` to fetch all transactions for a single HDB town.

## `town` (type: `string`):

HDB town name. Case-insensitive exact match (e.g. TAMPINES, BISHAN, JURONG WEST). Leave blank to search all towns.

## `flatType` (type: `string`):

HDB flat type. Leave blank for all types.

## `minPrice` (type: `integer`):

Minimum resale price in Singapore dollars.

## `maxPrice` (type: `integer`):

Maximum resale price in Singapore dollars.

## `dateFrom` (type: `string`):

Only include transactions from this month onwards (e.g. 2024-01).

## `dateTo` (type: `string`):

Only include transactions up to and including this month (e.g. 2024-12).

## `minFloorArea` (type: `number`):

Minimum floor area in square metres.

## `maxFloorArea` (type: `number`):

Maximum floor area in square metres.

## `maxItems` (type: `integer`):

Maximum number of transaction records to return.

## Actor input object example

```json
{
  "mode": "search",
  "town": "TAMPINES",
  "maxItems": 10
}
```

# Actor output Schema

## `transactions` (type: `string`):

Dataset containing all scraped HDB resale flat transaction records.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "search",
    "town": "TAMPINES",
    "flatType": "",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlergang/hdb-resale-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "search",
    "town": "TAMPINES",
    "flatType": "",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlergang/hdb-resale-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "search",
  "town": "TAMPINES",
  "flatType": "",
  "maxItems": 10
}' |
apify call crawlergang/hdb-resale-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlergang/hdb-resale-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ZRcOm9pHfadAsJVv2/builds/jkGXFXSd98LcaHQEa/openapi.json
