AirNow API: Get air quality
Gets AirNow current air quality, pollutant readings and today's and tomorrow's forecasts for a US city or ZIP code, or a covered Canadian or Mexican city.
Unofficial. Not affiliated with or endorsed by AirNow.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Location, required
location City and state, a five-digit US ZIP code, or a covered Canadian or Mexican city, for example Denver, CO or 94103.
Denver, CO
Input as JSON
{ "location": "Denver, CO"}Output
{ "aqi": 47, "category": "Good", "airnow_url": "https://www.airnow.gov/?reportingArea=Denver-Boulder&stateCode=CO" , "pollutants": [ { "aqi": 16, "category": "Good", "pollutant": "Ozone" }, { "aqi": 4, "category": "Good", "pollutant": "PM2.5" }, { "aqi": 47, "category": "Good", "pollutant": "PM10" } ], "health_advice": "Air quality is good. Enjoy outdoor activities.", "main_pollutant": "PM10", "reporting_area": "Denver-Boulder, CO", "observation_time": "2026-10-23T03:00:00-06:00", "today_forecast_aqi": null, "forecast_discussion": null, "today_forecast_date": "2026-10-23", "tomorrow_forecast_aqi": null, "tomorrow_forecast_date": "2026-10-24", "today_forecast_category": "Good", "tomorrow_forecast_category": null}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"airnow.gov/get_air_quality","input":{"location":"Denver, CO"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "airnow.gov/get_air_quality" , "input": { "location": "Denver, CO" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "airnow.gov/get_air_quality" , "input": { "location": "Denver, CO" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run airnow.gov/get_air_quality# with {"location":"Denver, CO"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "location" ], "properties": { "location": { "type": "string", "description": "City and state, a five-digit US ZIP code, or a covered Canadian or Mexican city, for example Denver, CO or 94103." } }}Output schema
{ "type": "object", "required": [ "reporting_area", "observation_time", "aqi", "category", "main_pollutant", "pollutants", "today_forecast_date", "today_forecast_aqi", "today_forecast_category", "tomorrow_forecast_date", "tomorrow_forecast_aqi", "tomorrow_forecast_category", "forecast_discussion", "health_advice", "airnow_url" ], "properties": { "aqi": { "type": [ "integer", "null" ] }, "category": { "type": [ "string", "null" ] }, "airnow_url": { "type": "string" }, "pollutants": { "type": "array", "items": { "type": "object", "required": [ "pollutant", "aqi", "category" ], "properties": { "aqi": { "type": [ "integer", "null" ] }, "category": { "type": [ "string", "null" ] }, "pollutant": { "type": "string" } }, "additionalProperties": false } }, "health_advice": { "type": [ "string", "null" ] }, "main_pollutant": { "type": [ "string", "null" ] }, "reporting_area": { "type": "string" }, "observation_time": { "type": [ "string", "null" ] }, "today_forecast_aqi": { "type": [ "integer", "null" ] }, "forecast_discussion": { "type": [ "string", "null" ] }, "today_forecast_date": { "type": [ "string", "null" ] }, "tomorrow_forecast_aqi": { "type": [ "integer", "null" ] }, "tomorrow_forecast_date": { "type": [ "string", "null" ] }, "today_forecast_category": { "type": [ "string", "null" ] }, "tomorrow_forecast_category": { "type": [ "string", "null" ] } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
airnow.gov/get_air_quality- Returns
- current AQI and category, pollutant readings, today and tomorrow forecasts, health advice, AirNow link
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method airnow.gov/get_air_quality with the inputs above.
Ask your agent
- What's the air quality like in Denver, CO right now?
- Can you check the current AQI for ZIP code 94103 and tell me the main pollutant?
- I'm planning a run tomorrow in Austin, TX. Is the air forecast going to be safe for outdoor exercise?
- Give me today's and tomorrow's air quality forecast for 10001 and any health advice for people with asthma.
- Look up the current air quality category and pollutant readings for Guadalajara, Mexico on airnow.gov.
See more
Gets a city's current air quality, weather, daily forecast and health advice from IQAir.
iqair.com/get_air_qualityGets current conditions and RealFeel for a city or postal code on AccuWeather. The UV level follows standard UV-index ranges. Air quality is null unless it is shown with the current conditions.
accuweather.com/get_current_weatherGets the latest observed weather from a nearby National Weather Service station for a US city, address, or ZIP code. Measurements the station does not report are null.
weather.gov/get_current_conditionsGets current MSN Weather conditions for a city, address or ZIP code. The place is found through OpenStreetMap Nominatim. Matches for broad searches are approximate.
msn.com/get_current_weatherGets current conditions and today's high and low from The Weather Channel for a city, postcode, ZIP code or street address worldwide. Street addresses are geocoded exactly first; some observations omit gusts or other measurements.
weather.com/get_current_weatherReturns up to five days of pollen index and level for a US ZIP code, with top allergens for today and tomorrow where Pollen.com lists them.
pollen.com/get_pollen_forecastLooks up a US city, street address or ZIP code and returns up to 156 hourly National Weather Service forecasts for it.
weather.gov/get_hourly_forecastGets the 30-minute chance of aurora overhead near a place, current geomagnetic activity, and the three-day Kp outlook. Visibility also depends on darkness and local conditions; tonight uses approximate local solar hours 18:00-06:00.
swpc.noaa.gov/get_aurora_forecast