GnistAI GnistAI
Log in

OpenAQ (Air Quality)

Real-time and forecast air quality data including AQI, PM2.5, and pollutant levels.

Overview   |   MCP   |   REST API   |   OpenAPI   |   CLI   |   Tutorial   |   Toolkits   |   Home
status: healthy status status healthy healthy tools: 4 tools tools 4 4 type: api wrapper type type api wrapper api wrapper lifecycle: maintained lifecycle lifecycle maintained maintained Environment

Data source: OpenAQ

MCP Endpoint (Streamable HTTP) https://context.gnist.ai/mcp/openaq/
Authentication

All requests require a Gnist-API-Key header (or api_key query parameter).

Free tier: 100 calls/day. Get your API key.

Tools (4)

get_air_quality

Get current air quality at the nearest monitoring station.

Returns readings for PM2.5, PM10, O3, NO2, and other available pollutants,
along with a derived US EPA AQI score and category.

Args:
lat: Latitude of the location (-90 to 90).
lon: Longitude of the location (-180 to 180).

Returns:
Station details, per-pollutant measurements, AQI, and dominant pollutant.
AQI is derived from PM2.5 using the US EPA formula. Returns null if the
nearest station does not report PM2.5.

ParameterTypeRequiredDescription
latnumberrequiredLatitude of the location (-90 to 90).
lonnumberrequiredLongitude of the location (-180 to 180).
JSON-RPC Request
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "get_air_quality",
    "arguments": {
      "lat": 1.0,
      "lon": 1.0
    }
  }
}
get_aqi_summary

Get city-level AQI summary with dominant pollutant.

Finds the most recently updated monitoring station matching the city name
and returns its current readings. Useful when you know the city but not
the exact coordinates.

Args:
city: City name (e.g. "Oslo", "London", "New York").

Returns:
Station name, AQI score, category, and per-pollutant measurements.

ParameterTypeRequiredDescription
citystringrequiredCity name (e.g. "Oslo", "London", "New York").
JSON-RPC Request
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "get_aqi_summary",
    "arguments": {
      "city": "example"
    }
  }
}
get_air_quality_history

Get PM2.5 readings from the nearest station over the last N hours.

Useful for trend analysis — is air quality improving or worsening?

Args:
lat: Latitude of the location (-90 to 90).
lon: Longitude of the location (-180 to 180).
hours: Number of hours of history to retrieve (1–72, default 24).

Returns:
Station name, parameter, unit, and a time-series of PM2.5 readings.
Returns an empty entries list if the nearest station has no PM2.5 sensor.

ParameterTypeRequiredDescription
latnumberrequiredLatitude of the location (-90 to 90).
lonnumberrequiredLongitude of the location (-180 to 180).
hoursintegeroptionalNumber of hours of history to retrieve (1–72, default 24). (default: 24)
JSON-RPC Request
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "get_air_quality_history",
    "arguments": {
      "lat": 1.0,
      "lon": 1.0
    }
  }
}
report_feedback

Report a bug, feature request, or general feedback for this data source.

Use this when something doesn't work as expected, when you'd like
a new feature, or when you have suggestions for improvement.

Args:
feedback: Describe the issue or suggestion.
feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: "general")
JSON-RPC Request
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "report_feedback",
    "arguments": {
      "feedback": "example"
    }
  }
}

Quick Start

Shell
curl -X POST "https://context.gnist.ai/mcp/openaq/" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_air_quality", "arguments": {"lat": 1.0, "lon": 1.0}}}'
Python
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/openaq/",
    headers={"Gnist-API-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
    json={
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "get_air_quality",
    "arguments": {
      "lat": 1.0,
      "lon": 1.0
    }
  }
},
)
print(resp.json())

Related Toolkits (Environment)

Resources