Skip to content

Air quality and pollen forecast

$0.003 per callUSDC via x402GET /api/air-quality-forecast

Air 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.

Category: Live public dataTags: weather air-quality aqi pollen forecast uv health

Try in playground →

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

NameTypeRequiredDescription
latnumbernoLatitude, -90 to 90 (with lon; wins over place) The example sends 28.6139.
lonnumbernoLongitude, -180 to 180 (with lat) The example sends 77.209.
placestringnoA 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.
daysnumbernoForecast 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

RequestGET /api/air-quality-forecast
402$0.003 USDC
SignPAYMENT-SIGNATURE
Settleon 14 chains
Answer200 OK
ReceiptAgent402-ReceiptEd25519

Example 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/"
}
FieldTypeAlways presentIn the example
latnumberyes28.6139
lonnumberyes77.209
timezonestringyesAsia/Kolkata
daysnumberyes5
worstHourobjectyes5 fields: time, usAqi, usCategory, euAqi, euCategory
dailyarray of objectsyes1 item in the example
pollenCoveragestringyesEurope only: null elsewhere
unitsobjectyes3 fields: pm25, ozone, pollen
methodstringyesUS AQI per the US EPA breakpoints and European AQI per the European Environme...
sourcestringyesair-quality-api.open-meteo.com (CC BY 4.0)
creditstringyesContains modified Copernicus Atmosphere Monitoring Service information (CAMS ...
attributionTextstringyesWeather data by Open-Meteo.com (CC BY 4.0).
sourceUrlstringyeshttps://open-meteo.com/
licenseUrlstringyeshttps://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

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

Guides that use this tool

Related tools