Developer resources
Haze Monitor API documentation for developers and agents.
The public API is read-only and returns the air-quality and context data used by Haze Monitor. It has no mutation endpoints, accounts or personal records. Read the OpenAPI 3.1 specification for complete request and response schemas.
Authentication and API keys
No API key or account is required. Send an Accept: application/json header with each request. There is no contractual rate limit or uptime guarantee. Follow each response's Cache-Control header and do not poll more often than the published cache lifetime.
Quickstart
Request current Malaysian station readings with curl -sS https://hazemonitor.com/api/air-quality -H 'Accept: application/json'. Check observedAt on the response and each station before using a value. A successful response is JSON. Errors also return JSON with code, message, resolution and requestId.
Read-only sandbox
There is no separate test environment because every published operation is a safe GET request over public data. Use the example links below as a live read-only sandbox. Do not use the service for load testing. Automated callers should cache responses and retry temporary failures according to Retry-After.
- Current Malaysia readingsAll DOE Malaysia monitoring stations with API/IPU values and observation times.
- Malaysia historyRecent hourly observations, or month and year aggregates for one station.
- Singapore readingsNEA 24-hour PSI and 1-hour PM2.5 observations for all five regions.
- Place searchPlace names and coordinates from public geocoding providers.
- Weather contextCurrent Open-Meteo weather for a valid coordinate pair.
- Malaysia state boundariesSimplified GeoJSON administrative boundaries used by the map.
Choosing the right endpoint
Use Malaysia API/IPU endpoints for DOE station readings and Singapore endpoints for NEA regional PSI and PM2.5. These measurements are not interchangeable. Weather, geocoding and state boundaries provide context only. Haze Monitor does not provide forecasts, medical advice or official public-health instructions.
Error handling and support
Use the stable error code for program logic and show message to a person. The resolution field tells an agent what to try next. Include requestId when reporting a repeatable API failure to mohtashammurshid@gmail.com.