{
  "name": "us-coffee-prices",
  "title": "US Retail Coffee Prices, Monthly, 1980-2026",
  "description": "Monthly US average retail price of ground roast coffee (BLS average price series APU0000717311: coffee, 100% ground roast, all sizes, per lb, U.S. city average, in US dollars, not seasonally adjusted), January 1980 to October 2026, with the same price in October 2026 dollars, the CPI-U all items index (CUUR0000SA0) and the CPI-U coffee index (CUUR0000SEFP01), both U.S. city average, not seasonally adjusted, 1982-84=100. Source: US Bureau of Labor Statistics, Public Data API v2.",
  "status": "structured",
  "licenses": [
    {
      "name": "US-PD",
      "title": "Public domain: work of the US federal government. BLS: \"everything that we publish, both in hard copy and electronically, is in the public domain, except for previously copyrighted photographs and illustrations.\" BLS asks users to cite the Bureau of Labor Statistics as the source.",
      "path": "https://www.bls.gov/opub/copyright-information.htm"
    }
  ],
  "sources": [
    {
      "title": "US Bureau of Labor Statistics, Average Price Data, series APU0000717311: Coffee, 100%, ground roast, all sizes, per lb. (453.6 gm) in U.S. city average, average price, not seasonally adjusted",
      "path": "https://data.bls.gov/timeseries/APU0000717311"
    },
    {
      "title": "US Bureau of Labor Statistics, Consumer Price Index, series CUUR0000SA0: All items in U.S. city average, all urban consumers, not seasonally adjusted (1982-84=100)",
      "path": "https://data.bls.gov/timeseries/CUUR0000SA0"
    },
    {
      "title": "US Bureau of Labor Statistics, Consumer Price Index, series CUUR0000SEFP01: Coffee in U.S. city average, all urban consumers, not seasonally adjusted (1982-84=100)",
      "path": "https://data.bls.gov/timeseries/CUUR0000SEFP01"
    },
    {
      "title": "BLS Public Data API v2 (how the data were retrieved)",
      "path": "https://api.bls.gov/publicAPI/v2/timeseries/data/"
    }
  ],
  "upkeep": { "mode": "frozen", "snapshot": "2026-11-28" },
  "resources": [
    {
      "path": "data/coffee-prices.csv",
      "name": "coffee-prices",
      "title": "US average retail price of ground coffee and CPI-U, monthly",
      "mediatype": "text/csv",
      "encoding": "utf-8",
      "schema": {
        "fields": [
          { "name": "date", "type": "date", "description": "Month, written as its first day (YYYY-MM-01). All values are for the whole month. January 1980 to October 2026." },
          { "name": "coffee_usd_per_lb", "type": "number", "description": "BLS average retail price of coffee, 100% ground roast, all sizes, in US dollars per pound (453.6 g), U.S. city average, not seasonally adjusted, excluding sales tax (BLS series APU0000717311). Empty where BLS publishes no value (see note)." },
          { "name": "coffee_usd_per_lb_real_oct2026", "type": "number", "description": "coffee_usd_per_lb in October 2026 dollars: coffee_usd_per_lb x (CPI-U all items for October 2026, 337.511) / (CPI-U all items for the month), rounded to 3 decimals. Calculated for this dataset; not a BLS figure." },
          { "name": "cpi_u_all_items", "type": "number", "description": "Consumer Price Index for All Urban Consumers (CPI-U), all items, U.S. city average, not seasonally adjusted, 1982-84=100 (BLS series CUUR0000SA0)." },
          { "name": "cpi_u_coffee", "type": "number", "description": "CPI-U for coffee, U.S. city average, not seasonally adjusted, 1982-84=100 (BLS series CUUR0000SEFP01). An index of price change for all coffee (not only ground roast), so its level is not a price." },
          { "name": "note", "type": "string", "description": "Why values are missing for this month: the BLS footnote (October 2025), or that BLS published no coffee average price for the month. Empty otherwise." }
        ],
        "primaryKey": ["date"]
      }
    }
  ],
  "views": [
    {
      "name": "coffee-price-chart",
      "title": "US average retail price of ground coffee, dollars per pound, 1980-2026",
      "resources": ["coffee-prices"],
      "specType": "vega-lite",
      "spec": {
        "width": "container",
        "height": 340,
        "transform": [
          { "fold": ["coffee_usd_per_lb", "coffee_usd_per_lb_real_oct2026"], "as": ["measure", "usd_per_lb"] },
          { "calculate": "datum.measure == 'coffee_usd_per_lb' ? 'Price at the time' : 'In October 2026 dollars'", "as": "series" }
        ],
        "mark": { "type": "line", "strokeWidth": 1.5 },
        "encoding": {
          "x": { "field": "date", "type": "temporal", "axis": { "title": null } },
          "y": { "field": "usd_per_lb", "type": "quantitative", "axis": { "title": "US dollars per pound" } },
          "color": { "field": "series", "type": "nominal", "title": null, "sort": ["Price at the time", "In October 2026 dollars"] },
          "tooltip": [
            { "field": "date", "type": "temporal", "format": "%b %Y" },
            { "field": "series", "type": "nominal" },
            { "field": "usd_per_lb", "type": "quantitative", "format": ".3f" }
          ]
        }
      }
    }
  ]
}
