How this works Bagaimana ia berfungsi
Method Kaedah
Where every number comes from, what the colours mean, when an alert fires, and what this site cannot tell you.
Data sources
Weather: the Open-Meteo Forecast API, which blends national weather models and picks the best ones for each place. Current conditions, 7 days of daily forecast and hourly values, in Malaysia time.
Air quality: the Open-Meteo Air Quality API, which serves the Copernicus Atmosphere Monitoring Service (CAMS) global forecast: a model on a grid of about 45 km, updated twice a day. We show 3 days of it. The US AQI and European AQI are computed by Open-Meteo; for PM2.5 and PM10 the US AQI uses a 24-hour rolling mean.
Attribution. Weather data by Open-Meteo.com, under CC BY 4.0. Contains modified Copernicus Atmosphere Monitoring Service information. We round values, compute daily summaries, and pick the category and advice text; those are our changes.
Places: 16 points, one per city: Kuala Lumpur, Putrajaya, Shah Alam, Seremban, Melaka, Johor Bahru, Kuantan, Kuala Terengganu, Kota Bharu, Ipoh, George Town, Alor Setar, Kangar, Kuching, Labuan, Kota Kinabalu. One request to each API carries all of them.
Why not Malaysia's official API (Indeks Pencemar Udara)?
Malaysia's official Air Pollutant Index is published by the Department of Environment (Jabatan Alam Sekitar) on APIMS, from real monitoring stations. We looked for a documented public API with terms that allow reuse and did not find one: the government's open data catalogue lists APIMS with its licence "not specified", and the openly licensed DOE-derived dataset on data.gov.my is monthly. So this site does not copy APIMS readings. Check APIMS for official numbers; they use Malaysia's own breakpoints, so an API of 100 and a US AQI of 100 are not the same thing.
Colours, advice and alerts
Colours follow the US EPA Air Quality Index categories. The advice is a plain-language summary of the EPA's guidance for each category, in English and Malay. It is general information, not medical advice.
| US AQI | Category | Kategori | On this site |
|---|---|---|---|
| 0–50 | Good | Baik | — |
| 51–100 | Moderate | Sederhana | — |
| 101–150 | Unhealthy for sensitive groups | Tidak sihat bagi kumpulan sensitif | Notice banner |
| 151–200 | Unhealthy | Tidak sihat | Alert banner and a feed entry |
| 201–300 | Very unhealthy | Sangat tidak sihat | Alert banner and a feed entry |
| 301–500 | Hazardous | Berbahaya | Alert banner and a feed entry |
Notice: any of the 16 places at US AQI 101 or more right now. Alert: any place at 151 or more, or Kuala Lumpur forecast to reach 151 within 24 hours. An alert is written to the alert log and the feeds once per place, local day and category.
The WHO comparison
The hero card compares the past 24 hours' mean PM2.5 with the World Health Organization's 2021 Air Quality Guidelines. The WHO sets a guideline and four interim targets for countries working towards it.
| Pollutant | Interim 1 | Interim 2 | Interim 3 | Interim 4 | Guideline |
|---|---|---|---|---|---|
| PM2.5 | 75 | 50 | 37.5 | 25 | 15 |
| PM10 | 150 | 100 | 75 | 50 | 45 |
History
Each update asks for the past 3 days as well, so a missed run does not leave a gap. For every complete day (Malaysia time) with at least 20 hours of data, it stores one small summary per place: peak and mean US AQI, mean PM2.5 and PM10, peak ozone and NO₂, high and low temperature and rainfall. A day already stored is never rewritten. These are the model's values for those hours, not station measurements.
Schedule and costs
A GitHub Actions workflow runs every 3 hours: it fetches, records new history days and alerts, builds this site and uploads it to Cloudflare Pages. GitHub can start scheduled runs late, or skip them when it is busy, so every page shows the data's own model hour and when it was built, and says so when the numbers are more than 7 hours old.
- GitHub minutes (private repositories get 2,000 free minutes a month; each job is billed in whole minutes, rounded up): 8 runs a day × 30.4 days ≈ 243 runs, at 1–2 billed minutes each = 243–486 minutes a month. Hourly would be 730 runs = 730–1460 minutes, too close to the limit once anything else runs on the account.
- Open-Meteo calls (free tier: fewer than 10,000 a day, non-commercial): the last update counted 28.8 calls (forecast 28.8, air quality not reported), so about 230 a day. Several places in one request count as several calls.
Limits
- Models, not monitors. Every air quality number is a forecast model's estimate for a grid cell tens of kilometres wide. A busy road, a local fire or a valley can be much worse than the cell average; the model can also be off on a whole haze episode.
- Neighbours can share a cell. Kuala Lumpur and Shah Alam are about 20 km apart and can fall in the same air quality grid cell, so their air numbers may be identical.
- Haze or ozone? The US AQI is the worst of several pollutants. In the model, a day's peak can be set by afternoon ozone rather than haze particles; the PM2.5 figure is the one that tracks haze.
- One point per state. Each state is represented by its capital. Kuching says little about Miri; Kuantan says little about Cameron Highlands.
- US AQI is not Malaysia's API. The scales and averaging differ. Use APIMS for official decisions such as school closures.
- Delays. Scheduled runs can start late. The age of the data is on every page.