# Singapore Air Quality, PSI, UV & Dengue Alerts (`hipersoft/sg-environment-scraper`) Actor

Live Singapore environmental data in one Actor (official NEA feeds): PSI & PM2.5 by region with health bands, UV index, and active dengue clusters with case counts and location. Schedule it for alerts. No key.

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

## Pricing

from $0.001 / reading returned

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Air Quality, PSI, UV & Dengue Alerts

Live **Singapore environmental data in one Actor** — pulled from the official **NEA real-time feeds** on data.gov.sg. Get **PSI and PM2.5 by region** (with health bands), the national **UV index**, and every active **dengue cluster** (case counts + location) — as clean JSON, CSV or Excel. **Schedule it** to power alerts, dashboards and monitoring. No key, no login.

Great for **facilities & construction, outdoor/events, health analytics, travel and smart-city apps**.

![Singapore Environment Scraper input — pick the PSI, PM2.5, UV and dengue feeds in the Apify Console](https://api.apify.com/v2/key-value-stores/SUfvnaFLd9z9eBCtV/records/sg-environment-scraper-input.png?v=2)

### What you get

- 🌫️ **PSI** — 24h PSI per region (west/east/central/south/north/national) + health band, and the pollutant sub-indices (PM2.5, PM10, O₃, NO₂, SO₂, CO)
- 😷 **PM2.5** — 1-hour PM2.5 per region
- ☀️ **UV index** — latest national UV reading + band
- 🦟 **Dengue clusters** — active clusters with locality, total case size, breakdown (homes / public places / construction sites) and centroid coordinates
- 🧾 **Provenance** — `feed`, `timestamp`, `sourceUrl`, `collectedAt` on every row
- ⏱️ **Monitor-friendly** — schedule it and each run appends a timestamped snapshot

### Example input

```json
{ "feeds": ["psi", "pm25", "uv", "dengue"] }
```

Pick any subset of feeds.

### Output

![Singapore Environment Scraper output example — PSI, PM2.5, UV and dengue readings as structured JSON](https://api.apify.com/v2/key-value-stores/SUfvnaFLd9z9eBCtV/records/sg-environment-scraper-output.png?v=5)

```json
{ "feed": "psi", "region": "west", "timestamp": "2026-07-30T15:00:00+08:00",
  "psi24h": 56, "band": "Moderate", "pm25_24h": 14, "pm10_24h": 30,
  "latitude": 1.35735, "longitude": 103.7, "sourceUrl": "https://api.data.gov.sg/v1/environment/psi",
  "collectedAt": "2026-07-30T07:25:00.000Z" }
```

```json
{ "feed": "dengue", "locality": "TAMPINES STREET 21", "caseSize": 12,
  "casesInHomes": 10, "casesInPublicPlaces": 2, "casesInConstructionSites": 0,
  "latitude": 1.3521, "longitude": 103.9445, "collectedAt": "2026-07-30T07:25:00.000Z" }
```

#### Output schema

Each row carries a `feed` field; the other fields depend on which feed produced the row.

| Field | Type | Description |
|-------|------|-------------|
| `feed` | string | Which feed the row came from: `psi`, `pm25`, `uv`, or `dengue`. |
| `region` | string | Region the reading covers (west/east/central/south/north/national). |
| `timestamp` | string (ISO date) | Reading time reported by the source feed. |
| `psi24h` | integer | 24-hour PSI value (psi feed). |
| `band` | string | Health band label for the reading (psi and uv feeds). |
| `pm25_24h` | integer | 24-hour PM2.5 concentration (psi feed). |
| `pm10_24h` | integer | 24-hour PM10 concentration (psi feed). |
| `o3_8h_max` | integer | 8-hour maximum ozone sub-index (psi feed). |
| `no2_1h_max` | integer | 1-hour maximum nitrogen dioxide sub-index (psi feed). |
| `so2_24h` | integer | 24-hour sulphur dioxide sub-index (psi feed). |
| `co_8h_max` | integer | 8-hour maximum carbon monoxide sub-index (psi feed). |
| `pm25_1h` | integer | 1-hour PM2.5 concentration (pm25 feed). |
| `uvIndex` | number | Latest national UV index value (uv feed). |
| `id` | string | Cluster identifier (dengue feed). |
| `locality` | string | Cluster locality name (dengue feed). |
| `caseSize` | integer | Total cases in the cluster (dengue feed). |
| `casesInHomes` | integer | Cases at residential premises (dengue feed). |
| `casesInPublicPlaces` | integer | Cases at public places (dengue feed). |
| `casesInConstructionSites` | integer | Cases at construction sites (dengue feed). |
| `latitude` | number | Latitude for the region or dengue cluster centroid. |
| `longitude` | number | Longitude for the region or dengue cluster centroid. |
| `sourceUrl` | string (URL) | Official data.gov.sg feed the row was pulled from. |
| `collectedAt` | string (ISO date) | When this Actor collected the reading. |

### Input fields

| Field | Description |
|-------|-------------|
| `feeds` | Any of `psi`, `pm25`, `uv`, `dengue` (default all). |

### FAQ

**How current is it?**
The NEA feeds update in near real time; `timestamp` is the reading time and `collectedAt` is your pull time.

**What are the PSI bands?**
Good (0–50), Moderate (51–100), Unhealthy (101–200), Very Unhealthy (201–300), Hazardous (300+).

**Can I get alerts?**
Schedule the Actor and compare each snapshot — e.g. notify when PSI enters "Unhealthy" or a new dengue cluster appears.

**How does billing work?**
A tiny per-feed fetch charge plus pay per reading returned.

**Can I integrate this with other tools?**
The Singapore Environment Scraper can be connected with almost any cloud service or web app thanks to [integrations on the Apify platform](https://apify.com/integrations). It works with [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier), [Slack](https://docs.apify.com/platform/integrations/slack), [Airbyte](https://docs.apify.com/platform/integrations/airbyte), [GitHub](https://docs.apify.com/platform/integrations/github), [Google Drive](https://docs.apify.com/platform/integrations/drive) and [many more](https://apify.com/integrations), plus the [Apify API](https://docs.apify.com/api/v2), JavaScript/Python clients and MCP. Or use [webhooks](https://docs.apify.com/platform/integrations/webhooks) to trigger an action whenever a run finishes.

### Related Actors

- [Singapore Carpark Availability (Live)](https://apify.com/hipersoft/sg-carpark-scraper)
- [Singapore Hawker Centres & Closures](https://apify.com/hipersoft/sg-hawker-scraper)
- [Singapore Childcare & Preschool Directory](https://apify.com/hipersoft/sg-childcare-scraper)

### Notes

Original clean-room implementation using Singapore's official NEA open data (data.gov.sg), reused under the Singapore Open Data Licence. Not affiliated with or endorsed by NEA or the Singapore Government.

# Actor input Schema

## `feeds` (type: `array`):

Which live feeds to pull.

## Actor input object example

```json
{
  "feeds": [
    "psi",
    "pm25",
    "uv",
    "dengue"
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

The scraped results as dataset items.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/sg-environment-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("hipersoft/sg-environment-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 '{}' |
apify call hipersoft/sg-environment-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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