Air quality and pollen forecast
$0.003 per callUSDC via x402
GET /api/air-quality-forecastAir quality and pollen forecast, 1-5 days: each day's worst US and European AQI with its peak hour, PM2.5, ozone and UV, pollen levels (Europe), and the worst hour. ?place=Delhi.
Details
Weather data by Open-Meteo.com (CC BY 4.0). Contains modified Copernicus Atmosphere Monitoring Service information (CAMS ENSEMBLE data provider). Neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
lat | number | no | Latitude, -90 to 90 (with lon; wins over place) The example sends 28.6139. |
lon | number | no | Longitude, -180 to 180 (with lat) The example sends 77.209. |
place | string | no | A city, town or region name instead of lat/lon, for example "Paris" or "Austin, TX" (not a street address); the answer echoes the place it resolved to Up to 100 characters. |
days | number | no | Forecast days, 1-5 (default 5) The example sends 5. |
Example request
curl -i "https://agent402.tools/api/air-quality-forecast?lat=28.6139&lon=77.209&days=5"
Watch a call get paid
Request
GET /api/air-quality-forecast402
$0.003 USDCSign
PAYMENT-SIGNATURESettle
on 14 chainsAnswer
200 OKReceipt
Agent402-ReceiptEd25519Example response
{
"lat": 28.6139,
"lon": 77.209,
"timezone": "Asia/Kolkata",
"days": 5,
"worstHour": {
"time": "2026-12-03T11:00",
"usAqi": 262,
"usCategory": "Very Unhealthy",
"euAqi": 104,
"euCategory": "Extremely poor"
},
"daily": [
{
"date": "2026-12-03",
"usAqiMax": 262,
"usCategory": "Very Unhealthy",
"usAqiPeakHour": "2026-12-03T11:00",
"euAqiMax": 136,
"euCategory": "Extremely poor",
"pm25Max": 229.6,
"ozoneMax": 167,
"uvMax": 3,
"pollen": null
}
],
"pollenCoverage": "Europe only: null elsewhere",
"units": {
"pm25": "μg/m³",
"ozone": "μg/m³",
"pollen": "grains/m³"
},
"method": "US AQI per the US EPA breakpoints and European AQI per the European Environment Agency's bands, from hourly CAMS forecasts. Pollen level by grains/m³: none under 1, low under 10, moderate under 50, high under 200, very high at 200 and over.",
"source": "air-quality-api.open-meteo.com (CC BY 4.0)",
"credit": "Contains modified Copernicus Atmosphere Monitoring Service information (CAMS ENSEMBLE data provider). Neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains.",
"attributionText": "Weather data by Open-Meteo.com (CC BY 4.0).",
"sourceUrl": "https://open-meteo.com/",
"licenseUrl": "https://creativecommons.org/licenses/by/4.0/"
}| Field | Type | Always present | In the example |
|---|---|---|---|
lat | number | yes | 28.6139 |
lon | number | yes | 77.209 |
timezone | string | yes | Asia/Kolkata |
days | number | yes | 5 |
worstHour | object | yes | 5 fields: time, usAqi, usCategory, euAqi, euCategory |
daily | array of objects | yes | 1 item in the example |
pollenCoverage | string | yes | Europe only: null elsewhere |
units | object | yes | 3 fields: pm25, ozone, pollen |
method | string | yes | US AQI per the US EPA breakpoints and European AQI per the European Environme... |
source | string | yes | air-quality-api.open-meteo.com (CC BY 4.0) |
credit | string | yes | Contains modified Copernicus Atmosphere Monitoring Service information (CAMS ... |
attributionText | string | yes | Weather data by Open-Meteo.com (CC BY 4.0). |
sourceUrl | string | yes | https://open-meteo.com/ |
licenseUrl | string | yes | https://creativecommons.org/licenses/by/4.0/ |
From an MCP client
catalog.call {
"slug": "air-quality-forecast",
"params": {
"lat": 28.6139,
"lon": 77.209,
"days": 5
}
}Hosted connector (https://agent402.tools/mcp): paid in the call. Stdio package (npx -y agent402-mcp@0.19.2): pays from a wallet or AGENT402_CREDITS_KEY.
Errors and behavior
- Pay $0.003 per call over x402 or MPP. Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key (
Authorization: Bearer a402_...) also pays it. - Every field is optional; a rejected input answers 4xx with
error,tool,expected,requiredandexample. - On this route, a call ending in any status of 400 or above is not charged over x402, MPP or a credits key. A Tempo push credential pays before the call; a failure is a refund owed.
- A
POSTwith a JSON body is served as this GET. - An
Idempotency-Keyreplays the first 200 uncharged (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.003" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/air-quality-forecast?lat=28.6139&lon=77.209&days=5");Get a wallet or run npx -y agent402-mcp@0.19.2 wallet new.
The quote (Python)
import base64, json, urllib.error, urllib.request
req = urllib.request.Request("https://agent402.tools/api/air-quality-forecast?lat=28.6139&lon=77.209&days=5", method="GET", headers={})
try:
urllib.request.urlopen(req)
except urllib.error.HTTPError as e:
quote = json.loads(base64.b64decode(e.headers["PAYMENT-REQUIRED"]))
print(e.code, [(a["network"], a["amount"]) for a in quote["accepts"]]) # the price, per chain, in base units