---
name: usda-ers-price-spreads-ingestion
description: "How to get USDA ERS Farm-to-Consumer Price Spreads data into a pandas DataFrame and Parquet: access, the request, the format, limits, quirks and terms."
---

# Load USDA fresh-apple price spreads into pandas and Parquet

Source entry: https://signal-lab-jet.vercel.app/datasets/usda-ers-price-spreads
Provider: https://www.ers.usda.gov/data-products/price-spreads-from-farm-to-consumer
Checked against the provider's documentation: 2026-11-01

## Access
- No account or key. Each current commodity table has a public CSV download.

## Request
```bash
curl -O 'https://www.ers.usda.gov/media/5736/fresh-apples.csv?v=15561'
```

## Format
Long-form CSV with Commodity, Year, Attribute and Value; attributes in this file cover retail price, farm value and farm share.

## Load into pandas and Parquet
Needs Python 3 with requests, pandas and pyarrow.
```python
"""USDA ERS fresh-apple farm-to-consumer price spreads -> pandas -> Parquet."""
import io
import requests
import pandas as pd

URL = "https://www.ers.usda.gov/media/5736/fresh-apples.csv?v=15561"
r = requests.get(URL, timeout=60)
r.raise_for_status()
df = pd.read_csv(io.BytesIO(r.content), encoding="utf-8-sig")
df.to_parquet("usda_price_spreads_fresh_apples.parquet", index=False)
print(len(df), "rows", df["Year"].min(), "to", df["Year"].max(),
      df["Attribute"].nunique(), "attributes")
```
Run by us on 2026-11-01 (python 3.13.5 | pandas 3.1.0 | pyarrow 26.0.0 | requests 2.34.2). Result: 54 rows 2008 to 2025 3 attributes

## Limits
- Rate limit: Not stated.
- Each CSV covers one food or market basket rather than the whole product.
- Current files update annually as underlying inputs become available.

## Quirks
- Units are embedded in Attribute labels rather than a separate unit column.
- Series are national annual averages and should not be interpreted as local prices.
- Basket definitions, source price series and conversion factors can change; use archived tables when a prior methodology is required.

## Terms and attribution
- The documentation supplies a USDA ERS citation.
- No separate data licence is stated on the checked product pages.
- Terms page: https://www.ers.usda.gov/data-products/price-spreads-from-farm-to-consumer/documentation

## Sources
- https://www.ers.usda.gov/data-products/price-spreads-from-farm-to-consumer/documentation: "Data for individual foods and market baskets are updated annually as the underlying data on retail prices, farm prices, and co-products values become available."
- https://www.ers.usda.gov/data-products/price-spreads-from-farm-to-consumer/documentation: "Price Spreads from Farm to Consumer uses U.S. annual, national-average prices to compare the value of foods at retail and on the farm."
- https://www.ers.usda.gov/data-products/price-spreads-from-farm-to-consumer/documentation: "Many of the farm and retail price data used to calculate statistics do not include accuracy measures."

## 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.
