MainMarketAPI Reference
Get Access
Overview
  • Introduction
  • Authentication
  • Errors
Stores
  • List stores
  • Get a store
  • Store sentiment
  • Store coupons
  • Store aisles
Chains
  • List chains
  • Get a chain
  • Chain aisles
  • Resolve a list
Products
  • Catalog search
  • Get a product
  • Coupons for product
Prices
  • Search prices
  • Prices by UPC
  • Prices at a store
  • Cheapest nearby
Coupons
  • List coupons
  • Get a coupon
  • Coupon savings
Indices
  • Published indices
Discovery & meta
  • Discovery routes
  • OpenAPI spec
  • Agent skill spec
Overview
  • Introduction
  • Authentication
  • Errors
Stores
  • List stores
  • Get a store
  • Store sentiment
  • Store coupons
  • Store aisles
Chains
  • List chains
  • Get a chain
  • Chain aisles
  • Resolve a list
Products
  • Catalog search
  • Get a product
  • Coupons for product
Prices
  • Search prices
  • Prices by UPC
  • Prices at a store
  • Cheapest nearby
Coupons
  • List coupons
  • Get a coupon
  • Coupon savings
Indices
  • Published indices
Discovery & meta
  • Discovery routes
  • OpenAPI spec
  • Agent skill spec

Published indices

Read the published time series for one institutional-grade price index. Returns monthly values plus full methodology metadata. Snapshots are precomputed; this route never recomputes on the fly.

GET/v1/indices/{slug}$0.01

Path parameters

NameTypeDescription
slugrequiredstringOne of: eggs_cage_free_large_dozen, soda_12pk_12oz_cans, basket_low_income, basket_high_income.

Query parameters

NameTypeDescription
regionstringdefault: nationalOne of national, northeast, midwest, south, west.
fromstringStart period as YYYY-MM. Defaults to today minus 12 months.
tostringEnd period as YYYY-MM. Defaults to today's month.
include_betabooleandefault: falseInclude pre-inception trial-run snapshots published for methodology validation.
include_revokedbooleandefault: falseInclude snapshots that were revoked after publication. Default off; toggle on for transparency / audit reads.
include_previewbooleandefault: falseInclude forced_hide and draft snapshots. Internal use for QA.
ℹ
What the default response gives you
Out of the box you get the clean institutional view: publish_status equals auto or forced_publish, revoked = false, ordered by period ascending. That's the series an analyst should chart.

Request

Request
curl 'https://api.mainmarket.com/v1/indices/eggs_cage_free_large_dozen?region=national&from=2025-06&to=2026-04'

Response

200 OKjson
{
  "data": [
    {
      "period": "2025-06",
      "value_usd": 4.92,
      "value_indexed": 100.00,
      "n_observations": 18420,
      "n_stores": 6822,
      "n_chains": 64,
      "coverage_score": 0.91,
      "publish_status": "auto",
      "flagged_for_review": false,
      "flag_reason": null,
      "revoked": false,
      "methodology_version": 2,
      "computed_at": "2025-07-02T03:14:18Z"
    },
    {
      "period": "2026-04",
      "value_usd": 5.23,
      "value_indexed": 106.30,
      "n_observations": 19210,
      "n_stores": 7012,
      "n_chains": 67,
      "coverage_score": 0.93,
      "publish_status": "auto",
      "flagged_for_review": false,
      "flag_reason": null,
      "revoked": false,
      "methodology_version": 2,
      "computed_at": "2026-05-02T03:11:09Z"
    }
  ],
  "meta": {
    "as_of": "2026-05-03T01:14:00Z",
    "slug": "eggs_cage_free_large_dozen",
    "name": "Eggs, Cage-Free, Large, Dozen",
    "description": "Average national price of one dozen large cage-free eggs.",
    "index_type": "single_sku",
    "method": "trimmed_mean",
    "source_methodology": "BLS-CPI inspired",
    "methodology_url": "https://api.mainmarket.com/methodology.md",
    "methodology_version": 2,
    "inception_period": "2025-06",
    "base_period": "2025-06",
    "base_value_usd": 4.92,
    "regions": ["national"],
    "constituents": [
      { "upc": "00071600051501", "name": "Vital Farms Pasture-Raised Large", "weight": 0.30 },
      { "upc": "00099482492700", "name": "Pete and Gerry's Organic Large", "weight": 0.25 }
    ],
    "chain_filter": null,
    "request_id": "8c1a4d1e-30a7-4d92-9e1c-1cb43c6f2e10",
    "warning": null
  }
}

SnapshotRow fields (data[])

NameTypeDescription
periodstringCalendar month, YYYY-MM.
value_usdnumberIndex value in USD (e.g. dollars per dozen, dollars per basket).
value_indexednumber | nullComputed at query time from the index's frozen base_value_usd. Null while the index is in beta and no base has been chosen.
n_observationsintegerDistinct (store, product, day) rows used in the trimmed mean.
n_stores, n_chainsintegerCoverage breadth.
coverage_scorenumber0.0–1.0 internal QA score for the period.
publish_statusstringOne of auto, beta, forced_publish, forced_hide, draft.
flagged_for_review, flag_reasonmixedSoft anomaly flag from the QA cron.
revokedbooleanTrue when the snapshot was retracted after publication.
methodology_versionintegerVersion of the formula used for this snapshot. Bumps invalidate older comparisons.
computed_attimestampWhen the snapshot was written.

IndexMeta fields (meta)

NameTypeDescription
as_oftimestampServer time at request.
slug, name, descriptionstringIndex identity.
index_typestringOne of single_sku, multi_sku_same_format, basket_total_cost.
methodstringAggregation method label, e.g. trimmed_mean.
source_methodologystring | nullReference standard, e.g. 'BLS-CPI inspired'.
methodology_urlstringStable URL to the full methodology doc.
methodology_versionintegerCurrent methodology version.
inception_period, base_periodstringSeries-level period anchors (YYYY-MM).
base_value_usdnumber | nullUSD value used as the index=100 anchor. Null while the index is in beta.
regionsstring[]Regions for which snapshots exist.
constituentsobject[]Per-product weights (UPC, name, weight). Used to reproduce the index locally.
chain_filterobject | nullOptional chain inclusion/exclusion rules baked into this index.
request_iduuidPer-request id for support.
warningstring | nullSoft warning, e.g. 'index is inactive: curation pending'.
ℹ
Beta values are unindexed
value_indexed is null on beta snapshots because no base has been chosen yet. Pre-inception trials are surfaced for methodology validation; chart them in absolute USD instead. See Indices methodology for the full pipeline.

Notable behavior

  • Snapshots are written by a cron job. This route is read-only and never recomputes — a 200 OK with empty data means the slug exists but no snapshots match the requested window.
  • When the index exists but is inactive (curation pending), the response is 200 OK with empty data and meta.warning set.
  • The default 12-month window is calendar-month based. For deep history, set from explicitly.

Errors

NameTypeDescription
404Not FoundSlug is not a known published index.
422Unprocessable Entityfrom or to not YYYY-MM, or region not in the supported list.
402Payment RequiredPaid route — no payment proof.