{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-analytics/json-schema/google-analytics-get-reports-response-schema.json",
  "title": "GetReportsResponse",
  "description": "The main response class which holds the reports from the Reporting API `batchGet` call.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-analytics-reports-api-openapi.yml#/components/schemas/GetReportsResponse",
  "properties": {
    "queryCost": {
      "description": "The amount of resource quota tokens deducted to execute the query. Includes all responses.",
      "format": "int32",
      "type": "integer"
    },
    "reports": {
      "description": "Responses corresponding to each of the request.",
      "items": {
        "$ref": "#/$defs/Report"
      },
      "type": "array"
    },
    "resourceQuotasRemaining": {
      "$ref": "#/$defs/ResourceQuotasRemaining",
      "description": "The amount of resource quota remaining for the property."
    }
  },
  "type": "object",
  "$defs": {
    "ColumnHeader": {
      "description": "Column headers.",
      "properties": {
        "dimensions": {
          "description": "The dimension names in the response.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "metricHeader": {
          "$ref": "#/$defs/MetricHeader",
          "description": "Metric headers for the metrics in the response."
        }
      },
      "type": "object"
    },
    "DateRangeValues": {
      "description": "Used to return a list of metrics for a single DateRange / dimension combination",
      "properties": {
        "pivotValueRegions": {
          "description": "The values of each pivot region.",
          "items": {
            "$ref": "#/$defs/PivotValueRegion"
          },
          "type": "array"
        },
        "values": {
          "description": "Each value corresponds to each Metric in the request.",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "MetricHeader": {
      "description": "The headers for the metrics.",
      "properties": {
        "metricHeaderEntries": {
          "description": "Headers for the metrics in the response.",
          "items": {
            "$ref": "#/$defs/MetricHeaderEntry"
          },
          "type": "array"
        },
        "pivotHeaders": {
          "description": "Headers for the pivots in the response.",
          "items": {
            "$ref": "#/$defs/PivotHeader"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "MetricHeaderEntry": {
      "description": "Header for the metrics.",
      "properties": {
        "name": {
          "description": "The name of the header.",
          "type": "string"
        },
        "type": {
          "description": "The type of the metric, for example `INTEGER`.",
          "enum": [
            "METRIC_TYPE_UNSPECIFIED",
            "INTEGER",
            "FLOAT",
            "CURRENCY",
            "PERCENT",
            "TIME"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "PivotHeader": {
      "description": "The headers for each of the pivot sections defined in the request.",
      "properties": {
        "pivotHeaderEntries": {
          "description": "A single pivot section header.",
          "items": {
            "$ref": "#/$defs/PivotHeaderEntry"
          },
          "type": "array"
        },
        "totalPivotGroupsCount": {
          "description": "The total number of groups for this pivot.",
          "format": "int32",
          "type": "integer"
        }
      },
      "type": "object"
    },
    "PivotHeaderEntry": {
      "description": "The headers for the each of the metric column corresponding to the metrics requested in the pivots section of the response.",
      "properties": {
        "dimensionNames": {
          "description": "The name of the dimensions in the pivot response.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "dimensionValues": {
          "description": "The values for the dimensions in the pivot.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "metric": {
          "$ref": "#/$defs/MetricHeaderEntry",
          "description": "The metric header for the metric in the pivot."
        }
      },
      "type": "object"
    },
    "PivotValueRegion": {
      "description": "The metric values in the pivot region.",
      "properties": {
        "values": {
          "description": "The values of the metrics in each of the pivot regions.",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "Report": {
      "description": "The data response corresponding to the request.",
      "properties": {
        "columnHeader": {
          "$ref": "#/$defs/ColumnHeader",
          "description": "The column headers."
        },
        "data": {
          "$ref": "#/$defs/ReportData",
          "description": "Response data."
        },
        "nextPageToken": {
          "description": "Page token to retrieve the next page of results in the list.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "ReportData": {
      "description": "The data part of the report.",
      "properties": {
        "dataLastRefreshed": {
          "description": "The last time the data in the report was refreshed. All the hits received before this timestamp are included in the calculation of the report.",
          "format": "google-datetime",
          "type": "string"
        },
        "emptyReason": {
          "description": "If empty reason is specified, the report is empty for this reason.",
          "type": "string"
        },
        "isDataGolden": {
          "description": "Indicates if response to this request is golden or not. Data is golden when the exact same request will not produce any new results if asked at a later point in time.",
          "type": "boolean"
        },
        "maximums": {
          "description": "Minimum and maximum values seen over all matching rows. These are both empty when `hideValueRanges` in the request is false, or when rowCount is zero.",
          "items": {
            "$ref": "#/$defs/DateRangeValues"
          },
          "type": "array"
        },
        "minimums": {
          "description": "Minimum and maximum values seen over all matching rows. These are both empty when `hideValueRanges` in the request is false, or when rowCount is zero.",
          "items": {
            "$ref": "#/$defs/DateRangeValues"
          },
          "type": "array"
        },
        "rowCount": {
          "description": "Total number of matching rows for this query.",
          "format": "int32",
          "type": "integer"
        },
        "rows": {
          "description": "There's one ReportRow for every unique combination of dimensions.",
          "items": {
            "$ref": "#/$defs/ReportRow"
          },
          "type": "array"
        },
        "samplesReadCounts": {
          "description": "If the results are [sampled](https://support.google.com/analytics/answer/2637192), this returns the total number of samples read, one entry per date range. If the results are not sampled this field will not be defined. See [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) for details.",
          "items": {
            "format": "int64",
            "type": "string"
          },
          "type": "array"
        },
        "samplingSpaceSizes": {
          "description": "If the results are [sampled](https://support.google.com/analytics/answer/2637192), this returns the total number of samples present, one entry per date range. If the results are not sampled this field will not be defined. See [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) for details.",
          "items": {
            "format": "int64",
            "type": "string"
          },
          "type": "array"
        },
        "totals": {
          "description": "For each requested date range, for the set of all rows that match the query, every requested value format gets a total. The total for a value format is computed by first totaling the metrics mentioned in the value format and then evaluating the value format as a scalar expression. E.g., The \"totals\" for `3 / (ga:sessions + 2)` we compute `3 / ((sum of all relevant ga:sessions) + 2)`. Totals are computed before pagination.",
          "items": {
            "$ref": "#/$defs/DateRangeValues"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "ReportRow": {
      "description": "A row in the report.",
      "properties": {
        "dimensions": {
          "description": "List of requested dimensions.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "metrics": {
          "description": "List of metrics for each requested DateRange.",
          "items": {
            "$ref": "#/$defs/DateRangeValues"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "ResourceQuotasRemaining": {
      "description": "The resource quota tokens remaining for the property after the request is completed.",
      "properties": {
        "dailyQuotaTokensRemaining": {
          "description": "Daily resource quota remaining remaining.",
          "format": "int32",
          "type": "integer"
        },
        "hourlyQuotaTokensRemaining": {
          "description": "Hourly resource quota tokens remaining.",
          "format": "int32",
          "type": "integer"
        }
      },
      "type": "object"
    }
  }
}