> ## Documentation Index
> Fetch the complete documentation index at: https://docs.staminads.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get min/max extremes of a metric across grouped data



## OpenAPI

````yaml openapi.json post /api/analytics.extremes
openapi: 3.0.3
info:
  title: Staminads API
  description: Web analytics platform for tracking TimeScore metrics
  version: 1.0.0
servers:
  - url: https://your-instance.example.com
    description: Your Staminads instance
security: []
paths:
  /api/analytics.extremes:
    post:
      tags:
        - analytics
      summary: Get min/max extremes of a metric across grouped data
      operationId: AnalyticsController_extremes
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtremesQueryDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
components:
  schemas:
    ExtremesQueryDto:
      type: object
      properties:
        workspace_id:
          type: string
        metric:
          type: string
        groupBy:
          minItems: 1
          type: array
          items:
            type: string
        dateRange:
          $ref: '#/components/schemas/DateRangeDto'
        filters:
          type: array
          items:
            $ref: '#/components/schemas/FilterDto'
        metricFilters:
          type: array
          items:
            $ref: '#/components/schemas/MetricFilterDto'
        timezone:
          type: string
        havingMinSessions:
          type: number
          minimum: 1
        table:
          type: string
          enum:
            - sessions
            - pages
            - goals
      required:
        - workspace_id
        - metric
        - groupBy
        - dateRange
    DateRangeDto:
      type: object
      properties:
        start:
          type: string
        end:
          type: string
        preset:
          type: string
          enum:
            - previous_30_minutes
            - today
            - yesterday
            - previous_7_days
            - previous_14_days
            - previous_28_days
            - previous_30_days
            - previous_90_days
            - previous_91_days
            - this_week
            - previous_week
            - this_month
            - previous_month
            - this_quarter
            - previous_quarter
            - this_year
            - previous_year
            - previous_12_months
            - all_time
        granularity:
          type: string
          enum:
            - hour
            - day
            - week
            - month
            - year
    FilterDto:
      type: object
      properties:
        dimension:
          type: string
        operator:
          type: string
          enum:
            - equals
            - notEquals
            - in
            - notIn
            - contains
            - notContains
            - gt
            - gte
            - lt
            - lte
            - isNull
            - isNotNull
            - between
            - isEmpty
            - isNotEmpty
        values:
          type: array
          items:
            type: object
      required:
        - dimension
        - operator
    MetricFilterDto:
      type: object
      properties:
        metric:
          type: string
        operator:
          type: string
          enum:
            - gt
            - gte
            - lt
            - lte
            - between
        values:
          type: array
          items:
            type: object
      required:
        - metric
        - operator
        - values

````