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.
- Regional model estimatesCAMS modelled US AQI, PM2.5 and forecasts for Thailand, Indonesia, Vietnam or India; not observations.
- 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.
MCP server for agents
Agents that speak the Model Context Protocol can connect to https://hazemonitor.com/mcp over Streamable HTTP. It needs no key and keeps no session. In Claude Code, run claude mcp add --transport http haze-monitor https://hazemonitor.com/mcp. Other clients take the same URL as a remote HTTP server.
The server has two read-only tools. search_places finds a place id by name, local name, state, landmark or former name, or lists a country's places. get_air_quality takes that id and an optional ISO 8601 hour, read as local time at the place unless it carries an offset. It returns US AQI, PM2.5, the official DOE API or NEA PSI, and the hour the value describes.
Past and current hours are official observations in Malaysia and Singapore, and CAMS model estimates in Thailand, Indonesia, Vietnam and India. Future hours, up to 24 hours ahead, are CAMS model forecasts in every country. Each result has a kind of observation, model, forecast or unavailable. An hour with no observation is reported as unavailable, with the closest earlier reading listed separately. It is never filled from another hour or a farther station.
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. Among the JSON endpoints, only the regional model endpoint provides forecasts. Haze Monitor does not provide 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.