{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scrapeatlas/json-schema/scrapeatlas-etsy-listing-reviews-response-schema-schema.json",
  "title": "etsyListingReviewsResponseSchema",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scrapeatlas-etsy-api-openapi.yml#/components/schemas/etsyListingReviewsResponseSchema",
  "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",
              "enum": [
                "public_page",
                "public_api"
              ]
            },
            "complete": {
              "type": "boolean"
            },
            "warnings": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "malformed_cards_omitted",
                  "organic_results_partially_embedded",
                  "listing_count_unknown",
                  "review_pages_unknown",
                  "malformed_reviews_omitted"
                ]
              }
            }
          },
          "required": [
            "source",
            "complete",
            "warnings"
          ],
          "additionalProperties": false
        },
        "listing": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,15}$"
            },
            "url": {
              "type": "string",
              "format": "uri"
            }
          },
          "required": [
            "id",
            "url"
          ],
          "additionalProperties": false
        },
        "shopId": {
          "type": "string",
          "pattern": "^[0-9]{1,20}$"
        },
        "rating": {
          "type": "object",
          "properties": {
            "average": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "maximum": 5
            },
            "count": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0
            }
          },
          "required": [
            "average",
            "count"
          ],
          "additionalProperties": false
        },
        "ratingCounts": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "1": {
                  "type": "integer",
                  "minimum": 0
                },
                "2": {
                  "type": "integer",
                  "minimum": 0
                },
                "3": {
                  "type": "integer",
                  "minimum": 0
                },
                "4": {
                  "type": "integer",
                  "minimum": 0
                },
                "5": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "1",
                "2",
                "3",
                "4",
                "5"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "count": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "name",
              "count"
            ],
            "additionalProperties": false
          },
          "maxItems": 20
        },
        "sort": {
          "type": "string",
          "enum": [
            "suggested",
            "most_recent",
            "highest_rating",
            "lowest_rating"
          ],
          "default": "suggested"
        },
        "ratingFilter": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1,
          "maximum": 5
        },
        "page": {
          "type": "integer",
          "minimum": 1
        },
        "totalPages": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "nextPage": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 2
        },
        "reviews": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[0-9]{1,20}$"
              },
              "reviewer": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  },
                  "avatar": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  }
                },
                "required": [
                  "name",
                  "url",
                  "avatar"
                ],
                "additionalProperties": false
              },
              "date": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "rating": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "maximum": 5
              },
              "text": {
                "type": "string"
              },
              "listing": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,15}$"
                      },
                      "title": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string",
                        "format": "uri"
                      },
                      "image": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uri"
                      }
                    },
                    "required": [
                      "id",
                      "title",
                      "url",
                      "image"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "response": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "photo": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri"
              }
            },
            "required": [
              "id",
              "reviewer",
              "date",
              "rating",
              "text",
              "listing",
              "response",
              "photo"
            ],
            "additionalProperties": false
          },
          "maxItems": 8
        }
      },
      "required": [
        "requestId",
        "accounting",
        "success",
        "status",
        "sourceUrl",
        "fetchedAt",
        "coverage",
        "listing",
        "shopId",
        "rating",
        "ratingCounts",
        "tags",
        "ratingFilter",
        "page",
        "totalPages",
        "nextPage",
        "reviews"
      ],
      "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
    }
  ]
}