{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mentio-dev/json-schema/mentio-dev-reviews-report-schema.json",
  "title": "ReviewsReport",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mentio-dev-analytics-api-openapi.yml#/components/schemas/ReviewsReport",
  "type": "object",
  "properties": {
    "window": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "First day, inclusive."
        },
        "to": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "Last day, inclusive."
        },
        "days": {
          "type": "integer",
          "minimum": 0,
          "description": "Length of the window in days."
        },
        "timezone": {
          "type": "string",
          "description": "IANA zone the days were cut in."
        },
        "bucket": {
          "type": "string",
          "enum": [
            "day",
            "week"
          ],
          "description": "How the page series are cut: day up to 90 days, else week, unless asked."
        }
      },
      "required": [
        "from",
        "to",
        "days",
        "timezone",
        "bucket"
      ],
      "description": "The window the report covers."
    },
    "totals": {
      "type": "object",
      "properties": {
        "reviews": {
          "type": "integer",
          "minimum": 0,
          "description": "Reviews published in the window; a review matched by two keywords counts once."
        },
        "averageRating": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 1,
          "maximum": 5,
          "description": "Average stars, one decimal; null with no reviews."
        },
        "distribution": {
          "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"
          ],
          "description": "Reviews per star rating."
        },
        "responded": {
          "type": "integer",
          "minimum": 0,
          "description": "Reviews carrying the owner's or developer's reply (the App Store's feed has none)."
        },
        "openNegative": {
          "type": "integer",
          "minimum": 0,
          "description": "1 and 2 star reviews nobody has marked done or ignored yet."
        }
      },
      "required": [
        "reviews",
        "averageRating",
        "distribution",
        "responded",
        "openNegative"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "tag": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "tag",
          "count"
        ]
      },
      "description": "Intent and topic tags on the 1 and 2 star reviews, most frequent first: what the unhappy ones are about."
    },
    "pages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "reviews": {
            "type": "integer",
            "minimum": 0,
            "description": "Reviews published in the window; a review matched by two keywords counts once."
          },
          "averageRating": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 1,
            "maximum": 5,
            "description": "Average stars, one decimal; null with no reviews."
          },
          "distribution": {
            "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"
            ],
            "description": "Reviews per star rating."
          },
          "responded": {
            "type": "integer",
            "minimum": 0,
            "description": "Reviews carrying the owner's or developer's reply (the App Store's feed has none)."
          },
          "openNegative": {
            "type": "integer",
            "minimum": 0,
            "description": "1 and 2 star reviews nobody has marked done or ignored yet."
          },
          "platform": {
            "type": "string",
            "enum": [
              "appstore",
              "googleplay",
              "trustpilot",
              "googlemaps"
            ],
            "description": "appstore (Apple App Store), googleplay (Google Play), trustpilot (a company's Trustpilot page) or googlemaps (a place's Google reviews)."
          },
          "id": {
            "type": "string",
            "description": "The page's id: app id, package name, Trustpilot domain, Place ID or cid."
          },
          "url": {
            "type": "string",
            "description": "The review page."
          },
          "series": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string",
                  "description": "Bucket start, YYYY-MM-DD."
                },
                "reviews": {
                  "type": "integer",
                  "minimum": 0
                },
                "averageRating": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 1,
                  "maximum": 5,
                  "description": "Average stars, one decimal; null with no reviews."
                }
              },
              "required": [
                "date",
                "reviews",
                "averageRating"
              ]
            },
            "description": "Reviews and average stars per bucket, oldest first, every bucket present."
          },
          "previous": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "reviews": {
                "type": "integer",
                "minimum": 0
              },
              "averageRating": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 1,
                "maximum": 5,
                "description": "Average stars, one decimal; null with no reviews."
              }
            },
            "required": [
              "reviews",
              "averageRating"
            ],
            "description": "The period of the same length right before the window, with compare=true; else null."
          }
        },
        "required": [
          "reviews",
          "averageRating",
          "distribution",
          "responded",
          "openNegative",
          "platform",
          "id",
          "url",
          "series",
          "previous"
        ]
      },
      "description": "One row per review page with reviews in the window, most reviewed first."
    },
    "previous": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "reviews": {
          "type": "integer",
          "minimum": 0,
          "description": "Reviews published in the window; a review matched by two keywords counts once."
        },
        "averageRating": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 1,
          "maximum": 5,
          "description": "Average stars, one decimal; null with no reviews."
        },
        "distribution": {
          "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"
          ],
          "description": "Reviews per star rating."
        },
        "responded": {
          "type": "integer",
          "minimum": 0,
          "description": "Reviews carrying the owner's or developer's reply (the App Store's feed has none)."
        },
        "openNegative": {
          "type": "integer",
          "minimum": 0,
          "description": "1 and 2 star reviews nobody has marked done or ignored yet."
        }
      },
      "required": [
        "reviews",
        "averageRating",
        "distribution",
        "responded",
        "openNegative"
      ],
      "description": "Totals for the period right before the window, with compare=true; else null."
    }
  },
  "required": [
    "window",
    "totals",
    "tags",
    "pages",
    "previous"
  ]
}