# Singapore Open Data Scraper (`parseforge/singapore-data-gov-sg-scraper`) Actor

Scrapes any dataset from data.gov.sg using its resource ID. Returns each row as a flat object with optional full-text search and exact field filters.

- **URL**: https://apify.com/parseforge/singapore-data-gov-sg-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Other, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $14.00 / 1,000 result items

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

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### Singapore Open Data Scraper

**Scrape any public dataset from data.gov.sg by resource ID, with full-text search and exact field filters.** Returns every row in a flat, analysis-ready schema. Export to CSV, JSON, Excel, or XML.

Singapore's open data portal holds thousands of government datasets, but downloading and cleaning them manually is slow. This Actor reads any dataset directly from data.gov.sg using its resource ID, applies your search terms and field filters, and returns the rows in one consistent format. No API key or registration needed.

| Who uses it | What they scrape Singapore Open Data for |
|---|---|
| Property analysts | Pull HDB resale flat prices by town and flat type for valuation models. |
| Policy researchers | Track dengue cluster locations or PSI readings over time for public health reports. |
| Data journalists | Grab the latest traffic accident data or school directory for a story. |
| App builders | Feed real-time weather readings or carpark availability into a mobile app. |

### What it does

This Actor collects rows from a specified data.gov.sg dataset and returns each record as a flat object.

- 🔍 **Full-text search:** filter rows by any keyword across all fields with the searchQuery input.
- 🎯 **Exact field filters:** pass a JSON object like {"town":"BISHAN"} to match only those rows.
- 📦 **Bulk collection:** set maxItems up to 1,000,000 to pull the entire dataset in one run.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with Singapore Open Data data

**🏠 Monitor HDB resale prices.**

A property analyst pulls the latest resale flat transactions filtered by town and flat type to update a pricing dashboard.

**🦟 Track dengue clusters.**

A health researcher collects the weekly dengue cluster dataset to map outbreak hotspots and alert residents.

**🚗 Analyse traffic incidents.**

A data journalist scrapes the traffic accident dataset to find the most dangerous roads and publish an interactive map.

**🌤️ Feed real-time weather data.**

An app developer pulls the latest PSI and temperature readings to show a live environment widget.

### Why choose this scraper

|  | What you get |
|---|---|
| **No API key** | Reads the public CKAN API directly, no registration. |
| **Fixed schema** | Every run returns the same flat structure, ready for pandas or Excel. |
| **Full dataset** | Collect up to a million rows per run for large historical datasets. |

### How it compares

This Actor is built specifically for Singapore's open data portal, while the competitors below target different sources.

| Feature | ParseForge | Shopee Scraper |
|---|---|---|
| Scrapes data.gov.sg datasets | Yes | Not listed |
| Full-text search across dataset rows | Yes | Not listed |
| Exact field filters via JSON | Yes | Not listed |
| No API key required | Yes | Not listed |
| Returns government open data | Yes | Not listed |

### Configure the run

Drive the Actor with a resource ID from data.gov.sg, and optionally narrow results with a keyword search or exact-match field filters. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "maxItems": 10,
  "resourceId": "d_8b84c4ee58e3cfc0ece0d773c8ca6abc"
}
```

A larger pull:

```json
{
  "maxItems": 200,
  "resourceId": "d_8b84c4ee58e3cfc0ece0d773c8ca6abc"
}
```

### Pricing

Pay-per-result: **$0.01867 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $1.87 |
| 1,000 results | $18.67 |
| 10,000 results | $186.70 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [Singapore Open Data Scraper](https://apify.com/parseforge/singapore-data-gov-sg-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to Singapore Open Data through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/singapore-data-gov-sg-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check that the resource ID is correct and the dataset is still active on data.gov.sg. If you are using filters or searchQuery, try removing them to see if the dataset returns rows without filtering.

**The Actor returns fewer rows than expected.**

The API may paginate results. Increase maxItems and ensure your filters are not too restrictive. Some datasets also have a server-side row limit.

**I get an error about an invalid resource ID.**

Verify the resource ID by visiting the dataset page on data.gov.sg. The ID is case-sensitive and must include the d\_ prefix.

**My JSON filter is not working.**

Ensure the filters input is valid JSON. Use double quotes for keys and string values, like {"town":"BISHAN"}. Test the filter on the data.gov.sg API explorer first.

**The run times out on large datasets.**

Lower maxItems or increase the Actor's timeout in the run settings. For very large datasets, consider splitting by date or category filters across multiple runs.

### FAQ

| Question | Answer |
|---|---|
| How do I find the resource ID for a dataset? | Browse data.gov.sg, open the dataset you want, and copy the resource ID from the URL or the API section. It looks like d\_8b84c4ee58e3cfc0ece0d773c8ca6abc. |
| Can I scrape multiple datasets in one run? | Each run targets one resource ID. To collect multiple datasets, run the Actor once per resource ID, or use an Apify workflow to chain runs. |
| What format does the data come in? | The Actor returns JSON rows. You can export the dataset to CSV, JSON, Excel, or XML from the Apify console. |
| Do I need a data.gov.sg API key? | No. The Actor reads the public CKAN API, which does not require authentication or an API key. |
| How do I filter by a specific column? | Use the filters input with a JSON object. For example, {"town":"BISHAN","flat\_type":"4 ROOM"} returns only rows matching those exact values. |
| Is there a limit to how many rows I can get? | You can set maxItems up to 1,000,000. The actual number depends on the dataset size and the API's pagination limits. |
| Can I search for a keyword across all fields? | Yes. The searchQuery input performs a full-text search on the dataset, returning rows where any field contains your term. |
| What if the dataset has nested fields? | The Actor flattens the response into a flat object. Nested structures are returned as stringified JSON within the row. |
| Does this work for real-time datasets like carpark availability? | Yes. You can point it at any dataset on data.gov.sg, including real-time ones, and schedule the Actor to run every few minutes. |
| Can I use this for commercial projects? | The data is provided by the Singapore government under open licence terms. Check the specific dataset's licence on data.gov.sg for commercial use. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Government Technology Agency (GovTech). It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

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

How many datasets to collect per run.

## `resourceId` (type: `string`):

Dataset resource identifier from data.gov.sg. Example: d\_8b84c4ee58e3cfc0ece0d773c8ca6abc (HDB resale flat prices).

## `searchQuery` (type: `string`):

Full-text search across all fields. Leave blank to return all rows.

## `filters` (type: `object`):

Exact-match filters as a JSON object. Example: {"town":"BISHAN","flat\_type":"4 ROOM"}.

## Actor input object example

```json
{
  "maxItems": 10,
  "resourceId": "d_8b84c4ee58e3cfc0ece0d773c8ca6abc"
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "maxItems": 10,
    "resourceId": "d_8b84c4ee58e3cfc0ece0d773c8ca6abc"
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/singapore-data-gov-sg-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 = {
    "maxItems": 10,
    "resourceId": "d_8b84c4ee58e3cfc0ece0d773c8ca6abc",
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/singapore-data-gov-sg-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 '{
  "maxItems": 10,
  "resourceId": "d_8b84c4ee58e3cfc0ece0d773c8ca6abc"
}' |
apify call parseforge/singapore-data-gov-sg-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/singapore-data-gov-sg-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/TzFB2f0ZAezcnUfWS/builds/KuYgaPgzdnPDBpaep/openapi.json
