nass_query

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

Search USDA agricultural statistics by commodity, statistic, geography, and year. Returns production, yield, acreage, prices, and livestock data (e.g., commodity=“CORN”, state_fips=“06” for California).

Parameters

NameTypeRequiredDescription
_apiKeystringyesNASS API key (free from quickstats.nass.usda.gov/api)
commoditystringyesCommodity name, e.g., “CORN”, “SOYBEANS”, “WHEAT”, “CATTLE”, “MILK”, “COTTON”
stat_categorystringnoStatistic category, e.g., “YIELD”, “PRODUCTION”, “AREA PLANTED”, “AREA HARVESTED”, “PRICE RECEIVED”, “INVENTORY”
statestringnoState name, e.g., “IOWA”, “ILLINOIS”, “CALIFORNIA” (optional)
yearstringnoYear or range, e.g., “2024” or “2020:2025” (optional)
agg_levelstringnoAggregation level: “NATIONAL”, “STATE”, or “COUNTY” (optional)
freqstringnoFrequency: “ANNUAL”, “MONTHLY”, or “WEEKLY” (optional)
sourcestringnoData source: “SURVEY” or “CENSUS” (optional, defaults to all)
sectorstringnoSector: “CROPS”, “ANIMALS & PRODUCTS”, “ECONOMICS”, “DEMOGRAPHICS”, “ENVIRONMENTAL” (optional)
groupstringnoCommodity group, e.g., “FIELD CROPS”, “FRUIT & TREE NUTS”, “VEGETABLES” (optional)

Example call

Arguments

{
  "_apiKey": "your-nass-api-key",
  "commodity": "CORN",
  "stat_category": "YIELD",
  "state": "IOWA",
  "year": "2024"
}

curl

curl -X POST https://gateway.pipeworx.io/nass/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"nass_query","arguments":{"_apiKey":"your-nass-api-key","commodity":"CORN","stat_category":"YIELD","state":"IOWA","year":"2024"}}}'

TypeScript (@pipeworx/sdk)

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

const result = await pipeworx.call('nass_query', {
  "_apiKey": "your-nass-api-key",
  "commodity": "CORN",
  "stat_category": "YIELD",
  "state": "IOWA",
  "year": "2024"
});

More examples

{
  "_apiKey": "your-nass-api-key",
  "commodity": "SOYBEANS",
  "stat_category": "PRODUCTION",
  "year": "2020:2025",
  "agg_level": "NATIONAL"
}

Response shape

Always returns: count, data, truncated

FieldTypeDescription
countintegerNumber of records returned
dataarrayArray of up to 200 agricultural records
truncatedbooleanTrue if results exceed 200 records and were truncated
Full JSON Schema
{
  "type": "object",
  "properties": {
    "count": {
      "type": "integer",
      "description": "Number of records returned"
    },
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "commodity": {
            "type": [
              "string",
              "null"
            ],
            "description": "Commodity name (e.g., CORN, SOYBEANS)"
          },
          "stat_category": {
            "type": [
              "string",
              "null"
            ],
            "description": "Statistical category (e.g., YIELD, PRODUCTION)"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "description": "State name"
          },
          "county": {
            "type": [
              "string",
              "null"
            ],
            "description": "County name"
          },
          "agg_level": {
            "type": [
              "string",
              "null"
            ],
            "description": "Aggregation level (NATIONAL, STATE, COUNTY)"
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Year of the record"
          },
          "frequency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Frequency (ANNUAL, MONTHLY, WEEKLY)"
          },
          "period": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reference period description"
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "Numeric or categorical value"
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "description": "Unit of measurement"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Short description of the statistic"
          }
        }
      },
      "description": "Array of up to 200 agricultural records"
    },
    "truncated": {
      "type": "boolean",
      "description": "True if results exceed 200 records and were truncated"
    }
  },
  "required": [
    "count",
    "data",
    "truncated"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "nass": {
      "url": "https://gateway.pipeworx.io/nass/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build May 9, 2026