get_aqi_by_city
Pack: waqi · Endpoint: https://gateway.pipeworx.io/waqi/mcp
Real-time AQI for a city. Returns AQI value, dominant pollutant, individual pollutant readings (PM2.5, PM10, O3, NO2, SO2, CO), temperature/humidity/pressure, and station info.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
city | string | yes | City name (e.g., “beijing”, “los-angeles”, “new-delhi”) |
Example call
Arguments
{
"city": "beijing"
}
curl
curl -X POST https://gateway.pipeworx.io/waqi/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_aqi_by_city","arguments":{"city":"beijing"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('get_aqi_by_city', {
"city": "beijing"
});
More examples
{
"city": "new-delhi"
}
Response shape
Always returns: aqi, category, dominant_pollutant, station, measurements, measured_at, timezone, attributions
| Field | Type | Description |
|---|---|---|
aqi | number | null | Air Quality Index value |
category | string | null | AQI category (Good/Moderate/Unhealthy/Hazardous) |
dominant_pollutant | string | null | Primary pollutant causing poor air quality |
station | object | |
measurements | object | |
measured_at | string | null | ISO timestamp of measurement |
timezone | string | null | Timezone of station |
attributions | array | Data sources and attributions |
Full JSON Schema
{
"type": "object",
"properties": {
"aqi": {
"type": [
"number",
"null"
],
"description": "Air Quality Index value"
},
"category": {
"type": [
"string",
"null"
],
"description": "AQI category (Good/Moderate/Unhealthy/Hazardous)"
},
"dominant_pollutant": {
"type": [
"string",
"null"
],
"description": "Primary pollutant causing poor air quality"
},
"station": {
"type": "object",
"properties": {
"id": {
"type": [
"number",
"null"
],
"description": "Station identifier"
},
"name": {
"type": [
"string",
"null"
],
"description": "Station/city name"
},
"latitude": {
"type": [
"number",
"null"
],
"description": "Station latitude"
},
"longitude": {
"type": [
"number",
"null"
],
"description": "Station longitude"
},
"url": {
"type": [
"string",
"null"
],
"description": "Station information URL"
}
}
},
"measurements": {
"type": "object",
"properties": {
"pm25": {
"type": [
"number",
"null"
],
"description": "PM2.5 concentration in µg/m³"
},
"pm10": {
"type": [
"number",
"null"
],
"description": "PM10 concentration in µg/m³"
},
"o3": {
"type": [
"number",
"null"
],
"description": "Ozone concentration in µg/m³"
},
"no2": {
"type": [
"number",
"null"
],
"description": "Nitrogen dioxide in µg/m³"
},
"so2": {
"type": [
"number",
"null"
],
"description": "Sulfur dioxide in µg/m³"
},
"co": {
"type": [
"number",
"null"
],
"description": "Carbon monoxide in µg/m³"
},
"temperature_c": {
"type": [
"number",
"null"
],
"description": "Temperature in Celsius"
},
"humidity_pct": {
"type": [
"number",
"null"
],
"description": "Humidity percentage"
},
"pressure_hpa": {
"type": [
"number",
"null"
],
"description": "Atmospheric pressure in hPa"
},
"wind_speed": {
"type": [
"number",
"null"
],
"description": "Wind speed"
}
}
},
"measured_at": {
"type": [
"string",
"null"
],
"description": "ISO timestamp of measurement"
},
"timezone": {
"type": [
"string",
"null"
],
"description": "Timezone of station"
},
"attributions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": [
"string",
"null"
],
"description": "Attribution source name"
},
"url": {
"type": [
"string",
"null"
],
"description": "Attribution source URL"
}
}
},
"description": "Data sources and attributions"
}
},
"required": [
"aqi",
"category",
"dominant_pollutant",
"station",
"measurements",
"measured_at",
"timezone",
"attributions"
]
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"waqi": {
"url": "https://gateway.pipeworx.io/waqi/mcp"
}
}
}
See Getting Started for client-specific install steps.