Weather - Get Air Quality Daily Forecasts

Use to get daily air quality forecasts for the next one to seven days that include pollutant levels, potential risks and suggested precautions.
The Get Air Quality Daily Forecasts API is an HTTP GET request that returns detailed information about the concentration of pollutants and overall status of forecasted daily air quality. The service can provide forecasted daily air quality information for the upcoming 1 to 7 days, including pollution levels, air quality index values, the dominant pollutant, and a brief statement summarizing risk level and suggested precautions.

GET {endpoint}/weather/airQuality/forecasts/daily/json?api-version=1.1&query={query}
GET {endpoint}/weather/airQuality/forecasts/daily/json?api-version=1.1&language={language}&query={query}&duration={duration}

URI Parameters

Name In Required Type Description
endpoint
path True

string (uri)

The Azure Maps service hostname. Use https://atlas.microsoft.com for the Azure public cloud. To target a specific Azure Maps geography or a sovereign cloud, see Azure Maps geographic scope.

format
path True

JsonFormat

Desired format of the response. Only json format is supported.

api-version
query True

string

minLength: 1

The API version to use for this operation.

query
query True

number[]

The applicable query specified as a comma separated string composed by latitude followed by longitude e.g. "47.641268,-122.125679".

Weather information is generally available for locations on land, bodies of water surrounded by land, and areas of the ocean that are within approximately 50 nautical miles of a coastline.

duration
query

DailyDuration

Defines the duration for the air quality forecast, with options ranging from 1 to 7 days. The default duration is 1 day.

language
query

string

Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used.

Please refer to Supported Languages for details.

Request Header

Name Required Type Description
x-ms-client-id

string

Indicates the account intended for use with the Microsoft Entra ID security model. This unique ID for the Azure Maps account can be obtained from the Azure Maps management plane Account API. For more information on using Microsoft Entra ID security in Azure Maps, see Manage authentication in Azure Maps.

Responses

Name Type Description
200 OK

DailyAirQualityForecastResult

The request has succeeded.

Other Status Codes

ErrorResponse

An unexpected error response.

Security

AadToken

These are the Microsoft Entra OAuth 2.0 Flows. When paired with Azure role-based access control it can be used to control access to Azure Maps REST APIs. Azure role-based access controls are used to designate access to one or more Azure Maps resource account or sub-resources. Any user, group, or service principal can be granted access via a built-in role or a custom role composed of one or more permissions to Azure Maps REST APIs.

To implement scenarios, we recommend viewing authentication concepts. In summary, this security definition provides a solution for modeling application(s) via objects capable of access control on specific APIs and scopes.

Note

  • This security definition requires the use of the x-ms-client-id header to indicate which Azure Maps resource the application is requesting access to. This can be acquired from the Maps management API.
  • The Authorization URL is specific to the Azure public cloud instance. Sovereign clouds have unique Authorization URLs and Microsoft Entra ID configurations.
  • The Azure role-based access control is configured from the Azure management plane via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs.
  • Usage of the Azure Maps Web SDK allows for configuration based setup of an application for multiple use cases.
  • For more information on Microsoft identity platform, see Microsoft identity platform overview.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
https://atlas.microsoft.com/.default

subscription-key

This is a shared key that is provisioned when you Create an Azure Maps account in the Azure portal or using PowerShell, CLI, Azure SDKs, or REST API.

With this key, any application can access all REST API. In other words, this key can be used as a master key in the account that they are issued in.

For publicly exposed applications, our recommendation is to use the confidential client applications approach to access Azure Maps REST APIs so your key can be securely stored.

Type: apiKey
In: header

SAS Token

This is a shared access signature token is created from the List SAS operation on the Azure Maps resource through the Azure management plane via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs.

With this token, any application is authorized to access with Azure role-based access controls and fine-grain control to the expiration, rate, and region(s) of use for the particular token. In other words, the SAS Token can be used to allow applications to control access in a more secured way than the shared key.

For publicly exposed applications, our recommendation is to configure a specific list of allowed origins on the Map account resource to limit rendering abuse and regularly renew the SAS Token.

Type: apiKey
In: header

Examples

Get Daily Air Quality Forecasts

Sample request

GET https://atlas.microsoft.com/weather/airQuality/forecasts/daily/json?api-version=1.1&query=47.632346,-122.13887&duration=3

Sample response

{
  "results": [
    {
      "description": "The air quality is generally acceptable for most individuals. However, sensitive groups may experience minor to moderate symptoms from long-term exposure.",
      "category": "Fair",
      "categoryColor": "#FFC300",
      "dateTime": "2021-07-18T07:00:00+00:00",
      "dominantPollutant": "Ozone",
      "globalIndex": 42.2,
      "index": 35.1
    },
    {
      "description": "The air quality is generally acceptable for most individuals. However, sensitive groups may experience minor to moderate symptoms from long-term exposure.",
      "category": "Fair",
      "categoryColor": "#FFC300",
      "dateTime": "2021-07-19T07:00:00+00:00",
      "dominantPollutant": "Ozone",
      "globalIndex": 37,
      "index": 31.6
    },
    {
      "description": "The air quality is generally acceptable for most individuals. However, sensitive groups may experience minor to moderate symptoms from long-term exposure.",
      "category": "Fair",
      "categoryColor": "#FFC300",
      "dateTime": "2021-07-20T07:00:00+00:00",
      "dominantPollutant": "Ozone",
      "globalIndex": 40,
      "index": 33.6
    }
  ]
}

Definitions

Name Description
DailyAirQuality

The forecasted air-quality reading for a single day at the queried location, returned as one entry in DailyAirQualityForecastResult.results. Each entry summarizes the day's expected air quality on the same scales used by AirQuality for the current reading - the local AQI (index), the internationally normalized index (globalIndex), the dominantPollutant, a short category label (for example, Fair) and matching categoryColor swatch (for example, #FFC300), and a textual description of what the reading means for people. Across the entries in a single forecast response the values typically evolve from day to day - in the example response globalIndex runs 42.2 -> 37 -> 40 across three consecutive days while the dominant pollutant stays Ozone.

DailyAirQualityForecastResult

The response returned by the Get Daily Air Quality Forecasts operation, containing one forecasted air-quality reading per day for the queried location across the requested forecast horizon. The horizon is set by the caller's requested forecast duration (a DailyDuration value of 1, 2, 3, 4, 5, 6, or 7 days), so results carries that many entries in chronological order - for example, a 3-day request returns daily readings for 2021-07-18, 2021-07-19, and 2021-07-20. Each entry summarizes the day's expected air quality on the same scales used by the current air-quality reading, so it pairs naturally with AirQualityResult for showing "today plus the next several days" views.

DailyDuration

Defines the duration for the air quality forecast, with options ranging from 1 to 7 days. The default duration is 1 day.

DominantPollutant

Identifies the pollutant with the highest concentration.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

JsonFormat

Desired format of the response. Only json format is supported.

DailyAirQuality

The forecasted air-quality reading for a single day at the queried location, returned as one entry in DailyAirQualityForecastResult.results. Each entry summarizes the day's expected air quality on the same scales used by AirQuality for the current reading - the local AQI (index), the internationally normalized index (globalIndex), the dominantPollutant, a short category label (for example, Fair) and matching categoryColor swatch (for example, #FFC300), and a textual description of what the reading means for people. Across the entries in a single forecast response the values typically evolve from day to day - in the example response globalIndex runs 42.2 -> 37 -> 40 across three consecutive days while the dominant pollutant stays Ozone.

Name Type Description
category

string

A one-word summary of the day's forecasted air quality (for example, Excellent, Fair, or Poor), returned in the requested language. Pairs with categoryColor for a quick visual cue and with description for a longer explanation. Because the label is derived from the local AQI bands, it is comparable across locations even when raw index values are not.

categoryColor

string

The hexadecimal color associated with category, suitable for styling a UI swatch or badge - for example, #FFC300 for Fair. Categories and colors are consistent across daily forecast entries so the same label always renders with the same color.

dateTime

string (date-time)

The day this forecast covers, in ISO 8601 format (yyyy-mm-ddThh:mm:ss+hh:mm) - for example, 2021-07-18T07:00:00+00:00. Forecast entries within a single response use sequential dateTime values, one per day.

description

string

A short, human-readable explanation of the day's forecasted air quality and any precautions it suggests, returned in the requested language - for example, "The air quality is generally acceptable for most individuals. However, sensitive groups may experience minor to moderate symptoms from long-term exposure." Intended for direct display alongside category and categoryColor.

dominantPollutant

DominantPollutant

The pollutant expected to have the highest concentration during the day - one of the DominantPollutant values, for example Ozone. This is the pollutant that typically drives the day's index and globalIndex values.

globalIndex

number (float)

The forecasted air-quality index on the internationally normalized 0-to-300+ scale, where higher values denote poorer air quality. The scale is the same as AirQuality.globalIndex, so values are comparable across locations and across days - for example, 42.2, 37, and 40 on three consecutive forecast days. The index reflects concentrations of PM2.5, PM10, NO2, SO2, CO, and O3.

index

number (float)

The forecasted overall air-quality index (AQI) for the day, on the scale set by the local regulating body for the queried location. Like AirQuality.index, this is comparable across days at the same location - for example, 35.1, 31.6, and 33.6 on three consecutive days - but not directly comparable across locations because each region uses its own scale. Use category for a location-independent label. For background, see Air quality index on Wikipedia.

DailyAirQualityForecastResult

The response returned by the Get Daily Air Quality Forecasts operation, containing one forecasted air-quality reading per day for the queried location across the requested forecast horizon. The horizon is set by the caller's requested forecast duration (a DailyDuration value of 1, 2, 3, 4, 5, 6, or 7 days), so results carries that many entries in chronological order - for example, a 3-day request returns daily readings for 2021-07-18, 2021-07-19, and 2021-07-20. Each entry summarizes the day's expected air quality on the same scales used by the current air-quality reading, so it pairs naturally with AirQualityResult for showing "today plus the next several days" views.

Name Type Description
nextLink

string

The URL to retrieve the next page of results when the response is paginated, suitable for navigating through result sets too large to return in a single call. Empty when there are no further pages.

results

DailyAirQuality[]

The list of forecasted daily air-quality readings for the queried location, one entry per day, in chronological order starting with the earliest forecasted day. The number of entries matches the requested forecast duration - for example, a 3-day request returns three entries with dateTime values 2021-07-18T07:00:00+00:00, 2021-07-19T07:00:00+00:00, and 2021-07-20T07:00:00+00:00. Each entry reports the day's index, globalIndex, dominantPollutant, category, categoryColor, and a textual description.

DailyDuration

Defines the duration for the air quality forecast, with options ranging from 1 to 7 days. The default duration is 1 day.

Value Description
1

1 day

2

2 days

3

3 days

4

4 days

5

5 days

6

6 days

7

7 days

DominantPollutant

Identifies the pollutant with the highest concentration.

Value Description
Carbon Monoxide

Carbon monoxide (CO) is a colorless, odorless, and tasteless but highly toxic gas produced by the incomplete combustion of carbon-containing fuels. Common sources include vehicle exhaust, gas stoves, furnaces, and wood fires.

Nitrogen Dioxide

Nitrogen dioxide (NO2) is a significant atmospheric pollutant. It is regulated and subject to recommended limit guidelines set by the World Health Organization (WHO).

Ozone

Ozone (O3) is a key component of photochemical smog, the brown, harmful haze that envelops many large cities, resulting from a photochemical reaction between sunlight and certain specific pollutants.

Particulate Matter 2.5

Particulate matter 2.5 (PM2.5) refers to fine particles with diameters that are generally 2.5 micrometers and smaller. These particles are more than 100 times thinner than a human hair and can remain suspended in the air for extended periods.

Particulate Matter 10

Particulate matter 10 (PM10) refers to particles with diameters that are generally 10 micrometers and smaller. These particles can include dust, pollen, soot, smoke, and liquid droplets.

Sulfur Dioxide

Sulfur dioxide (SO2) is a heavy, colorless inorganic gas with a pungent, irritating odor. It is mainly produced by burning fossil fuels at power plants and industrial facilities, but it can also be emitted from natural sources such as volcanoes.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

maps.weather.getairqualitydailyforecasts

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

Name Type Description
error

ErrorDetail

The error object.

JsonFormat

Desired format of the response. Only json format is supported.

Value Description
json

The JavaScript Object Notation Data Interchange Format