get_measurements

Pack: openaq · Endpoint: https://gateway.pipeworx.io/openaq/mcp

Get the most recent 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. Returns the sensor’s LAST limit readings — note that many OpenAQ sensors are archived and stopped reporting years ago, so “most recent” can legitimately be several years old: always read the returned timestamps rather than assuming the data is current. Use find_stations or get_latest to pick a sensor that is still reporting.

Parameters

NameTypeRequiredDescription
sensor_idnumberyesOpenAQ sensor id (a station+parameter pair, from find_stations).
periodstringnoAggregation: “hours” (default) or “days”.
limitnumbernoHow many of the most recent data points to return (1-1000, default 24).
_apiKeystringnoOpenAQ API key (optional; the gateway supplies one).

Example call

Arguments

{
  "sensor_id": 2772,
  "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":{"sensor_id":2772,"limit":20}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('get_measurements', {
  "sensor_id": 2772,
  "limit": 20
});

More examples

{
  "sensor_id": 13866,
  "period": "days",
  "limit": 30
}

Response shape

Always returns: count, measurements

FieldTypeDescription
countnumberNumber of measurements returned
measurementsarrayHistorical 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.

Regenerated from source · build August 8, 2026