United States Department of Agriculture QuickStats Scraper avatar

United States Department of Agriculture QuickStats Scraper

Pricing

from $3.50 / 1,000 results

Go to Apify Store
United States Department of Agriculture QuickStats Scraper

United States Department of Agriculture QuickStats Scraper

Pricing

from $3.50 / 1,000 results

Rating

0.0

(0)

Developer

Fortuitous Pirate

Fortuitous Pirate

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Share

USDA QuickStats Scraper

Scrapes agricultural production statistics from the USDA QuickStats API including crop yields, livestock inventory, and farm economics data. Access comprehensive agricultural data from the National Agricultural Statistics Service (NASS) database covering decades of US agricultural history.

Features

  • Query any agricultural commodity (corn, soybeans, wheat, cattle, etc.)
  • Filter by year, state, and statistic category
  • Access national, state, and county-level data
  • Configurable result limits up to 50,000 records
  • Automatic data parsing and normalization
  • Works with DEMO_KEY (no API key required for basic usage)

Input Parameters

ParameterTypeRequiredDefaultDescription
commoditystringNoCORNAgricultural commodity to search for (e.g., CORN, SOYBEANS, WHEAT, CATTLE, HOGS, CHICKENS)
yearintegerNo-Year for data (1900-2030). Leave empty for all years
statestringNo-US state abbreviation (e.g., IA, IL, NE). Leave empty for national data
statisticCategorystringNo-Type of statistic (e.g., AREA PLANTED, PRODUCTION, YIELD, INVENTORY)
limitintegerNo100Maximum number of records to return (1-50,000)

Output Schema

Each record contains the following fields:

{
"commodity": "CORN",
"statisticCategory": "YIELD",
"unit": "BU / ACRE",
"value": 176.7,
"year": 2023,
"period": "ANNUAL",
"state": "IOWA",
"stateCode": "IA",
"county": null,
"countyCode": "000",
"aggLevel": "STATE",
"domainCategory": "NOT SPECIFIED",
"sourceDesc": "SURVEY",
"cvPercent": "2.1",
"shortDesc": "CORN, GRAIN - YIELD, MEASURED IN BU / ACRE",
"scrapedAt": "2024-01-15T12:00:00.000Z"
}

API Information

  • Source: USDA QuickStats API
  • Documentation: API Guide
  • Authentication: Optional. Uses DEMO_KEY by default, which has lower rate limits
  • Custom API Key: Set the USDA_API_KEY environment variable for higher limits
  • Rate Limits:
    • DEMO_KEY: 30 requests/hour, 50 requests/day
    • Registered Key: 1,000 requests/hour
  • Request Timeout: 120 seconds (the API can be slow for large queries)

Example Usage

Apify Console

Run the actor with default settings to get CORN data:

{
"commodity": "CORN",
"year": 2023,
"state": "IA",
"statisticCategory": "YIELD",
"limit": 100
}

Get soybean production data for Illinois:

{
"commodity": "SOYBEANS",
"year": 2023,
"state": "IL",
"statisticCategory": "PRODUCTION",
"limit": 500
}

Get national cattle inventory:

{
"commodity": "CATTLE",
"statisticCategory": "INVENTORY",
"limit": 1000
}

Apify API (JavaScript)

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({
token: 'YOUR_APIFY_TOKEN',
});
const input = {
commodity: 'WHEAT',
year: 2023,
state: 'KS',
statisticCategory: 'AREA PLANTED',
limit: 200
};
const run = await client.actor('YOUR_USERNAME/usda-quickstats-scraper').call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Apify API (cURL)

curl -X POST "https://api.apify.com/v2/acts/YOUR_USERNAME~usda-quickstats-scraper/runs?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"commodity": "CORN",
"year": 2023,
"limit": 100
}'

Troubleshooting

IssueCauseSolution
No data returnedInvalid commodity or filter combinationCheck commodity spelling (use uppercase). Try removing filters to broaden search
Rate limit exceededToo many requests with DEMO_KEYRegister for a free API key at USDA QuickStats and set USDA_API_KEY environment variable
Request timeoutQuery returns too many resultsAdd more filters (year, state) or reduce limit
Empty value fieldsData not available for that combinationSome statistics are only available for certain years/states
Invalid state codeIncorrect state abbreviationUse standard 2-letter US state codes (e.g., IA, TX, CA)

Common Commodities

  • Crops: CORN, SOYBEANS, WHEAT, COTTON, HAY, RICE, BARLEY, OATS
  • Livestock: CATTLE, HOGS, CHICKENS, TURKEYS, SHEEP
  • Dairy: MILK
  • Specialty: HONEY, MAPLE SYRUP, CHRISTMAS TREES

Common Statistic Categories

  • AREA PLANTED
  • AREA HARVESTED
  • PRODUCTION
  • YIELD
  • INVENTORY
  • SALES
  • PRICE RECEIVED

This actor accesses publicly available data from the USDA National Agricultural Statistics Service (NASS) QuickStats database. Data is provided by the United States Department of Agriculture and is in the public domain.

  • Data Source: USDA NASS QuickStats
  • Terms of Use: USDA Data Policies
  • API Terms: Users should comply with USDA API usage guidelines and rate limits

When using this data, please cite: "Source: USDA National Agricultural Statistics Service"