{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/glowjakt-se/json-schema/glowjakt-se-brand-market-schema.json",
  "title": "BrandMarket",
  "description": "One brand's presence on this country's market (source: the same nightly price data as the product listings).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/glowjakt-se-openapi.json#/components/schemas/BrandMarket",
  "type": "object",
  "properties": {
    "country": {
      "type": "string",
      "description": "Market code: se, no, dk, fi or de"
    },
    "currency": {
      "type": "string",
      "description": "SEK, NOK, DKK or EUR"
    },
    "slug": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "products": {
      "type": "integer",
      "description": "EAN-grouped products listed on this market"
    },
    "in_stock": {
      "type": "integer",
      "description": "Products currently in stock at at least one store"
    },
    "listings": {
      "type": "integer",
      "description": "Store listings across all products"
    },
    "on_sale": {
      "type": "integer",
      "description": "Products whose lowest current price is below the store's own reference price"
    },
    "stores": {
      "type": "integer"
    },
    "store_names": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Up to eight stores, most listings first"
    },
    "price": {
      "type": "object",
      "properties": {
        "min": {
          "type": [
            "number",
            "null"
          ]
        },
        "median": {
          "type": [
            "number",
            "null"
          ]
        },
        "max": {
          "type": [
            "number",
            "null"
          ]
        }
      }
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          }
        }
      }
    },
    "subcategories": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          }
        }
      }
    },
    "cheapest": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "price": {
          "type": [
            "number",
            "null"
          ]
        },
        "store": {
          "type": [
            "string",
            "null"
          ]
        },
        "in_stock": {
          "type": "boolean"
        },
        "url": {
          "type": "string",
          "description": "Product page on the market site"
        }
      }
    },
    "certifications": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "claims": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "attributes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "brand_url": {
      "type": "string",
      "description": "Brand page on the market site"
    },
    "ingredients": {
      "type": [
        "object",
        "null"
      ],
      "description": "Ingredient profile across the brand's products on this market, from parsed INCI lists. Shares use products with a known ingredient list as denominator.",
      "properties": {
        "products": {
          "type": "integer"
        },
        "with_inci": {
          "type": "integer",
          "description": "Products with a parsed ingredient list"
        },
        "with_keys": {
          "type": "integer"
        },
        "top": {
          "type": "array",
          "description": "Most common key-ingredient groups (non-controversial), up to 8",
          "items": {
            "$ref": "#/$defs/IngredientRef"
          }
        },
        "controversial": {
          "type": "array",
          "description": "Groups flagged as possibly affecting sensitive skin, up to 5",
          "items": {
            "$ref": "#/$defs/IngredientRef"
          }
        },
        "shares": {
          "type": "object",
          "properties": {
            "fragrance_free": {
              "type": [
                "number",
                "null"
              ]
            },
            "animal_free": {
              "type": [
                "number",
                "null"
              ]
            },
            "controversial_free": {
              "type": [
                "number",
                "null"
              ]
            }
          }
        },
        "hub_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Ingredient hub on the market site"
        }
      }
    },
    "as_of": {
      "type": "string",
      "format": "date",
      "description": "Day the block was computed (cached up to 1 h)."
    },
    "observed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "Latest store-feed date among the brand's listings on this market — the data's observation day, distinct from as_of."
    }
  },
  "$defs": {
    "IngredientRef": {
      "type": "object",
      "properties": {
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Localized group name"
        },
        "category": {
          "type": [
            "string",
            "null"
          ]
        },
        "tier": {
          "type": [
            "integer",
            "null"
          ]
        },
        "count": {
          "type": "integer",
          "description": "Products in the brand's range containing the group"
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Ingredient page on the market site, when published"
        }
      }
    }
  }
}