# Singapore HDB Resale Flat Prices Scraper (`crawlerbros/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/crawlerbros/hdb-resale-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Automation, Developer tools, Real estate
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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("crawlerbros/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("crawlerbros/hdb-resale-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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 crawlerbros/hdb-resale-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=crawlerbros/hdb-resale-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Singapore HDB Resale Flat Prices Scraper",
        "description": "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.",
        "version": "1.0",
        "x-build-id": "bNqgBztUgDgrEoKsB"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crawlerbros~hdb-resale-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crawlerbros-hdb-resale-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/crawlerbros~hdb-resale-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crawlerbros-hdb-resale-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/crawlerbros~hdb-resale-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crawlerbros-hdb-resale-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "search",
                            "byTown"
                        ],
                        "type": "string",
                        "description": "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.",
                        "default": "search"
                    },
                    "town": {
                        "title": "Town",
                        "enum": [
                            "",
                            "ANG MO KIO",
                            "BEDOK",
                            "BISHAN",
                            "BUKIT BATOK",
                            "BUKIT MERAH",
                            "BUKIT PANJANG",
                            "BUKIT TIMAH",
                            "CENTRAL AREA",
                            "CHOA CHU KANG",
                            "CLEMENTI",
                            "GEYLANG",
                            "HOUGANG",
                            "JURONG EAST",
                            "JURONG WEST",
                            "KALLANG/WHAMPOA",
                            "MARINE PARADE",
                            "PASIR RIS",
                            "PUNGGOL",
                            "QUEENSTOWN",
                            "SEMBAWANG",
                            "SENGKANG",
                            "SERANGOON",
                            "TAMPINES",
                            "TOA PAYOH",
                            "WOODLANDS",
                            "YISHUN"
                        ],
                        "type": "string",
                        "description": "HDB town name. Case-insensitive exact match (e.g. TAMPINES, BISHAN, JURONG WEST). Leave blank to search all towns."
                    },
                    "flatType": {
                        "title": "Flat Type",
                        "enum": [
                            "",
                            "1 ROOM",
                            "2 ROOM",
                            "3 ROOM",
                            "4 ROOM",
                            "5 ROOM",
                            "EXECUTIVE",
                            "MULTI-GENERATION"
                        ],
                        "type": "string",
                        "description": "HDB flat type. Leave blank for all types."
                    },
                    "minPrice": {
                        "title": "Min Resale Price (SGD)",
                        "minimum": 0,
                        "maximum": 10000000,
                        "type": "integer",
                        "description": "Minimum resale price in Singapore dollars."
                    },
                    "maxPrice": {
                        "title": "Max Resale Price (SGD)",
                        "minimum": 0,
                        "maximum": 10000000,
                        "type": "integer",
                        "description": "Maximum resale price in Singapore dollars."
                    },
                    "dateFrom": {
                        "title": "Date From (YYYY-MM)",
                        "type": "string",
                        "description": "Only include transactions from this month onwards (e.g. 2024-01)."
                    },
                    "dateTo": {
                        "title": "Date To (YYYY-MM)",
                        "type": "string",
                        "description": "Only include transactions up to and including this month (e.g. 2024-12)."
                    },
                    "minFloorArea": {
                        "title": "Min Floor Area (sqm)",
                        "minimum": 0,
                        "maximum": 500,
                        "type": "number",
                        "description": "Minimum floor area in square metres."
                    },
                    "maxFloorArea": {
                        "title": "Max Floor Area (sqm)",
                        "minimum": 0,
                        "maximum": 500,
                        "type": "number",
                        "description": "Maximum floor area in square metres."
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of transaction records to return.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
