Air quality

GET https://api.api.sh/weather/v1/air-quality
1 credit / call public data try it in the playground →

Air quality for any place: the official AQI of the nearest reporting area in the US, Canada or Mexico (observed now by pollutant, plus today's and tomorrow's forecasts with action days and the forecaster's discussion), and worldwide the median PM2.5 and PM10 of nearby open low-cost sensors with US AQI and European AQI bands, temperature and humidity. Sources: EPA AirNow (public domain), Sensor.Community (ODbL).

Every response includes credits_used: the credits this call cost.

Parameters

nametypedescription
lat number Latitude. Pass with lon; or use q, postal_code or geonameid.
lon number Longitude.
q string Place name, e.g. Los Angeles, Delhi, Berlin, DE. Example: Los Angeles
postal_code string Postal code, with country (default US).
country string Country for q or postal_code.
geonameid integer GeoNames id of a place.
radius_km number Sensor search radius in km (default 10, max 50).

Every endpoint also takes fresh, raw, fields (see lean responses and caching).

Example

curl "https://api.api.sh/weather/v1/air-quality" \
  -H "x-api-key: $APISH_KEY"

Response

A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).

The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.