---
title: "Current air quality at a location"
description: "Returns current air-quality conditions for a coordinate, proxied from the Google Air Quality API.\n\nThe server reads its Google key from the `GOOGLE_AIR_QUALITY_API_KEY` environment variable at startup; without it this endpoint answers 503. Errors from Google itself (for example 403 `BILLING_DISABLED`) are relayed as the body of an HTTP 200."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.aireon.ch/llms.txt
> Use this file to discover all available pages before exploring further.

Path: RES API (public) › Parcel

`GET /res_api/airquality`

Returns current air-quality conditions for a coordinate, proxied from the Google Air Quality API.

The server reads its Google key from the `GOOGLE_AIR_QUALITY_API_KEY` environment variable at startup; without it this endpoint answers 503. Errors from Google itself (for example 403 `BILLING_DISABLED`) are relayed as the body of an HTTP 200.

## Authentication

- `ResApiToken`, apiKey, in header, header `token`

## Query parameters

- `lat` (`getAirQuality.query.lat`; number, required): WGS84 latitude.
- `lng` (`getAirQuality.query.lng`; number, required): WGS84 longitude.

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://res.aireon.ch/res_api/airquality?lat=0&lng=0' \
  --header 'token: <token>'
```

### TypeScript

```typescript
const url = 'https://res.aireon.ch/res_api/airquality?lat=0&lng=0';
const options = {method: 'GET', headers: {token: '<token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://res.aireon.ch/res_api/airquality?lat=0&lng=0"

headers = {"token": "<token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Air-quality data passed through from Google Air Quality, or a plain-text error body.

#### Body (application/json)

##### Example

```json
{}
```

#### Body (text/html)

##### Example

```text
missing 'lat'
```

### 401

Authentication missing or invalid.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`getAirQuality.response.401.error`; string, required): Human-readable error description.
- `message` (`getAirQuality.response.401.message`; string, optional): Optional underlying error message.

### 503

The Google Air Quality API key is not configured on this server (`GOOGLE_AIR_QUALITY_API_KEY` is unset).

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`getAirQuality.response.503.error`; string, required): Human-readable error description.
- `message` (`getAirQuality.response.503.message`; string, optional): Optional underlying error message.


Source: https://docs.aireon.ch/res/get-air-quality/index.md
