# MassGain Public Market Data API

Use MassGain's public market snapshots to retrieve published potato pricing references, crop uncertainty signals and market reporting. These are public read endpoints; no registration or credential is required.

- API catalog: https://massgain.world/.well-known/api-catalog
- OpenAPI specification: https://massgain.world/developers/market-data.openapi.json
- Authentication guidance: https://massgain.world/auth.md
- Public dashboard preview: https://massgain.world/demo
- Contact and expanded access: https://massgain.world/contact

## Endpoints

- GET https://massgain.world/api/usda.json — USDA market-news potato pricing snapshot. Preserve each record's reporting date, market, origin, grade, variety, package, unit and quote basis where provided.
- GET https://massgain.world/api/ucui.json — published Usable Crop Uncertainty Index snapshot.
- GET https://massgain.world/api/ucui-log.json — crop uncertainty event history as NDJSON, normally served with Content-Type: text/plain despite the .json suffix. Parse each nonempty line as one JSON object. An empty history may instead return a single informational JSON object.
- GET https://massgain.world/api/fapp.json — FAPP reference series. Treat it as the publisher-defined reference, not a grower contract or an executable offer.
- GET https://massgain.world/api/eex.json — historical EEX processing-potato reference. This is a legacy reference; its presence does not mean an active futures contract or a current tradable quote exists.
- GET https://massgain.world/api/newsletter-feed.xml — published MassGain market-reporting feed.

The JSON contracts preserve source snapshots. A response may be an object containing metadata and records, or a source-specific array. Inspect the actual payload before selecting fields; do not assume every endpoint has a rows key or identical dimensions. The OpenAPI schema deliberately allows those source-specific shapes.

## Retrieve and interpret

Request JSON snapshots with Accept: application/json. For the UCUI event log, accept text/plain, application/x-ndjson or application/json and parse the documented NDJSON lines rather than treating the whole stream as one JSON document. For the reporting feed, accept application/rss+xml, application/xml or text/xml. Check the HTTP status before parsing. A 403 can indicate edge access policy; do not interpret an access error as a missing market price. Retry transient 429/5xx responses with bounded backoff, honoring Retry-After where present. Cache successful snapshots in your own application and avoid repeated full downloads within a task.

Use the reporting/observation date and freshness metadata in the payload. The time of your HTTP request is not the observation date. A 200 response does not prove every source series is current. Missing records, null, withheld values and zero have different meanings.

## Commercial comparability

Farm/grower prices, shipping-point quotes, wholesale quotes and retail promotions measure different transactions. Preserve geography, product/end use, grade, variety, size/pack, currency, unit, date and delivery basis. Currency or unit conversion does not make different commercial bases equivalent. Published quote midpoints are not verified executed trades.

An aggregate processing-potato price does not establish a chipper cultivar contract price. A national benchmark does not establish a state or province price. UCUI is an uncertainty signal, not a guaranteed price forecast. Label MassGain inference, calculations and hypothetical scenarios separately from observations.

Cite the precise endpoint, original publisher, observation period and retrieval date when reusing results. Preserve original source attribution and applicable data rights. Public accessibility does not override third-party rights or grant access to private datasets.

## Expanded history and private APIs

The authenticated Procurement API provides additional historical and source-specific series. Read https://massgain.world/developers/procurement/ and obtain an approved credential before calling it. The public API catalog does not make authenticated data public.
