USDA AMS MARS Commodity Spot Price Scraper avatar

USDA AMS MARS Commodity Spot Price Scraper

Pricing

from $2.10 / 1,000 price records

Go to Apify Store
USDA AMS MARS Commodity Spot Price Scraper

USDA AMS MARS Commodity Spot Price Scraper

Scrapes official USDA AMS MyMarketNews (MARS) spot prices, auction reports, and volumes for livestock, grain, cotton, and produce via the MARS REST API.

Pricing

from $2.10 / 1,000 price records

Rating

0.0

(0)

Developer

Groundplane Labs

Groundplane Labs

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

21 days ago

Last modified

Categories

Features

Limited permissions

Share

Scrapes official spot prices, auction summaries, volume figures, and commodity specifications from the USDA Agricultural Marketing Service (AMS) MyMarketNews (MARS) REST API (v1.2) across livestock, grain, cotton, and produce markets.


What It Does

The USDA AMS MARS Commodity Spot Price Scraper connects directly to the official USDA Agricultural Marketing Service MyMarketNews portal. It retrieves structured spot market reports, feeder cattle summaries, grain bids, terminal produce prices, and auction results without browser automation or HTML parsing.

Key capabilities:

  • Comprehensive Coverage: Queries multiple USDA report slugs in a single run. The default set is Oklahoma National Stockyards Feeder Cattle, Oklahoma City, OK (1280), Daily Spot Cotton Quotations, provided by Memphis, TN (3804), and Lake Cumberland Livestock, Somerset, KY (2194). The default set contains no grain report; add a grain report slug ID to reportSlugIds if you need one.
  • Full Report Details: Recursively extracts all report sections and tables (allSections=true) into clean tabular rows.
  • Commodity & Date Filtering: Filter by commodity name (e.g. Cattle, Corn, Soybeans) and restrict historical ranges with reportBeginDateRange.
  • Corrections Tracking: Supports retrieving official USDA published corrections notices via correctionsOnly.
  • Data Integrity Sentinels: Enforces exact casing on whitelisted API parameters, performs startup key validation, validates report slug existence, and audits per-row schemas before emission.
  • Streamed Processing: Report responses are parsed incrementally as they download and flattened section by section, so a multi-section response (up to 100,000 records) is never loaded into memory in full.

Target Audience

  • Agricultural Economists & Commodity Traders: Track live physical cash market spot prices and national basis trends.
  • Agribusiness & Feedlot Operators: Benchmark livestock purchases, feeder cattle weight brackets, and grain procurement costs.
  • Food Processors & Supply Chain Analysts: Monitor historical agricultural commodity pricing and seasonal price swings.
  • Academic & Public Policy Researchers: Ingest verified, official USDA price reports into quantitative models.

Source & Data Cadence

  • Source: Official USDA Agricultural Marketing Service MyMarketNews (MARS) REST JSON API, version 1.2 (https://marsapi.ams.usda.gov/services/v1.2).
  • Cadence: Updated continuously throughout trading days as auction markets report. Individual market reports publish daily, weekly, or semi-weekly depending on the commodity.
  • API Authentication: Requires a personal MyMarketNews API key (free of charge). See the API Key Setup section below.

API Key Setup

USDA AMS requires a registered API key to access the MyMarketNews REST endpoints:

  1. Visit https://mymarketnews.ams.usda.gov and register for a free account.
  2. Generate your personal API key in your account profile.
  3. Provide your key in the usdaMarsApiKey input field when configuring this actor.
  4. Security Notice: The key is marked as a secret field (isSecret: true). It is transmitted securely directly to the USDA endpoints via HTTP Basic authentication and is never stored, pooled, or logged.

Input Parameters

FieldTypeDefaultDescription
usdaMarsApiKeyString (Secret)RequiredYour free USDA MyMarketNews API key.
reportSlugIdsArray of Strings["1280", "3804", "2194"]List of USDA report slug IDs to retrieve.
commodityFilterString""Optional case-insensitive keyword filter (e.g. "Cattle", "Corn").
reportBeginDateRangeString""Optional date range formatted as MM/DD/YYYY:MM/DD/YYYY (e.g. 01/01/2026:01/31/2026).
lastReportsCountInteger1Number of most recent report releases to fetch per slug (1 to 20).
includeAllSectionsBooleantrueWhen true, retrieves all report subsections/tables.
correctionsOnlyBooleanfalseWhen true, retrieves only published correction records.
maxItemsInteger1000Maximum number of price records to emit across all reports.

Labeled Canary Input

To verify actor functionality and API connectivity, use the following canary input (slug 1280, Oklahoma National Stockyards Feeder Cattle, Oklahoma City, OK):

{
"usdaMarsApiKey": "YOUR_MYMARKETNEWS_API_KEY",
"reportSlugIds": ["1280"],
"commodityFilter": "",
"lastReportsCount": 1,
"includeAllSections": true,
"correctionsOnly": false,
"maxItems": 50
}

Output Dataset Schema

Each emitted row represents a price, weight, or volume observation from a USDA market report:

FieldTypeDescription
slugIdStringUSDA AMS unique report slug identifier (e.g. "1280").
reportTitleStringOfficial publication title of the market report.
publishedDateStringPublication date in YYYY-MM-DD format.
marketTypeString or NullUSDA market category (e.g. "Livestock", "Grain", "Produce").
officeNameString or NullUSDA reporting office or city that compiled the report.
reportSectionStringReport section or table header name (e.g. "Feeder Steers").
commodityString or NullCommodity name (e.g. "Feeder Cattle").
classOrGradeString or NullClass, grade, or quality specification (e.g. "Medium and Large 1").
frameSizeString or NullLivestock frame size (e.g. "Large", "Medium"). Null for grain/produce.
weightRangeLbsString or NullWeight range bracket in pounds (e.g. "500-600").
headCountInteger or NullNumber of head or transaction units reported.
avgWeightLbsNumber or NullAverage weight in pounds.
priceLowUsdNumber or NullLowest reported price in USD per unit/cwt.
priceHighUsdNumber or NullHighest reported price in USD per unit/cwt.
weightedAvgPriceUsdNumber or NullWeighted average price in USD per unit/cwt.
isCorrectionBooleanTrue if this record represents a published correction notice.

Note on Nulls: Fields such as frameSize, headCount, and weightRangeLbs are specific to livestock auctions and will be null on grain or produce reports by disclosure.


Troubleshooting & Status Messages

  • Invalid or Missing API Key: If usdaMarsApiKey is missing or rejected with HTTP 401/403, the actor fails immediately with clear setup instructions. No data is fetched.
  • Unknown Slug IDs: If a requested slug ID does not exist in the USDA Table of Contents, the actor flags the invalid ID in the status message and continues with any remaining valid slugs.
  • Zero Matches: If the query returns 0 rows due to an overly restrictive commodityFilter or reportBeginDateRange, the actor exits cleanly with Complete: 0 rows pushed.
  • Truncation: When the total matching records exceed maxItems, the run concludes with PARTIAL: ... (stopped at maxItems limit).

If this keeps happening, please open an issue on this actor's Issues tab and we'll fix it fast.


Changelog

  • v0.1.2 (2026-11-02): Red Team fix round: corrected the three default slug identities in this README and the input schema (1280 is Oklahoma National Stockyards Feeder Cattle, Oklahoma City, OK; 3804 is Daily Spot Cotton Quotations, Memphis, TN; 2194 is Lake Cumberland Livestock, Somerset, KY; the default set contains no grain report). commodityFilter now matches the commodity field only. Commodity was added to the core-column sentinel, which now runs on the first row of every section. Unparseable non-empty price, head-count, weight, and date values (including impossible calendar dates) are now counted as value-format drift, skipped, and disclosed in the status instead of shipping as nulls under Complete. Missing report titles or sections count rows as skipped instead of substituting invented values. Report responses are now streamed and parsed incrementally section by section instead of being loaded in full. If the report listing cannot be fetched or parsed, the status now states that slug validation was skipped. Status counts now report the number of reports actually processed in truncated runs.
  • v0.1.1 (2026-11-01): Review fixes: Retry-After HTTP-date crash fixed, all API calls (key validation, report listing, report fetch) now use the 6-try retry standard and carry authentication, rows are flattened and pushed section by section with totals reconciliation, skipped rows are disclosed as a PARTIAL reason, string and zero field values are parsed correctly, and the input schema now marks usdaMarsApiKey required with no default.
  • v0.1.0 (2026-11-01):
    • Initial release targeting USDA AMS MARS API v1.2.
    • Multi-report slug ingestion with full section extraction.
    • Buyer-supplied secret key model with startup authentication verification.
    • Schema drift and parameter casing sentinels.