Air Quality API quick reference

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

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

What you can do with Air Quality API

See the guides linked below for each task, or compare across products in the Capabilities Explorer.