{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bol-com/json-schema/bol-com-offer-insights-schema.json",
  "title": "OfferInsights",
  "description": "Offer insights.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bol-com-insights-api-openapi.yml#/components/schemas/OfferInsights",
  "required": [
    "offerInsights"
  ],
  "type": "object",
  "properties": {
    "offerInsights": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OfferInsight"
      }
    }
  },
  "$defs": {
    "OfferInsight": {
      "required": [
        "countries",
        "name",
        "periods",
        "type"
      ],
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the requested offer insight."
        },
        "type": {
          "type": "string",
          "description": "Interpretation of the data that applies to this measurement."
        },
        "total": {
          "type": [
            "number",
            "null"
          ],
          "description": "Total number of customer visits on the product page when the offer had the buy box over the requested period (excluding the current day).",
          "format": "double"
        },
        "countries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OfferInsightsCountry"
          }
        },
        "periods": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Periods"
          }
        }
      }
    },
    "OfferInsightsCountry": {
      "required": [
        "countryCode",
        "value"
      ],
      "type": "object",
      "properties": {
        "countryCode": {
          "type": "string",
          "description": "Countries in which this offer is currently on sale in the webshop, in ISO-3166-1 format."
        },
        "value": {
          "type": "number",
          "description": "The total value of offer insight.",
          "format": "double"
        }
      }
    },
    "OfferInsightsPeriod": {
      "required": [
        "year"
      ],
      "type": "object",
      "properties": {
        "day": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Day of the month.",
          "format": "int32"
        },
        "week": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Week of the year.",
          "format": "int32"
        },
        "month": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Month of the year.",
          "format": "int32"
        },
        "year": {
          "type": "integer",
          "description": "Year.",
          "format": "int32"
        }
      }
    },
    "Periods": {
      "required": [
        "period"
      ],
      "type": "object",
      "properties": {
        "period": {
          "$ref": "#/$defs/OfferInsightsPeriod"
        },
        "total": {
          "type": [
            "number",
            "null"
          ],
          "description": "Total number of customer visits on the product page when the offer had the buy box over the requested period (excluding the current day).",
          "format": "double"
        },
        "countries": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/OfferInsightsCountry"
          }
        }
      }
    }
  }
}