# USDA Crop Prices & Agricultural Data Scraper (`martc03/usda-crop-prices`) Actor

Extracts crop prices and agricultural statistics from the USDA NASS QuickStats API. Search by commodity, state, year, and statistical category.

- **URL**: https://apify.com/martc03/usda-crop-prices.md
- **Developed by:** [CoDee](https://apify.com/martc03) (community)
- **Categories:** Other, Automation
- **Stats:** 6 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## :ear\_of\_rice: USDA Crop Prices & Agricultural Statistics

Fetch **US agricultural commodity data** from the [USDA NASS Quick Stats API](https://quickstats.nass.usda.gov/) — the most comprehensive source for American farm statistics. Access crop prices, production volumes, yields, and area planted for **corn, soybeans, wheat, cotton, cattle, hogs**, and hundreds more commodities.

### What data does it extract?

For each data point, the Actor extracts:

| Field | Description |
|-------|-------------|
| **Commodity** | Commodity name (CORN, SOYBEANS, WHEAT, CATTLE, etc.) |
| **Statistic Category** | Type of statistic (PRICE RECEIVED, PRODUCTION, YIELD, AREA PLANTED, etc.) |
| **Short Description** | Full statistic description |
| **State** | US state code (or US TOTAL for national data) |
| **Year** | Data year |
| **Period** | Reporting period (YEAR, MARKETING YEAR, monthly, weekly) |
| **Value** | The data value |
| **Unit** | Unit of measure ($ / BU, BU, BU / ACRE, ACRES, etc.) |
| **County** | County name (when available) |

### Output example

```json
{
  "commodity": "CORN",
  "statisticCategory": "PRICE RECEIVED",
  "shortDescription": "CORN - PRICE RECEIVED, MEASURED IN $ / BU",
  "state": "IA",
  "year": 2025,
  "period": "MARKETING YEAR",
  "value": "4.25",
  "unit": "$ / BU",
  "countyName": "",
  "weekEnding": "",
  "domainCategory": "NOT SPECIFIED",
  "scrapedAt": "2026-02-25T12:00:00.000Z",
  "sourceUrl": "https://quickstats.nass.usda.gov/api/api_GET/"
}
```

### Input options

| Parameter | Type | Description |
|-----------|------|-------------|
| `commodities` | string\[] | Commodities to fetch (e.g., `["CORN", "SOYBEANS", "WHEAT"]`). Default: CORN, SOYBEANS, WHEAT. |
| `states` | string\[] | Filter by US state codes (e.g., `["IA", "IL", "IN"]`). Leave empty for US totals. |
| `years` | number\[] | Years to fetch. Default: `[2024, 2025]`. |
| `statisticCategories` | string\[] | Statistic types (e.g., `["PRICE RECEIVED", "PRODUCTION", "YIELD"]`). Default: PRICE RECEIVED. |
| `apiKey` | string | USDA NASS API key. Default uses DEMO\_KEY (rate-limited). Get a free key at https://quickstats.nass.usda.gov/api |
| `maxRecords` | integer | Maximum records to fetch. Default: 5,000. |

### Common commodities

Corn, Soybeans, Wheat, Cotton, Rice, Sorghum, Barley, Oats, Hay, Cattle, Hogs, Chickens, Milk, Eggs, and hundreds more.

### Statistic categories

| Category | Description |
|----------|-------------|
| **PRICE RECEIVED** | Price farmers receive per unit |
| **PRODUCTION** | Total production volume |
| **YIELD** | Production per acre |
| **AREA PLANTED** | Acres planted |
| **AREA HARVESTED** | Acres harvested |
| **INVENTORY** | Stocks and inventory levels |

### Use cases

- **Commodity traders** — Track crop prices and production data for trading decisions
- **Agricultural lenders** — Assess farm income potential using price and yield data by region
- **Food companies** — Monitor input costs for corn, wheat, soybeans, and other raw materials
- **Policy researchers** — Analyze agricultural trends, subsidies, and farm economics
- **Supply chain managers** — Forecast commodity availability and price trends
- **Data journalists** — Report on farm economics, trade impacts, and crop production patterns
- **Academic researchers** — Study agricultural productivity, climate impacts, and food security

### Data freshness

USDA NASS updates data on published schedules (monthly and annual reports). Schedule this Actor to run monthly to track new price and production data.

### Cost

This Actor uses the USDA NASS public API. Typical cost: **less than $0.01 per run**.

# Actor input Schema

## `apiKey` (type: `string`):

Your USDA NASS Quick Stats API key. Get one free at https://quickstats.nass.usda.gov/api/. If not provided, DEMO\_KEY will be used (rate-limited).

## `commodities` (type: `array`):

Filter by commodity (e.g., \["CORN", "SOYBEANS", "WHEAT", "COTTON", "CATTLE", "HOGS"]). Leave empty for all commodities.

## `states` (type: `array`):

Filter by US state codes (e.g., \["IA", "IL", "IN"]). Leave empty for all states (US TOTAL).

## `years` (type: `array`):

Filter by specific years (e.g., \[2023, 2024, 2025]). Leave empty for the most recent year.

## `statisticCategories` (type: `array`):

Filter by statistic category (e.g., \["PRICE RECEIVED", "PRODUCTION", "YIELD", "AREA PLANTED"]). Leave empty for PRICE RECEIVED only.

## `maxRecords` (type: `integer`):

Maximum number of records to fetch. The NASS API returns up to 50,000 per request. Default: 5000.

## Actor input object example

```json
{
  "commodities": [
    "CORN",
    "SOYBEANS",
    "WHEAT"
  ],
  "years": [
    2024,
    2025
  ],
  "statisticCategories": [
    "PRICE RECEIVED"
  ],
  "maxRecords": 5000
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("martc03/usda-crop-prices").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("martc03/usda-crop-prices").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call martc03/usda-crop-prices --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,martc03/usda-crop-prices"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/FKyVvRml9uXnclx2m/builds/EYoYdCfDRmDmewot8/openapi.json
