Iqair Airvisual connects to a Nagent workspace with an API key. Once it is connected, agents can call 10 Iqair Airvisual actions, such as "Get Air Quality Forecast Data", "Get Cities" and "Get City Air Quality". Nothing is enabled on connect: each action is allowed one at a time, and an action with side effects runs or waits for a person according to the agent's level.
Every operation an agent can call against Iqair Airvisual, with input parameters and output schema.
IQAIR_AIRVISUAL_GET_AIR_QUALITY_FORECAST_DATATool to retrieve air quality forecast data for a specified city, state, and country. Use after confirming location details.
Input parameters
City name (e.g., 'Los Angeles').
State or region name (e.g., 'California').
Country name (e.g., 'USA').
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
IQAIR_AIRVISUAL_GET_CITIESTool to list supported cities in a specified state and country. Use when you need to retrieve cities for a given state/country.
Input parameters
State name as returned by the 'Get States' action. Use exact state names like 'California', 'Texas', 'New York'.
Country name as returned by the 'Get Countries' action. Use exact country names like 'USA', 'India', 'Germany', 'Canada'. Note: 'USA' is used instead of 'United States'.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
IQAIR_AIRVISUAL_GET_CITY_AIR_QUALITYTool to retrieve air quality data for a specific city. Use when you need current pollution and weather data by specifying city, state, and country.
Input parameters
Name of the city to retrieve air quality for. Must match IQAir's supported city names exactly (e.g., 'Los Angeles', 'New York City', 'Paris').
Name of the state, province, or region containing the city. Use full name, not abbreviations (e.g., 'California' not 'CA', 'Ile-de-France' for Paris).
Name of the country containing the city. Use full country name (e.g., 'USA', 'France', 'Australia').
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
IQAIR_AIRVISUAL_GET_COUNTRIESTool to list all supported countries. Use when you need to know which countries are supported by the AirVisual API.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
IQAIR_AIRVISUAL_GET_HISTORICAL_AQI_DATATool to retrieve historical air quality data for a city. Use after confirming city, state, and country when you need AQI readings over time.
Input parameters
End datetime in ISO8601 format (inclusive).
City name
Start datetime in ISO8601 format (inclusive).
State or province name
Country name
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
IQAIR_AIRVISUAL_GET_NEAREST_CITY_AIR_QUALITYTool 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.
Input parameters
IPv4 address to geolocate; if neither lat/lon nor ip provided, server uses caller's IP.
Latitude in decimal degrees; must be between -90 and 90. Must be provided with lon.
Longitude in decimal degrees; must be between -180 and 180. Must be provided with lat.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
IQAIR_AIRVISUAL_GET_NEAREST_STATION_AIR_QUALITYTool to get nearest station air quality. Use when you have GPS coordinates and need closest station’s AQI.
Input parameters
Latitude in decimal degrees, must be between -90 and 90
Longitude in decimal degrees, must be between -180 and 180
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
IQAIR_AIRVISUAL_GET_STATESTool to list supported states in a specified country. Use when you need to retrieve states/provinces for a given country.
Input parameters
Country name as returned by the 'Get Countries' action. Use exact country names like 'USA', 'India', 'Germany', 'Canada'. Note: 'USA' is used instead of 'United States'.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
IQAIR_AIRVISUAL_GET_STATION_BY_IDFetches 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 (US and China scales), weather conditions, and geographic location. Use Get Countries, Get States, and Get Cities actions to find valid location names.
Input parameters
City's English name. Must match IQAir's supported city names exactly (use Get Cities action to find valid names).
State or region's English name. Must match IQAir's supported state names exactly (use Get States action to find valid names).
Country's English name. Must match IQAir's supported country names exactly (use Get Countries action to find valid names).
Station's English name. Note: Station name is used as an identifier but is passed through to fallback city data. The actual station-specific endpoint requires premium API access.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
IQAIR_AIRVISUAL_GET_WORLD_RANKINGRetrieves 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 quality as a single-item ranking list. Use lat/lon coordinates or an IP address to specify location for the fallback behavior. Returns city name, location, and current AQI values (US EPA and Chinese MEP standards).
Input parameters
IPv4 address for geolocation (e.g., '8.8.8.8'). Used to determine location when lat/lon are not provided. Optional - if omitted, uses caller's IP.
Latitude in decimal degrees (-90 to 90). When provided with 'lon', returns air quality for the nearest city to these coordinates. Optional - if omitted, uses server's IP geolocation.
Longitude in decimal degrees (-180 to 180). Must be provided together with 'lat'. Optional - if omitted, uses server's IP geolocation.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
Agents can call 10 Iqair Airvisual actions on Nagent, including "Get Air Quality Forecast Data", "Get Cities" and "Get City Air Quality". Get Air Quality Forecast Data: Retrieve air quality forecast data for a specified city, state, and country. Each action is listed on this page with its input parameters and its output.
Iqair Airvisual connects with an API key, under your workspace's own connection. Nothing is enabled on connect: each action is allowed one at a time and can be scoped to the agents that need it.
Get Air Quality Forecast Data takes 3 required inputs: city, state and country. It returns data, error and successful.