get_measurements
Pack: openaq · Endpoint: https://gateway.pipeworx.io/openaq/mcp
Get a historical time series (hourly or daily aggregates) for a single OpenAQ sensor (sensor id from find_stations), newest first. Use for pollutant trends over time at one station/parameter.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
sensor_id | number | yes | OpenAQ sensor id (a station+parameter pair, from find_stations). |
period | string | no | Aggregation: “hours” (default) or “days”. |
limit | number | no | Number of data points (1-1000, default 24). |
_apiKey | string | no | OpenAQ API key (optional; the gateway supplies one). |
Example call
Arguments
{
"location_id": 2178,
"parameter": "pm25",
"limit": 20
}
curl
curl -X POST https://gateway.pipeworx.io/openaq/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_measurements","arguments":{"location_id":2178,"parameter":"pm25","limit":20}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('get_measurements', {
"location_id": 2178,
"parameter": "pm25",
"limit": 20
});
More examples
{
"location_id": 5847,
"limit": 50
}
Response shape
Always returns: count, measurements
| Field | Type | Description |
|---|---|---|
count | number | Number of measurements returned |
measurements | array | Historical air quality measurements |
Full JSON Schema
{
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of measurements returned"
},
"measurements": {
"type": "array",
"description": "Historical air quality measurements",
"items": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"description": "Pollutant parameter name"
},
"value": {
"type": "number",
"description": "Measured value"
},
"unit": {
"type": "string",
"description": "Unit of measurement"
},
"date_utc": {
"type": "string",
"description": "ISO timestamp in UTC"
},
"date_local": {
"type": "string",
"description": "ISO timestamp in local timezone"
},
"location": {
"type": "string",
"description": "Station location name"
},
"coordinates": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"description": "Latitude coordinate"
},
"longitude": {
"type": "number",
"description": "Longitude coordinate"
}
},
"required": [
"latitude",
"longitude"
]
}
},
"required": [
"parameter",
"value",
"unit",
"date_utc",
"date_local",
"location",
"coordinates"
]
}
}
},
"required": [
"count",
"measurements"
]
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"openaq": {
"url": "https://gateway.pipeworx.io/openaq/mcp"
}
}
}
See Getting Started for client-specific install steps.