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](https://developers.google.com/maps/documentation/air-quality/overview.md.txt)
- **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](https://developers.google.com/maps/documentation/air-quality/coverage.md.txt))

## 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](https://developers.google.com/maps/documentation/pollen/quick-reference.md.txt) instead.
- You need weather conditions or weather forecasts rather than air quality data. Use [Weather API](https://developers.google.com/maps/documentation/weather/quick-reference.md.txt) 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](https://developers.google.com/maps/documentation/air-quality/get-api-key.md.txt)
- **Reference:** [Air Quality API reference](https://developers.google.com/maps/documentation/air-quality/reference.md.txt)
- **Pricing:** [Air Quality API usage and billing](https://developers.google.com/maps/documentation/air-quality/usage-and-billing.md.txt)
- **Policies:** [Air Quality API policies](https://developers.google.com/maps/documentation/air-quality/policies.md.txt)
- **Release notes:** [Air Quality API release notes](https://developers.google.com/maps/documentation/air-quality/release-notes.md.txt)

## Air Quality API: related products

- **Often used with:** [Maps JavaScript API](https://developers.google.com/maps/documentation/javascript/quick-reference.md.txt)

## Air Quality API: common mistakes

- **Problem:** Forecast requests without a future `dateTime` or `period` fail with HTTP 400 `INVALID_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:** Set `dateTime` or `period` (`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](https://developers.google.com/maps/documentation/air-quality/forecast.md.txt).
- **Problem:** History requests must set `dateTime`, `hours`, or `period` (`startTime`/`endTime`) within the past 30 days (720 hours); older ranges fail with HTTP 400 `INVALID_ARGUMENT` ("The specified time period is not supported..."). Results are paged, and when you pass `pageToken` all other request parameters must match the original call. **Fix:** Keep `dateTime`, `hours`, or `period` within the past 30 days, use `pageSize`/`nextPageToken`, and resend identical parameters with each `pageToken`. See [/maps/documentation/air-quality/history](https://developers.google.com/maps/documentation/air-quality/history.md.txt).
- **Problem:** If a `color` field value is 0, that field is omitted from the response, so parsers that expect `red`/`green`/`blue` keys can fail. **Fix:** Treat missing color components as 0. See [/maps/documentation/air-quality/current-conditions](https://developers.google.com/maps/documentation/air-quality/current-conditions.md.txt).
- **Problem:** By default the response includes only the Universal AQI; local AQIs are not returned unless requested. **Fix:** Set the corresponding parameters (for example `extraComputations` `LOCAL_AQI` or `customLocalAqis`) to add or replace the AQI. See [/maps/documentation/air-quality/current-conditions](https://developers.google.com/maps/documentation/air-quality/current-conditions.md.txt).

## What you can do with Air Quality API

See the guides linked below for each task, or compare across products in the
[Capabilities Explorer](https://developers.google.com/maps/documentation/capabilities-explorer.md.txt).

- [Return the current air quality index for a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/current-conditions.md.txt)
- [Return a description of the current air quality conditions for a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/current-conditions.md.txt)
- [Return a list of the air pollutants and relative concentrations currently affecting a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/current-conditions.md.txt)
- [Return details about the sources and effects of air pollutants currently affecting a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/current-conditions.md.txt)
- [Return health recommendations based on the air quality conditions and pollutants currently affecting a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/current-conditions.md.txt)
- [Return a four-day forecast for the air quality index for a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/forecast.md.txt)
- [Return a four-day forecast of air quality descriptions for a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/forecast.md.txt)
- [Return four-day forecast of the air pollutants and relative concentrations that will affect a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/forecast.md.txt)
- [Return a four-day air quality forecast of the sources and effects of air pollutants that will affect a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/forecast.md.txt)
- [Return a four-day forecast of health recommendations based on the air quality conditions and pollutants that will affect a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/forecast.md.txt)
- [Return a 30-day history for the air quality index for a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/history.md.txt)
- [Return a 30-day history of air quality descriptions for a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/history.md.txt)
- [Return a 30-day history of the air pollutants and relative concentrations that affected a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/history.md.txt)
- [Return a 30-day history of the sources and effects of air pollutants that affected a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/history.md.txt)
- [Return a 30-day history of health recommendations based on the air quality conditions and pollutants that affected a specified geographic location.](https://developers.google.com/maps/documentation/air-quality/history.md.txt)
- [Return an image file of an air quality heatmap tile for a set of map tile coordinates and zoom level.](https://developers.google.com/maps/documentation/air-quality/heatmaps.md.txt)