---
name: usda-nass-quick-stats-ingestion
description: "How to get USDA NASS Quick Stats API and bulk files data into a pandas DataFrame and Parquet: access, the request, the format, limits, quirks and terms."
---

# Load USDA NASS Quick Stats into pandas and Parquet

Source entry: https://signal-lab-jet.vercel.app/datasets/usda-nass-quick-stats
Provider: https://www.nass.usda.gov/developer/
Checked against the provider's documentation: 2026-11-01

## Access
- Request a free Quick Stats API key with a valid email address and accept the NASS API terms.
- Set the key in NASS_API_KEY; do not put it in source code.
- Large compressed subject and Census files are downloadable without an API key.

## Request
```bash
curl -G 'https://quickstats.nass.usda.gov/api/api_GET/' -H 'Accept: application/json' --data-urlencode "key=$NASS_API_KEY" --data-urlencode 'commodity_desc=CORN' --data-urlencode 'year__GE=2025' --data-urlencode 'state_alpha=VA' --data-urlencode 'format=JSON'
```

## Format
JSON object with a data array; CSV and XML are also supported. Rows include source, sector, commodity, statistic, unit, value, geography, year, frequency, reference period and load time.

## Load into pandas and Parquet
Needs Python 3 with requests, pandas and pyarrow.
```python
"""USDA NASS Quick Stats corn estimates -> pandas -> Parquet."""
import os
import requests
import pandas as pd

URL = "https://quickstats.nass.usda.gov/api/api_GET/"
params = {
    "key": os.environ["NASS_API_KEY"],
    "commodity_desc": "CORN",
    "year__GE": "2025",
    "state_alpha": "VA",
    "format": "JSON",
}
r = requests.get(URL, params=params, timeout=60)
r.raise_for_status()
df = pd.DataFrame(r.json()["data"])
df["load_time"] = pd.to_datetime(df["load_time"], errors="coerce")
df.to_parquet("usda_nass_quick_stats.parquet", index=False)
print(len(df), "Quick Stats rows", df["year"].min(), "to", df["year"].max())
```
Not run: it needs a free API key.

## Limits
- Rate limit: Not stated.
- Each API request returns at most 50,000 records.
- Use get_counts before a pull; split oversized calls or use the compressed bulk files.

## Quirks
- Value is formatted text and can contain commas or suppression markers; clean it deliberately rather than coercing the full column blindly.
- The same column set is used in API output and the tab-delimited bulk products.
- Chemical-use records encode the type of chemical in domain fields; keep domain_desc and domaincat_desc.

## Terms and attribution
- Use of the API constitutes acceptance of the NASS API terms.
- Applications using the API should display the required non-endorsement notice.
- Do not modify or falsely represent API content and continue to claim NASS as its source.
- Terms page: https://quickstats.nass.usda.gov/api

## Sources
- https://quickstats.nass.usda.gov/api: "Your request will return a maximum of 50,000 data records."
- https://quickstats.nass.usda.gov/api: "The api_GET resource supports three different output formats: JSON(default), XML or CSV."
- https://quickstats.nass.usda.gov/api: "You may use the NASS API to develop a service to search, display, analyze, retrieve, view and otherwise 'get' information from NASS data"
- https://www.nass.usda.gov/datasets/: "Download agricultural statistics large datasets using .gz files."

## Help improve this skill
Missing a source, or see something to improve? Call the MCP tool suggest_source or feedback (or POST /api/suggest or /api/feedback). Reviewed ideas: https://signal-lab-jet.vercel.app/agent-suggestions

Information for educational purposes only. Free tiers, limits and licenses belong to the providers and may change; check the provider's own terms before using the data.
