Data source: OpenAQ
https://context.gnist.ai/rest/openaq/
AuthenticationAll 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_qualityGet 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
lat | number | required | Latitude of the location (-90 to 90). |
lon | number | required | Longitude of the location (-180 to 180). |
{
"lat": 1.0,
"lon": 1.0
}get_aqi_summaryGet 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
city | string | required | City name (e.g. "Oslo", "London", "New York"). |
{
"city": "example"
}get_air_quality_historyGet 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
lat | number | required | Latitude of the location (-90 to 90). |
lon | number | required | Longitude of the location (-180 to 180). |
hours | integer | optional | Number of hours of history to retrieve (1–72, default 24). (default: 24) |
{
"lat": 1.0,
"lon": 1.0
}report_feedbackReport 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'.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: "general") |
{
"feedback": "example"
}Quick Start
curl -X POST "https://context.gnist.ai/rest/openaq/get_air_quality" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"lat": 1.0, "lon": 1.0}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/rest/openaq/get_air_quality",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={
"lat": 1.0,
"lon": 1.0
},
)
print(resp.json())