{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scrapeatlas/json-schema/scrapeatlas-amazon-product-response-schema-schema.json",
  "title": "amazonProductResponseSchema",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scrapeatlas-amazon-api-openapi.yml#/components/schemas/amazonProductResponseSchema",
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "accounting": {
          "type": "object",
          "properties": {
            "upstreamRequests": {
              "type": "integer",
              "minimum": 0
            },
            "responseBytes": {
              "type": "integer",
              "minimum": 0
            },
            "durationMs": {
              "type": "number",
              "minimum": 0
            }
          },
          "required": [
            "upstreamRequests",
            "responseBytes",
            "durationMs"
          ],
          "additionalProperties": false
        },
        "success": {
          "type": "boolean",
          "const": true
        },
        "status": {
          "type": "string",
          "enum": [
            "success",
            "partial"
          ]
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "fetchedAt": {
          "type": "string",
          "format": "date-time"
        },
        "coverage": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "const": "public_page"
            },
            "complete": {
              "type": "boolean"
            },
            "warnings": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "source",
            "complete",
            "warnings"
          ],
          "additionalProperties": false
        },
        "product": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[A-Z0-9]{10}$"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "title": {
              "type": [
                "string",
                "null"
              ]
            },
            "description": {
              "type": [
                "string",
                "null"
              ]
            },
            "seller": {
              "type": [
                "string",
                "null"
              ]
            },
            "brand": {
              "type": [
                "string",
                "null"
              ]
            },
            "price": {
              "type": "object",
              "properties": {
                "current": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "original": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "currency": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "current",
                "original",
                "currency"
              ],
              "additionalProperties": false
            },
            "rating": {
              "type": "object",
              "properties": {
                "average": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "count": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                }
              },
              "required": [
                "average",
                "count"
              ],
              "additionalProperties": false
            },
            "image_urls": {
              "anyOf": [
                {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "maxItems": 100
                    }
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "availability": {
              "type": [
                "string",
                "null"
              ]
            },
            "reviews_count": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0
            },
            "specifications": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "group": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "value": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "group",
                  "name",
                  "value"
                ],
                "additionalProperties": false
              },
              "maxItems": 200
            },
            "variations": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Z0-9]{10}$"
                  },
                  "title": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "category": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "id",
                  "title",
                  "url",
                  "category"
                ],
                "additionalProperties": false
              },
              "maxItems": 200
            }
          },
          "required": [
            "id",
            "url",
            "title",
            "description",
            "seller",
            "brand",
            "price",
            "rating",
            "image_urls",
            "availability",
            "reviews_count"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "requestId",
        "accounting",
        "success",
        "status",
        "sourceUrl",
        "fetchedAt",
        "coverage",
        "product"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "accounting": {
          "type": "object",
          "properties": {
            "upstreamRequests": {
              "type": "integer",
              "minimum": 0
            },
            "responseBytes": {
              "type": "integer",
              "minimum": 0
            },
            "durationMs": {
              "type": "number",
              "minimum": 0
            }
          },
          "required": [
            "upstreamRequests",
            "responseBytes",
            "durationMs"
          ],
          "additionalProperties": false
        },
        "success": {
          "type": "boolean",
          "const": false
        },
        "status": {
          "type": "string",
          "enum": [
            "failed",
            "challenged"
          ]
        },
        "failure": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string",
              "enum": [
                "invalid_request",
                "unauthorized",
                "not_found",
                "upstream_challenged",
                "upstream_rate_limited",
                "upstream_error",
                "unsupported_page",
                "response_too_large",
                "unsafe_redirect",
                "request_limit",
                "timeout",
                "busy",
                "payload_too_complex"
              ]
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "requestId",
        "accounting",
        "success",
        "status",
        "failure"
      ],
      "additionalProperties": false
    }
  ]
}