Microproduct data guideintermediate

USDA NASS Quick Stats

Official U.S. agricultural survey and census estimates for building commodity and county production monitors.

At a glance

Difficulty
Intermediate — some data preparation helps
Size
Medium · ≤1 GB
Formats
JSON, CSV, XML
Access
API or Download
API key
Required
Provider
USDA National Agricultural Statistics Service
Updates
Occasional

From source to product signal

Test a product idea in four steps

Quick Stats exposes published NASS survey and census estimates. Start with one commodity, one state, one statistic, and one year so the request stays under the 50,000-row cap. Display the required NASS disclaimer, and do not treat a single-year extract as a complete national inventory.

1

Check the setup

  • Python 3.10 or newer
  • A notebook environment such as Jupyter or Google Colab
  • A free NASS API key saved in the NASS_API_KEY environment variable
2

Access the data

  1. 1.Register for a NASS API key and save it in the NASS_API_KEY environment variable.
  2. 2.Use get_counts to confirm a commodity-state-year query is under 50,000 rows.
  3. 3.Request JSON for that bounded query and record the short_desc and unit.
Open official source
3

Run the Python example

Install the packages, then run the notebook cell.

python -m pip install pandas requests

import os
import pandas as pd
import requests

params = {
    "key": os.environ["NASS_API_KEY"],
    "commodity_desc": "CORN",
    "statisticcat_desc": "YIELD",
    "agg_level_desc": "STATE",
    "state_alpha": "IA",
    "year": 2024,
    "format": "JSON",
}
response = requests.get(
    "https://quickstats.nass.usda.gov/api/api_GET/",
    params=params,
    timeout=30,
)
response.raise_for_status()
estimates = pd.DataFrame(response.json()["data"])
estimates["retrieved_at_utc"] = pd.Timestamp.now(tz="UTC")
print(estimates[["short_desc", "state_alpha", "year", "Value", "unit_desc"]].head(20))
4

Test a useful signal

Look up one state's corn yield

Retrieve published Iowa corn-yield estimates for one year and record their units.

  1. 01Confirm the API returned yield rows for the selected commodity, state, and year.
  2. 02Note the unit_desc and whether the Value is a number or a suppression code.
  3. 03Display that the product uses the NASS API but is not endorsed or certified by NASS, and do not treat one state-year extract as a national production total.

Dataset details

USDA National Agricultural Statistics Service is a government source. Last verified 2026-08-14. Temporal coverage: Census of Agriculture years plus ongoing surveys.

Theme

Demographics & Development

Domains

AgricultureCommodities

Data types

TabularTime SeriesSurvey Estimates

Tasks

Trend AnalysisRegional ComparisonMarket Monitoring

Geography

United States

Formats

JSONCSVXML

Provider

USDA National Agricultural Statistics Service

Data terms

NASS API terms of service