{
  "$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": [
            "number",
            "null"
          ],
          "description": "Numeric at product.price.current"
        },
        "original": {
          "type": [
            "number",
            "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": [
            "number",
            "null"
          ],
          "description": "Numeric at product.rating.average"
        },
        "count": {
          "type": [
            "number",
            "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": [
        "number",
        "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"
        },
        "seller_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at product.ext.seller_id"
        },
        "sold_count": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at product.ext.sold_count"
        },
        "bought_past_month": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at product.ext.bought_past_month"
        },
        "bought_past_month_label": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at product.ext.bought_past_month_label"
        },
        "catalog_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at product.ext.catalog_id"
        },
        "requested_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at product.ext.requested_id"
        },
        "rating_distribution": {
          "type": [
            "object",
            "null"
          ],
          "description": "Nested object: product.ext.rating_distribution",
          "properties": {
            "star_1": {
              "type": [
                "number",
                "null"
              ],
              "description": "Numeric at product.ext.rating_distribution.star_1"
            },
            "star_2": {
              "type": [
                "number",
                "null"
              ],
              "description": "Numeric at product.ext.rating_distribution.star_2"
            },
            "star_3": {
              "type": [
                "number",
                "null"
              ],
              "description": "Numeric at product.ext.rating_distribution.star_3"
            },
            "star_4": {
              "type": [
                "number",
                "null"
              ],
              "description": "Numeric at product.ext.rating_distribution.star_4"
            },
            "star_5": {
              "type": [
                "number",
                "null"
              ],
              "description": "Numeric at product.ext.rating_distribution.star_5"
            }
          }
        },
        "store_inventory": {
          "type": [
            "array",
            "null"
          ],
          "description": "Array at product.ext.store_inventory",
          "items": {
            "type": "object",
            "description": "Nested object: product.ext.store_inventory",
            "properties": {
              "store_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at product.ext.store_inventory.store_id"
              },
              "store_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at product.ext.store_inventory.store_name"
              },
              "state": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at product.ext.store_inventory.state"
              },
              "in_stock": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Boolean at product.ext.store_inventory.in_stock"
              },
              "quantity": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Numeric at product.ext.store_inventory.quantity"
              },
              "fulfillment": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at product.ext.store_inventory.fulfillment"
              },
              "service": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at product.ext.store_inventory.service"
              },
              "location_type": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at product.ext.store_inventory.location_type"
              },
              "is_selected_store": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Boolean at product.ext.store_inventory.is_selected_store"
              }
            }
          }
        },
        "promotion": {
          "type": [
            "object",
            "null"
          ],
          "description": "Nested object: product.ext.promotion",
          "properties": {
            "label": {
              "type": [
                "string",
                "null"
              ],
              "description": "String at product.ext.promotion.label"
            },
            "amount_off": {
              "type": [
                "number",
                "null"
              ],
              "description": "Numeric at product.ext.promotion.amount_off"
            },
            "percent_off": {
              "type": [
                "number",
                "null"
              ],
              "description": "Numeric at product.ext.promotion.percent_off"
            }
          }
        },
        "price_note": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at product.ext.price_note"
        },
        "condition": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at product.ext.condition"
        },
        "available_quantity": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at product.ext.available_quantity"
        },
        "watchers": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at product.ext.watchers"
        },
        "sold_at": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at product.ext.sold_at"
        },
        "sold_caption": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at product.ext.sold_caption"
        },
        "buying_format": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at product.ext.buying_format"
        },
        "seller_reputation": {
          "type": [
            "object",
            "null"
          ],
          "description": "Nested object: product.ext.seller_reputation",
          "properties": {
            "feedback_percentage": {
              "type": [
                "number",
                "null"
              ],
              "description": "Numeric at product.ext.seller_reputation.feedback_percentage"
            },
            "feedback_count": {
              "type": [
                "number",
                "null"
              ],
              "description": "Numeric at product.ext.seller_reputation.feedback_count"
            },
            "top_rated": {
              "type": [
                "boolean",
                "null"
              ],
              "description": "Boolean at product.ext.seller_reputation.top_rated"
            },
            "items_sold": {
              "type": [
                "number",
                "null"
              ],
              "description": "Numeric at product.ext.seller_reputation.items_sold"
            },
            "joined": {
              "type": [
                "string",
                "null"
              ],
              "description": "String at product.ext.seller_reputation.joined"
            },
            "url": {
              "type": [
                "string",
                "null"
              ],
              "description": "String at product.ext.seller_reputation.url"
            },
            "detailed_ratings": {
              "type": [
                "object",
                "null"
              ],
              "description": "Nested object: product.ext.seller_reputation.detailed_ratings",
              "properties": {
                "accurate_description": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Numeric at product.ext.seller_reputation.detailed_ratings.accurate_description"
                },
                "reasonable_shipping_cost": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Numeric at product.ext.seller_reputation.detailed_ratings.reasonable_shipping_cost"
                },
                "shipping_speed": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Numeric at product.ext.seller_reputation.detailed_ratings.shipping_speed"
                },
                "communication": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Numeric at product.ext.seller_reputation.detailed_ratings.communication"
                }
              }
            }
          }
        },
        "g2": {
          "type": [
            "object",
            "null"
          ],
          "description": "Object at product.ext.g2"
        },
        "etsy": {
          "type": [
            "object",
            "null"
          ],
          "description": "Object at product.ext.etsy"
        },
        "sephora": {
          "type": [
            "object",
            "null"
          ],
          "description": "Object at product.ext.sephora"
        },
        "hm": {
          "type": [
            "object",
            "null"
          ],
          "description": "Object at product.ext.hm"
        },
        "kohls": {
          "type": [
            "object",
            "null"
          ],
          "description": "Object at product.ext.kohls"
        },
        "gumtree": {
          "type": [
            "object",
            "null"
          ],
          "description": "Object at product.ext.gumtree"
        },
        "sku_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at product.ext.sku_id"
        },
        "aliexpress": {
          "type": [
            "object",
            "null"
          ],
          "description": "Object at product.ext.aliexpress"
        },
        "tiktokshop": {
          "type": [
            "object",
            "null"
          ],
          "description": "Object at product.ext.tiktokshop"
        }
      }
    }
  },
  "additionalProperties": true
}
