# USDA Livestock Market Price Comparison (`kevinserver24/usda-livestock-price-comparison`) Actor

Ranks USDA AMS livestock-auction markets (sale barns) against each other for one commodity/class/weight-break/price-unit combination, using each market's own recent reports, so order buyers can see who is paying more this week. Charged per ranked market row delivered.

- **URL**: https://apify.com/kevinserver24/usda-livestock-price-comparison.md
- **Developed by:** [Kevin](https://apify.com/kevinserver24) (community)
- **Categories:** Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$32.00 / 1,000 market ranking row delivereds

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

## USDA Livestock Market Price Comparison — which sale barn pays more, this week

*An independent tool. It is not affiliated with, endorsed by, or operated by
USDA or the Agricultural Marketing Service. USDA Market News reports are US
government works (17 U.S.C. §105) and AMS's own privacy statement describes
information on its site as "considered public information and may be
distributed or copied." This Actor reads AMS's MARS API and reports what it
returns, reshaped into a cross-market comparison.*

**No scraper.** This Actor never touches a USDA web page's HTML. Its data
comes from AMS's MARS API (`marsapi.ams.usda.gov`), refreshed on a schedule
and bundled into this Actor at build time.

***

### Why this exists

No single AMS report tells you whether the sale barn down the road is paying
more for 600-650 lb feeder steers than the one three counties over. Each
livestock-auction report only covers its own market, on its own reporting
schedule — one stockyard may report several times a week, another only a
few dozen times a year. Answering "who pays more, right now, for this class
of cattle" means pulling several markets' full histories and reconciling
them onto one comparison, on each market's own recent cadence rather than a
shared calendar.

v1 covers **6 livestock-auction markets** — Unionville Livestock Market
(MO), Oklahoma National Stockyards (OK), Huss Livestock (NE), Frisco City
Stockyards (AL), Athens Regional Stockyard (TN), and Lexington Livestock
Auction (KY) — for **Feeder Cattle, Steers or Heifers, Per Cwt**, across the
common 400-900 lb weight breaks. These are the markets and the commodity/
class/price-unit slice found to report densely and consistently enough
across all six to support a real 8-report-date comparison; four other
sampled markets (Clovis Livestock Auction NM, Centennial CO, Central Plains
Stockyards IA, Torrington Livestock Commission WY) do not report this
combination often enough in a trailing 120-day window and are not yet
covered.

### What you give it

- `market_report_slugs` — which of the 6 covered markets to compare (their
  AMS report slug ids).
- `commodity`, `animal_class`, `weight_break_low`, `weight_break_high`,
  `price_unit` — the ONE comparison group to rank markets against (v1:
  Feeder Cattle, Steers/Heifers, common weight breaks, Per Cwt).

### What comes back

One row per requested market: its `rank` (1 = paying the most, right now,
for the requested group), its recent average price, how many reports fed
that average, and the date window they span. A market with no matching
recent data still gets a row — `charged: false` with a plain-English
`not_charged_reason` — never a silent gap.

### Billing

Charged per market row delivered where that market has at least one
matching, dated price in its own recent reporting window
(`market-ranking-row-delivered`). A market with no comparable data in the
requested group is delivered free, with a reason.

### Data freshness

The comparison is only as current as the last scheduled refresh. Each
market's own 8 most recent report dates for the requested group are kept;
older history falls out of the comparison window on the next refresh.

# Actor input Schema

## `market_report_slugs` (type: `array`):

One USDA AMS MARS API livestock-auction report slug id per line -- each one a sale barn/stockyard. v1 covers 6 markets: 1237 (Unionville Livestock Market, MO), 1280 (Oklahoma National Stockyards, OK), 1848 (Huss Livestock, NE), 1984 (Frisco City Stockyards, AL), 2060 (Athens Regional Stockyard, TN), 2127 (Lexington Livestock Auction, KY). A market outside this list returns a free, non-billable row explaining why, not an error. Up to 25 markets per run.

## `commodity` (type: `string`):

v1 covers exactly one commodity: "Feeder Cattle".

## `animal_class` (type: `string`):

v1 covers "Steers" or "Heifers".

## `weight_break_low` (type: `integer`):

The lower bound of the weight break to compare, e.g. 600. v1 covers the common 400-900 lb breaks in 50 lb increments.

## `weight_break_high` (type: `integer`):

The upper bound of the weight break to compare, e.g. 650.

## `price_unit` (type: `string`):

v1 covers "Per Cwt" (per hundredweight) only.

## Actor input object example

```json
{
  "market_report_slugs": [
    "1237",
    "1280",
    "1848",
    "1984",
    "2060",
    "2127"
  ],
  "commodity": "Feeder Cattle",
  "animal_class": "Steers",
  "weight_break_low": 600,
  "weight_break_high": 650,
  "price_unit": "Per Cwt"
}
```

# Actor output Schema

## `results` (type: `string`):

One row per requested market -- rank, recent average price, how many reports fed it, and the date window they span.

## `resultsCsv` (type: `string`):

The same rows as a spreadsheet.

## `summary` (type: `string`):

How many markets were requested, how many were charged and free, and when the underlying cache was last refreshed.

# 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 = {
    "market_report_slugs": [
        "1237",
        "1280",
        "1848",
        "1984",
        "2060",
        "2127"
    ],
    "commodity": "Feeder Cattle",
    "animal_class": "Steers",
    "weight_break_low": 600,
    "weight_break_high": 650,
    "price_unit": "Per Cwt"
};

// Run the Actor and wait for it to finish
const run = await client.actor("kevinserver24/usda-livestock-price-comparison").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 = {
    "market_report_slugs": [
        "1237",
        "1280",
        "1848",
        "1984",
        "2060",
        "2127",
    ],
    "commodity": "Feeder Cattle",
    "animal_class": "Steers",
    "weight_break_low": 600,
    "weight_break_high": 650,
    "price_unit": "Per Cwt",
}

# Run the Actor and wait for it to finish
run = client.actor("kevinserver24/usda-livestock-price-comparison").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 '{
  "market_report_slugs": [
    "1237",
    "1280",
    "1848",
    "1984",
    "2060",
    "2127"
  ],
  "commodity": "Feeder Cattle",
  "animal_class": "Steers",
  "weight_break_low": 600,
  "weight_break_high": 650,
  "price_unit": "Per Cwt"
}' |
apify call kevinserver24/usda-livestock-price-comparison --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kevinserver24/usda-livestock-price-comparison"
        }
    }
}

```

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/ltfrBykdasHv2Rj10/builds/pOm25VAchAZ61I3zi/openapi.json
