{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rumoro-dev/json-schema/rumoro-dev-reviews-report-schema.json",
  "title": "ReviewsReport",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rumoro-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": "The first day included."
        },
        "to": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "The last day included."
        },
        "days": {
          "type": "integer",
          "minimum": 0,
          "description": "How many days the window spans."
        },
        "timezone": {
          "type": "string",
          "description": "The IANA time zone used to split the days."
        },
        "bucket": {
          "type": "string",
          "enum": [
            "day",
            "week"
          ],
          "description": "The step of each page's series. Days for windows up to 90 days and weeks beyond, unless you ask for one."
        }
      },
      "required": [
        "from",
        "to",
        "days",
        "timezone",
        "bucket"
      ],
      "description": "Start and end of the period."
    },
    "totals": {
      "type": "object",
      "properties": {
        "reviews": {
          "type": "integer",
          "minimum": 0,
          "description": "Reviews published in the window, counting each review once across keywords."
        },
        "averageRating": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 1,
          "maximum": 5,
          "description": "The average star rating with one decimal. Null when there are 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": "How many reviews have each star rating."
        },
        "responded": {
          "type": "integer",
          "minimum": 0,
          "description": "Reviews with a reply from the owner or developer. The App Store feed has no replies."
        },
        "openNegative": {
          "type": "integer",
          "minimum": 0,
          "description": "Reviews of 1 or 2 stars still open in triage."
        }
      },
      "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": "The intent and topic tags of 1 and 2 star reviews, most common first. They show what unhappy reviewers write about."
    },
    "pages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "reviews": {
            "type": "integer",
            "minimum": 0,
            "description": "Reviews published in the window, counting each review once across keywords."
          },
          "averageRating": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 1,
            "maximum": 5,
            "description": "The average star rating with one decimal. Null when there are 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": "How many reviews have each star rating."
          },
          "responded": {
            "type": "integer",
            "minimum": 0,
            "description": "Reviews with a reply from the owner or developer. The App Store feed has no replies."
          },
          "openNegative": {
            "type": "integer",
            "minimum": 0,
            "description": "Reviews of 1 or 2 stars still open in triage."
          },
          "platform": {
            "type": "string",
            "enum": [
              "appstore",
              "googleplay",
              "trustpilot",
              "googlemaps"
            ],
            "description": "Where the reviews come from. appstore is the Apple App Store, googleplay is Google Play, trustpilot is a company's Trustpilot page and googlemaps is the Google reviews of a place."
          },
          "id": {
            "type": "string",
            "description": "Page id. Trustpilot domain, Place ID or cid, or the app's id or package name."
          },
          "url": {
            "type": "string",
            "description": "Link to the review page."
          },
          "series": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string",
                  "description": "The first day of the step, as YYYY-MM-DD."
                },
                "reviews": {
                  "type": "integer",
                  "minimum": 0
                },
                "averageRating": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 1,
                  "maximum": 5,
                  "description": "The average star rating with one decimal. Null when there are no reviews."
                }
              },
              "required": [
                "date",
                "reviews",
                "averageRating"
              ]
            },
            "description": "Reviews and average stars for every step, oldest first, with no gaps."
          },
          "previous": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "reviews": {
                "type": "integer",
                "minimum": 0
              },
              "averageRating": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 1,
                "maximum": 5,
                "description": "The average star rating with one decimal. Null when there are no reviews."
              }
            },
            "required": [
              "reviews",
              "averageRating"
            ],
            "description": "The equally long period just before the window, when compare=true. Null otherwise."
          }
        },
        "required": [
          "reviews",
          "averageRating",
          "distribution",
          "responded",
          "openNegative",
          "platform",
          "id",
          "url",
          "series",
          "previous"
        ]
      },
      "description": "A row for each review page with reviews in the window, the page with the most first."
    },
    "previous": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "reviews": {
          "type": "integer",
          "minimum": 0,
          "description": "Reviews published in the window, counting each review once across keywords."
        },
        "averageRating": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 1,
          "maximum": 5,
          "description": "The average star rating with one decimal. Null when there are 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": "How many reviews have each star rating."
        },
        "responded": {
          "type": "integer",
          "minimum": 0,
          "description": "Reviews with a reply from the owner or developer. The App Store feed has no replies."
        },
        "openNegative": {
          "type": "integer",
          "minimum": 0,
          "description": "Reviews of 1 or 2 stars still open in triage."
        }
      },
      "required": [
        "reviews",
        "averageRating",
        "distribution",
        "responded",
        "openNegative"
      ],
      "description": "With compare=true, totals for the period before the window. Otherwise null."
    }
  },
  "required": [
    "window",
    "totals",
    "tags",
    "pages",
    "previous"
  ]
}