{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shelfatlas-com/json-schema/shelfatlas-com-seo-term-schema.json",
  "title": "SeoTerm",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shelfatlas-com-seoterms-api-openapi.yml#/components/schemas/SeoTerm",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "slug",
    "term",
    "query",
    "offers_7d",
    "chains_7d",
    "chain_offers",
    "last_seen"
  ],
  "properties": {
    "slug": {
      "type": "string",
      "description": "URL-safe identifier, e.g. `pepsi-max`."
    },
    "term": {
      "type": "string",
      "description": "Display form, e.g. \"Pepsi Max\"."
    },
    "query": {
      "type": "string",
      "description": "Lowercase search text to feed `offers.search({ q })`."
    },
    "offers_7d": {
      "type": "integer",
      "description": "Active campaign offers behind this term at the last refresh."
    },
    "chains_7d": {
      "type": "integer",
      "description": "Distinct chains carrying an offer behind this term."
    },
    "chain_offers": {
      "type": [
        "array",
        "null"
      ],
      "description": "Per-chain breakdown of the offers behind this term, ordered offers desc then chain_slug asc; the offers sum to `offers_7d` and the length is `chains_7d`. Campaign offers are chain-level, so a consumer sums the chains near a place to size a place × term page. null until the term's first refresh after this field was added.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "chain_slug",
          "offers"
        ],
        "properties": {
          "chain_slug": {
            "type": "string",
            "description": "Chain slug, as in `/chains` and `/stores/nearest`, e.g. `netto`."
          },
          "offers": {
            "type": "integer",
            "description": "Active campaign offers from this chain behind the term."
          }
        }
      }
    },
    "last_seen": {
      "type": "string",
      "format": "date-time",
      "description": "When this term last met the thresholds."
    }
  }
}