The Air Quality API is a REST web service that returns air quality data for a specific location, including over 70 air quality indexes, pollutant details, and health recommendations, at 500 x 500 meter resolution in over 100 countries. It has endpoints for current conditions, hourly history (up to 30 days), hourly forecast (up to 96 hours), and heatmap tiles.
Air Quality API: key facts
- Product: Air Quality API
- Also known as: Google Maps Platform Air Quality API
- Category: Environment
- Platform: Web service (REST)
- Runs on: Server (backend code)
- Launch stage: GA
- Lifecycle: Active
- Overview: Air Quality API overview
- Regional availability: Limited. Over 100 countries; local AQIs vary by country (see links.coverage). If your billing address is in the EEA, you can display heatmap tiles on any map. (coverage details)
Air Quality API: when to use it
Use Air Quality API when:
- You need current hourly air quality indexes, pollutant concentrations, or health recommendations for a latitude/longitude.
- You need hourly air quality history for a location for up to the past 30 days (720 hours).
- You need an hourly air quality forecast for a location up to 96 hours (4 days) ahead.
- You need color-coded air quality or pollutant heatmap tiles to overlay on a Google Map.
Don't use Air Quality API when:
- You need pollen types, plants, or pollen index data for a location. Use Pollen API instead.
- You need weather conditions or weather forecasts rather than air quality data. Use Weather API instead.
Air Quality API: setup
- Service to enable:
airquality.googleapis.com - Authentication: API key, OAuth 2.0, Service account
- Get started: Set up Air Quality API
- Reference: Air Quality API reference
- Pricing: Air Quality API usage and billing
- Policies: Air Quality API policies
- Release notes: Air Quality API release notes
Air Quality API: related products
- Often used with: Maps JavaScript API
Air Quality API: common mistakes
- Problem: Forecast requests without a future
dateTimeorperiodfail with HTTP 400INVALID_ARGUMENT("The specified time period is not supported..."); the time range is required and must start at least one rounded hour in the future. Fix: SetdateTimeorperiod(startTime/endTime) to a time at least one hour in the future and no more than 96 hours ahead, as in the basic request example. See /maps/documentation/air-quality/forecast. - Problem: History requests must set
dateTime,hours, orperiod(startTime/endTime) within the past 30 days (720 hours); older ranges fail with HTTP 400INVALID_ARGUMENT("The specified time period is not supported..."). Results are paged, and when you passpageTokenall other request parameters must match the original call. Fix: KeepdateTime,hours, orperiodwithin the past 30 days, usepageSize/nextPageToken, and resend identical parameters with eachpageToken. See /maps/documentation/air-quality/history. - Problem: If a
colorfield value is 0, that field is omitted from the response, so parsers that expectred/green/bluekeys can fail. Fix: Treat missing color components as 0. See /maps/documentation/air-quality/current-conditions. - Problem: By default the response includes only the Universal AQI; local AQIs are not returned unless requested. Fix: Set the corresponding parameters (for example
extraComputationsLOCAL_AQIorcustomLocalAqis) to add or replace the AQI. See /maps/documentation/air-quality/current-conditions.
What you can do with Air Quality API
See the guides linked below for each task, or compare across products in the Capabilities Explorer.
- Return the current air quality index for a specified geographic location.
- Return a description of the current air quality conditions for a specified geographic location.
- Return a list of the air pollutants and relative concentrations currently affecting a specified geographic location.
- Return details about the sources and effects of air pollutants currently affecting a specified geographic location.
- Return health recommendations based on the air quality conditions and pollutants currently affecting a specified geographic location.
- Return a four-day forecast for the air quality index for a specified geographic location.
- Return a four-day forecast of air quality descriptions for a specified geographic location.
- Return four-day forecast of the air pollutants and relative concentrations that will affect a specified geographic location.
- Return a four-day air quality forecast of the sources and effects of air pollutants that will affect a specified geographic location.
- Return a four-day forecast of health recommendations based on the air quality conditions and pollutants that will affect a specified geographic location.
- Return a 30-day history for the air quality index for a specified geographic location.
- Return a 30-day history of air quality descriptions for a specified geographic location.
- Return a 30-day history of the air pollutants and relative concentrations that affected a specified geographic location.
- Return a 30-day history of the sources and effects of air pollutants that affected a specified geographic location.
- Return a 30-day history of health recommendations based on the air quality conditions and pollutants that affected a specified geographic location.
- Return an image file of an air quality heatmap tile for a set of map tile coordinates and zoom level.