# Iqair — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Monitor real-time and historical air quality data worldwide, including global rankings, city-specific pollution details, and map visualizations. Search live city rankings and access comprehensive air quality information to track pollution levels across the globe.

**Category:** Weather | **Website:** [iqair.com/](https://iqair.com/) | **Docs:** [parse.bot/marketplace/c60726f6-31ec-4942-bed3-ab85344a9a65/iqair-com-api](https://parse.bot/marketplace/c60726f6-31ec-4942-bed3-ab85344a9a65/iqair-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-iqair-com-api-c60726f6/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_city_air_quality

Full air quality details for a specific city including current conditions, pollutant breakdown with concentrations, hourly and daily forecasts, weather data, pollen indices, and health recommendations. City, state, and country are URL slugs found in the url field of ranking endpoints (e.g. '/usa/new-york/new-york-city' yields country='usa', state='new-york', city='new-york-city').

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `city` | string | Yes | City URL slug (e.g. 'new-york-city', 'beijing', 'santiago'). Obtainable from the url field of get_live_city_ranking or get_world_air_quality results. |
| `country` | string | Yes | Country URL slug (e.g. 'usa', 'china', 'chile'). |
| `state` | string | Yes | State/region URL slug (e.g. 'new-york', 'beijing', 'santiago-metropolitan'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-iqair-com-api-c60726f6/get_city_air_quality \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"city":"<string>","country":"<string>","state":"<string>"}'
```

### get_live_city_ranking

Real-time global city air quality rankings sorted by AQI descending. Returns up to 122 major cities with current AQI values, geographic metadata, and follower counts. Updates hourly.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-iqair-com-api-c60726f6/get_live_city_ranking \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_map_data

Air quality station clusters for map visualization. Returns geographic clusters with aggregated AQI values and station counts within the specified bounding box. Higher zoom levels produce more granular clusters. Useful for building air quality heatmaps.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `bbox` | string | No | Bounding box as comma-separated string: minLng,minLat,maxLng,maxLat (e.g. '-122.5,37.0,-121.5,38.0'). Omitting returns global data. |
| `zoom` | integer | No | Map zoom level (1-20). Higher values return more granular clusters with fewer stations per cluster. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-iqair-com-api-c60726f6/get_map_data \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bbox":"<string>","zoom":"<integer>"}'
```

### get_world_air_quality

Global air quality overview returning the top 15 most polluted and top 15 cleanest major cities worldwide. Each city entry includes current AQI, geographic identifiers, and a URL slug path usable with get_city_air_quality. Data updates hourly.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-iqair-com-api-c60726f6/get_world_air_quality \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
