# Iqair Airvisual — how to use (mcp.ai)

Connect your Iqair Airvisual account and use 10 tools for developer tools straight from your AI agent. Connect with your own API key. IQAir AirVisual provides global air quality data through its API, offering real-time and historical information on air pollution levels.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_iqair_airvisual?ms=1787293620000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `iqair_airvisual_get_air_quality_forecast_data`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/iqair_airvisual`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/iqair_airvisual/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/iqair_airvisual/get/air/quality/forecast/data` — Tool to retrieve air quality forecast data for a specified city, state, and country. Use after confirming location details.
  - body: { city: string, state: string, country: string }
- `POST https://api.mcp.ai/api/iqair_airvisual/get/cities` — Tool to list supported cities in a specified state and country. Use when you need to retrieve cities for a given state/country.
  - body: { state: string, country: string }
- `POST https://api.mcp.ai/api/iqair_airvisual/get/city/air/quality` — Tool to retrieve air quality data for a specific city. Use when you need current pollution and weather data by specifying city, state, and country.
  - body: { city: string, state: string, country: string }
- `POST https://api.mcp.ai/api/iqair_airvisual/get/countries` — Tool to list all supported countries. Use when you need to know which countries are supported by the AirVisual API.
- `POST https://api.mcp.ai/api/iqair_airvisual/get/historical/aqi/data` — Tool to retrieve historical air quality data for a city. Use after confirming city, state, and country when you need AQI readings over time.
  - body: { end?: string, city: string, start?: string, state: string, country: string }
- `POST https://api.mcp.ai/api/iqair_airvisual/get/nearest/city/air/quality` — Tool to retrieve air quality data for the nearest city based on latitude/longitude or IP. Use when you have precise location data or want to geolocate an IP for air quality.
  - body: { ip?: string, lat?: number, lon?: number }
- `POST https://api.mcp.ai/api/iqair_airvisual/get/nearest/station/air/quality` — Tool to get nearest station air quality. Use when you have GPS coordinates and need closest station’s AQI.
  - body: { lat: number, lon: number }
- `POST https://api.mcp.ai/api/iqair_airvisual/get/states` — Tool to list supported states in a specified country. Use when you need to retrieve states/provinces for a given country.
  - body: { country: string }
- `POST https://api.mcp.ai/api/iqair_airvisual/get/station/by/id` — Fetches current air quality and weather data for a specific location by station/city/state/country names. Falls back to city-level data if the Stations API requires premium access. Returns current AQI
  - body: { city: string, state: string, country: string, station: string }
- `POST https://api.mcp.ai/api/iqair_airvisual/get/world/ranking` — Retrieves air quality ranking data. With premium API access, returns a global ranking of cities by AQI. With standard (free) API access, automatically falls back to returning the nearest city's air qu
  - body: { ip?: string, lat?: number, lon?: number }

## Example prompts
- "What can I do in Iqair Airvisual?"
- "Show me a summary of my Iqair Airvisual account"

## More
- Page: https://mcp.ai/iqair_airvisual
- Agent spec (llms.txt): https://mcp.ai/iqair_airvisual/llms.txt
- Postman collection: https://mcp.ai/iqair_airvisual/postman.json
