{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://socialcrawl.dev/schemas/product.json",
  "title": "SocialCrawl Product",
  "description": "Canonical unified product object returned by every SocialCrawl endpoint with the Product/ProductList archetype. Nullability is expressed via JSON Schema 2020-12 type arrays. Generated from the Zod schema in packages/social-api/src/schemas/canonical.ts.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Platform product ID (Amazon ASIN / Google Shopping product id)"
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Direct URL to the product page"
    },
    "title": {
      "type": [
        "string",
        "null"
      ],
      "description": "Product title"
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "String at product.description"
    },
    "seller": {
      "type": [
        "string",
        "null"
      ],
      "description": "String at product.seller"
    },
    "brand": {
      "type": [
        "string",
        "null"
      ],
      "description": "Brand name (cleaned). Null when the platform exposes a seller instead."
    },
    "price": {
      "type": "object",
      "description": "Price block (current, original/list, currency)",
      "properties": {
        "current": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at product.price.current"
        },
        "original": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at product.price.original"
        },
        "currency": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at product.price.currency"
        }
      }
    },
    "rating": {
      "type": "object",
      "description": "Aggregate rating (average + number of ratings)",
      "properties": {
        "average": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at product.rating.average"
        },
        "count": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at product.rating.count"
        }
      }
    },
    "image_urls": {
      "type": [
        "string",
        "array",
        "null"
      ],
      "description": "Primary image URL, or an array of image URLs for products with a gallery.",
      "items": {
        "type": "string",
        "description": "Primary image URL, or an array of image URLs for products with a gallery."
      }
    },
    "availability": {
      "type": [
        "string",
        "null"
      ],
      "description": "Stock/availability string when surfaced"
    },
    "reviews_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Numeric at product.reviews_count"
    },
    "features": {
      "type": [
        "array",
        "null"
      ],
      "description": "Array at product.features",
      "items": {
        "type": "string",
        "description": "String at product.features"
      }
    },
    "specifications": {
      "type": [
        "array",
        "null"
      ],
      "description": "Array at product.specifications",
      "items": {
        "type": "object",
        "description": "Nested object: product.specifications",
        "properties": {
          "group": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at product.specifications.group"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at product.specifications.name"
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at product.specifications.value"
          }
        }
      }
    },
    "variations": {
      "type": [
        "array",
        "null"
      ],
      "description": "Array at product.variations",
      "items": {
        "type": "object",
        "description": "Nested object: product.variations",
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at product.variations.id"
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at product.variations.title"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at product.variations.url"
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at product.variations.category"
          }
        }
      }
    },
    "ext": {
      "type": [
        "object",
        "null"
      ],
      "description": "Nested object: product.ext",
      "properties": {
        "gid": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at product.ext.gid"
        },
        "data_docid": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at product.ext.data_docid"
        },
        "pvf": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at product.ext.pvf"
        }
      }
    }
  },
  "additionalProperties": true
}
