{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/daon/json-schema/daon-trend-statistics-response-dto-schema.json",
  "title": "TrendStatisticsResponseDto",
  "description": "Response containing trend statistics aggregated by time periods",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/daon-trends-api-openapi.yml#/components/schemas/TrendStatisticsResponseDto",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "The type of identifier queried"
    },
    "value": {
      "type": "string",
      "description": "The value of the identifier queried"
    },
    "queryValue": {
      "type": "string",
      "description": "The actual value used for the query (may be normalized)"
    },
    "documentType": {
      "type": "string",
      "description": "The document type (only present for documentNumber type)"
    },
    "startDateTime": {
      "type": "string",
      "format": "date-time",
      "description": "The start of the query time period"
    },
    "endDateTime": {
      "type": "string",
      "format": "date-time",
      "description": "The end of the query time period"
    },
    "granularity": {
      "type": "string",
      "description": "The time granularity used for aggregation, expressed as a compact label (e.g. '10s', '5m', '2h', '1d'). Selected automatically from the set [1s, 2s, 5s, 10s, 15s, 30s, 1m, 2m, 5m, 10m, 20m, 30m, 1h, 2h, 4h, 8h, 1d] to target approximately 90 data points, depending on bucket alignment."
    },
    "totalOccurrences": {
      "type": "integer",
      "format": "int64",
      "description": "Total number of occurrences in the time period"
    },
    "periods": {
      "type": "array",
      "description": "Array of time periods with occurrence counts, sorted by periodStart ascending",
      "items": {
        "$ref": "#/$defs/TrendStatisticsPeriodDto"
      }
    }
  },
  "$defs": {
    "TrendStatisticsPeriodDto": {
      "type": "object",
      "description": "A time period with occurrence count within trend statistics",
      "properties": {
        "periodStart": {
          "type": "string",
          "format": "date-time",
          "description": "The start of the time period"
        },
        "periodEnd": {
          "type": "string",
          "format": "date-time",
          "description": "The end of the time period"
        },
        "occurrenceCount": {
          "type": "integer",
          "format": "int64",
          "description": "The number of occurrences in this period"
        }
      }
    }
  }
}