get_measurements

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

Get historical air quality data for a specific station. Filter by pollutant (e.g., “pm25”, “o3”, “no2”). Returns timestamped readings and values over time.

Parameters

NameTypeRequiredDescription
location_idnumberyesNumeric location ID from get_locations (e.g. 2178).
limitnumbernoMaximum number of measurement records to return (default 20, max 100).
parameterstringnoPollutant parameter to filter by. One of: pm25, pm10, o3, no2, so2, co.

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

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 May 9, 2026