Weather - Get Current Air Quality
Use to get current air quality information that includes potential risks and
suggested precautions.
The Get Current Air Quality API is an HTTP GET request that returns
detailed information about the concentration of pollutants and overall status
for current air quality, including pollution levels, air quality index values,
the dominant pollutant, and a brief statement summarizing risk level and
suggested precautions.
GET {endpoint}/weather/airQuality/current/json?api-version=1.1&query={query}
GET {endpoint}/weather/airQuality/current/json?api-version=1.1&language={language}&query={query}&pollutants={pollutants}
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
The Azure Maps service hostname. Use |
|
format
|
path | True |
Desired format of the response. Only |
|
|
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. |
|
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. |
|
|
pollutants
|
query |
boolean |
Boolean value that returns detailed information about each pollutant. By default is True. |
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 |
The request has succeeded. |
|
| Other Status Codes |
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-idheader to indicate which Azure Maps resource the application is requesting access to. This can be acquired from the Maps management API. - The
Authorization URLis 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 Current Air Quality
Sample request
GET https://atlas.microsoft.com/weather/airQuality/current/json?api-version=1.1&query=47.632346,-122.13887
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-19T02:00:00+00:00",
"dominantPollutant": "Ozone",
"globalIndex": 22.1,
"index": 21.6,
"pollutants": [
{
"name": "Nitrogen Dioxide",
"type": "NO2",
"concentration": {
"unit": "µg/m³",
"unitType": 31,
"value": 13.4
},
"globalIndex": 6.7,
"index": 6.7
},
{
"name": "Ozone",
"type": "O3",
"concentration": {
"unit": "µg/m³",
"unitType": 31,
"value": 53.5
},
"globalIndex": 22.1,
"index": 21.6
},
{
"name": "Particulate Matter 10",
"type": "PM10",
"concentration": {
"unit": "µg/m³",
"unitType": 31,
"value": 12.2
},
"globalIndex": 12.2,
"index": 11.3
},
{
"name": "Particulate Matter 2.5",
"type": "PM2.5",
"concentration": {
"unit": "µg/m³",
"unitType": 31,
"value": 3.2
},
"globalIndex": 6.5,
"index": 13.5
},
{
"name": "Carbon Monoxide",
"type": "CO",
"concentration": {
"unit": "µg/m³",
"unitType": 31,
"value": 118.4
},
"globalIndex": 0.6,
"index": 1.2
},
{
"name": "Sulfur Dioxide",
"type": "SO2",
"concentration": {
"unit": "µg/m³",
"unitType": 31,
"value": 1.1
},
"globalIndex": 1.1,
"index": 0.6
}
]
}
]
}
Definitions
| Name | Description |
|---|---|
|
Air |
The current air-quality reading at one location, returned as the entry in
|
|
Air |
The response returned by the Get Current Air Quality operation, providing
the current air-quality conditions at a specified location. The |
|
Dominant |
Identifies the pollutant with the highest concentration. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). |
|
Json |
Desired format of the response. Only |
| Pollutant |
A single pollutant measured at the queried location, returned as one entry
in |
|
Pollutant |
A description for the six types of pollutants tracked by the Azure Maps Weather service. |
|
Unit |
An integer value associated with the type of unit being displayed. For example, 17 for Celsius, 18 for Fahrenheit. Can be used for unit translation. For more information, see Weather services in Azure Maps. |
|
Weather |
Values for weather-related metrics such as temperature, dew point, and wind speed, presented in either metric or imperial units, as specified in the unit URI parameter. For more information, see Unit types in the article Weather services in Azure Maps. |
AirQuality
The current air-quality reading at one location, returned as the entry in
AirQualityResult.results. Combines the air-quality index reported by the
local regulating body (index) with an internationally normalized index
(globalIndex), identifies the dominantPollutant driving the result,
and pairs them with a localized qualitative category and a matching
categoryColor suitable for color-coded UI. A short description
explains what the reading means for everyday activities and any health
precautions, and - when the request asks for pollutant detail - the
pollutants array carries a per-pollutant breakdown.
| Name | Type | Description | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| category |
string |
A short qualitative summary of the current air quality, returned in the language specified in the request. Typical values include Good, Fair, Moderate, Poor, and Hazardous; the exact set depends on the regulating body for the queried location. |
||||||||||||||
| categoryColor |
string |
A hexadecimal color code matching |
||||||||||||||
| dateTime |
string (date-time) |
The date and time the air-quality reading applies to, in ISO 8601 format (yyyy-mm-ddThh:mm:ss+hh:mm). For example, 2021-07-19T02:00:00+00:00. |
||||||||||||||
| description |
string |
A free-form sentence or two explaining the current air quality and any precautions sensitive groups should consider, returned in the language specified in the request. For example, The air quality is generally acceptable for most individuals. However, sensitive groups may experience minor to moderate symptoms from long-term exposure. |
||||||||||||||
| dominantPollutant |
The pollutant driving the current |
|||||||||||||||
| globalIndex |
number (float) |
A normalized air-quality index designed to be comparable across
locations, independent of any local AQI scale. The value is the
highest individual sub-index across the six measured pollutants
(PM2.5, PM10, NO2, SO2, CO, O3); the
pollutant producing that maximum is returned in Range and categories:
For example, given sub-indices CO 0.6, SO2 1.1, PM2.5 6.5,
NO2 6.7, PM10 12.2, O3 22.1, |
||||||||||||||
| index |
number (float) |
The air-quality index (AQI) on the scale set by the local regulating
body for the queried location. AQI scales vary widely between countries
and regions, so the same numeric value can mean different things at
different locations - use |
||||||||||||||
| pollutants |
Per-pollutant detail behind the overall reading, with one |
AirQualityResult
The response returned by the Get Current Air Quality operation, providing
the current air-quality conditions at a specified location. The results
array contains a single AirQuality entry summarizing the local and
globally-normalized air-quality indices, the dominant pollutant, a
qualitative category and matching color, a short description of the health
implications, and (when requested) per-pollutant detail.
| 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 |
The current air-quality reading at the location, returned as a
single-element array. The entry reports the local air-quality index
( |
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.getcurrentairquality |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
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 |
The error object. |
JsonFormat
Desired format of the response. Only json format is supported.
| Value | Description |
|---|---|
| json |
Pollutant
A single pollutant measured at the queried location, returned as one entry
in AirQuality.pollutants. Each entry identifies the pollutant (by code
and English name), reports its measured concentration in the air, and
gives the pollutant's individual contribution to the local AQI (index)
and the internationally normalized index (globalIndex) - the same two
scales reported at the overall reading on AirQuality, but restricted
to this pollutant. A typical air-quality reading carries one entry per
pollutant - Nitrogen Dioxide, Ozone, Particulate Matter 10,
Particulate Matter 2.5, Carbon Monoxide, and Sulfur Dioxide - so
callers can see which substances are present and how much each
contributes.
| Name | Type | Description |
|---|---|---|
| concentration |
The pollutant's measured concentration in the air, in micrograms per
cubic meter (µg/m³) for NO2, O3, PM10, PM2.5, CO, and
SO2 - for example, 53.5 µg/m³ for Ozone or 13.4 µg/m³ for
Nitrogen Dioxide - or in parts per million (ppm) when reported in
that unit. Concentration is the raw measurement that feeds into
|
|
| globalIndex |
number (float) |
This pollutant's contribution to the internationally normalized
air-quality index, on the same 0-to-300+ scale as
|
| index |
number (float) |
This pollutant's contribution to the overall air-quality index (AQI)
on the scale set by the local regulating body for the queried
location. Uses the same local scale as |
| name |
string |
The pollutant's English name that pairs with |
| type |
The pollutant code, used as a stable, language-independent identifier -
one of the |
PollutantType
A description for the six types of pollutants tracked by the Azure Maps Weather service.
| Value | Description |
|---|---|
| CO |
The average concentration of carbon monoxide (CO) in micrograms per cubic meter (µg/m³) over the past hour. 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. |
| NO2 |
The average concentration of nitrogen dioxide (NO2) in micrograms per cubic meter (µg/m³) over the past hour. NO2 is a significant atmospheric pollutant. It is regulated and subject to recommended limit guidelines set by the World Health Organization (WHO). |
| O3 |
The average concentration of Ozone (O3) in micrograms per cubic meter (µg/m³) over the past hour. 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 specific pollutants. |
| PM2.5 |
The average concentration of particles smaller than 2.5 microns in diameter, measured in micrograms per cubic meter (µg/m³), over the past hour. PM2.5, also known as aerosols, consists of fine dust and tiny liquid droplets suspended in the air. |
| PM10 |
The average concentration of particles with diameters between 2.5 and 10 microns, measured in micrograms per cubic meter (µg/m³) over the past hour. Particulate matter 10 (PM10), also known as aerosols, consists of fine dust and tiny liquid droplets suspended in the air. |
| SO2 |
The average concentration of Sulfur dioxide (SO2) in micrograms per cubic meter (µg/m³) over the past hour. SO2 is a dense, colorless inorganic gas with a pungent, irritating odor. It is primarily produced by the combustion of fossil fuels at power plants and industrial facilities, but it can also be emitted from natural sources such as volcanoes. |
UnitType
An integer value associated with the type of unit being displayed. For example, 17 for Celsius, 18 for Fahrenheit. Can be used for unit translation. For more information, see Weather services in Azure Maps.
| Value | Description |
|---|---|
| 0 |
feet |
| 1 |
inches |
| 2 |
miles |
| 3 |
millimeter |
| 4 |
centimeter |
| 5 |
meter |
| 6 |
kilometer |
| 7 |
kilometersPerHour |
| 8 |
knots |
| 9 |
milesPerHour |
| 10 |
metersPerSecond |
| 11 |
hectoPascals |
| 12 |
inchesOfMercury |
| 13 |
kiloPascals |
| 14 |
millibars |
| 15 |
millimetersOfMercury |
| 16 |
poundsPerSquareInch |
| 17 |
Celsius |
| 18 |
Fahrenheit |
| 19 |
kelvin |
| 20 |
percent |
| 21 |
float |
| 22 |
integer |
| 31 |
MicrogramsPerCubicMeterOfAir |
WeatherValue
Values for weather-related metrics such as temperature, dew point, and wind speed, presented in either metric or imperial units, as specified in the unit URI parameter. For more information, see Unit types in the article Weather services in Azure Maps.
| Name | Type | Description |
|---|---|---|
| unit |
string |
The unit of measurement used in the return value, such as "C" for Celsius, "F" for Fahrenheit. |
| unitType |
An integer representing the type of unit. For example, 0 for feet, 1 for inches, 2 for miles. For a complete list, see Unit types in the article Weather services in Azure Maps. |
|
| value |
number (float) |
The measured value expressed in the specified unit. |