E-commerce

Grocery & CPG Product

/extract/json

Schema for grocery and consumer packaged goods (CPG) product listings.

Download the schemae-commerce/grocery-cpg-product.json

grocery-cpg-product.schema

// names marked ? are optional

product_name:string// Name of the grocery or CPG product. Commonly found in: product page h1, product card title, og:title meta tag.
brand?:string// Brand name of the product. Commonly found in: brand field in product details, product byline, package brand label.
upc?:string// Universal Product Code (UPC/EAN barcode). Commonly found in: product details table, product ID field, barcode data.
platform:string// E-commerce platform or grocery delivery app. Commonly found in: site domain, platform branding, app name.
store_name?:string// Physical or online store name. Commonly found in: store name header, retailer branding, sold by field.
price:number// Current price of the product. Commonly found in: price display, product price span, JSON-LD price field.
unit_price?:number// Price per unit of measure (e.g., per oz, per count). Commonly found in: unit price display, per oz price label, price per unit section.
unit_of_measure?:string// Unit of measure for unit pricing (e.g., oz, lb, count). Commonly found in: unit price label, product weight field, package size indicator.
sale_price?:number// Sale or discounted price. Commonly found in: sale price display, discount label, was/now price display.
availability:string// Current availability status. Commonly found in: availability badge, in stock indicator, add to cart button state. One of: in_stock, out_of_stock, limited, other.
category?:string// Primary product category (e.g., Dairy, Snacks, Beverages). Commonly found in: breadcrumb navigation, category field, aisle label.
subcategory?:string// Product subcategory. Commonly found in: breadcrumb navigation, subcategory field, aisle sub-label.
weight_oz?:number// Product weight in ounces. Commonly found in: product size/weight field, package label, product details table.
calories?:number// Calories per serving. Commonly found in: nutrition facts label, calories per serving display, nutritional info section.
ingredients?:string// Ingredients list as a string. Commonly found in: ingredients section, product label ingredients, nutrition tab.
allergens?:string[]// List of allergens present or may contain. Commonly found in: allergen section, contains/may contain labels, product warning section.
nutritional_info?:object// Key nutritional values per serving. Commonly found in: nutrition facts panel, nutritional information section, nutrition tab.
fat?:number// Total fat in grams.
carbs?:number// Total carbohydrates in grams.
protein?:number// Protein in grams.
sodium?:number// Sodium in milligrams.
sugar?:number// Total sugars in grams.
fiber?:number// Dietary fiber in grams.
certifications?:string[]// Certifications or labels (e.g., Organic, Non-GMO, Gluten-Free). Commonly found in: certification badges, product label certifications, filter tags.
images?:string[]// URLs of product images. Commonly found in: product image gallery, image carousel, og:image meta tag.
description?:string// Product description text. Commonly found in: product description section, about this item, product overview.
page_title?:string// Title of the source page. Tabstack auto-fills this from page metadata when left empty.
favicon?:string// Favicon URL of the source page. Tabstack auto-fills this from page metadata when left empty.

Try it live

A sample Grocery & CPG Product document, generated from the schema. Edit it, or paste a real response, and see it checked against the schema instantly. It runs in your browser, nothing is sent anywhere.

your-output.json
validation

Valid, matches Grocery & CPG Product

Every required field is present and each value matches its type. Extra fields are allowed. A field the page does not carry is not guaranteed to come back as null, so check values rather than only checking for null.

/extract/json

Copy-paste usage

The same call in TypeScript, Python, and curl. Point it at your own URL and go. The schema drives the response, so you get back the fields you asked for instead of a page to parse.

Features

  • Typed TypeScript and Python SDKs
  • One call, no parsing code and no second LLM pass
  • The same field names on every request, even when the page layout changes
grocery-cpg-product.ts
// curl -sfLO https://raw.githubusercontent.com/Mozilla-Ocho/tabstack-schemas/main/e-commerce/grocery-cpg-product.json
import Tabstack from '@tabstack/sdk'
import schema from './grocery-cpg-product.json' with { type: 'json' }

const client = new Tabstack() // reads TABSTACK_API_KEY from the environment

try {
  const data = await client.extract.json({
    url: 'https://example.com/products/item',
    json_schema: schema,
    effort: 'standard', // 'min' | 'standard' | 'max'
  })

  console.log(data)
} catch (err) {
  console.error('Extraction failed:', err)
}

Ship this schema in one call.

Pass a URL, get matching JSON back. Free to start, no extraction layer to maintain.