---
title: "QueryApplicationAnalytics"
url: "https://nov18-dev.movespot.fyi/apis/portal-application-analytics-2/versions/7eb4e759-6c13-4850-865d-25ae682ee61a/schemas/QueryApplicationAnalytics"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/portal-application-analytics-2/versions/7eb4e759-6c13-4850-865d-25ae682ee61a.md

# QueryApplicationAnalytics

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Portal Application Analytics
  version: 3.0.1
components:
  schemas:
    RelativeTimeRangeDto:
      description: A duration representing a relative-to-now span of time. Generally
        the start time is floored to the requested granularity. Eg 7d from now,
        with 1day granularity initiated at 2024-01-08T17:11:00+05:00 will query
        for the time range from 2024-01-01T00:00:00+05:00 to
        2024-01-08T17:11:00+05:00. The exact start and end timestamps are
        returned in the result query in the meta.start and meta.end fields. If
        the granularity for the previous query was 1hour, it would query a time
        range from 2024-01-01T17:00:00+05:00 to 2024-01-08T17:11:00+05:00.
      type: object
      properties:
        tz:
          type: string
          default: Etc/UTC
        type:
          type: string
          enum:
            - relative
        time_range:
          type: string
          default: 1h
          enum:
            - 15m
            - 1h
            - 6h
            - 12h
            - 24h
            - 7d
            - 30d
            - current_week
            - current_month
            - previous_week
            - previous_month
      required:
        - type
        - time_range
    AbsoluteTimeRangeDto:
      description: A duration representing an exact start and end time.
      type: object
      properties:
        tz:
          type: string
          default: Etc/UTC
        type:
          type: string
          enum:
            - absolute
        start:
          type: string
          format: date-time
        end:
          type: string
          format: date-time
      required:
        - type
        - start
        - end
    ApiFilter:
      type: object
      properties:
        field:
          description: The dimension to filter.
          type: string
          enum:
            - api
        operator:
          $ref: "#/components/schemas/FilterType"
        value:
          description: |
            The UUIDs of the API product versions to include in the results.
          type: array
          items:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      additionalProperties: false
      required:
        - field
        - operator
        - value
    ApplicationFilter:
      type: object
      properties:
        field:
          description: The dimension to filter. If no application filter is provided the
            API will implicitly filter on the applications owned by the
            developer making the query request.
          type: string
          enum:
            - application
        operator:
          $ref: "#/components/schemas/FilterType"
        value:
          description: |
            The UUIDs of the dev portal applications to include in the results.
          type: array
          items:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      additionalProperties: false
      required:
        - field
        - operator
        - value
    StatusCodeFilter:
      type: object
      properties:
        field:
          description: The dimension to filter.
          type: string
          enum:
            - status_code
        operator:
          $ref: "#/components/schemas/FilterType"
        value:
          description: |
            Only include requests with specific status codes in the results.
          type: array
          items:
            type: integer
            minimum: 100
            maximum: 999
      additionalProperties: false
      required:
        - field
        - operator
        - value
    StatusCodeGroupedFilter:
      type: object
      properties:
        field:
          description: The dimension to filter.
          type: string
          enum:
            - status_code_grouped
        operator:
          $ref: "#/components/schemas/FilterType"
        value:
          description: |
            Only include the given groups of status codes in the results.
          type: array
          items:
            type: string
            pattern: ^\d[xX][xX]$
      additionalProperties: false
      required:
        - field
        - operator
        - value
    FilterType:
      description: The type of filter to apply.  `in` filters will limit results to
        only the specified values, while `not_in` filters will exclude the
        specified values.
      type: string
      enum:
        - in
        - not_in
    QueryApplicationAnalytics:
      type: object
      properties:
        metrics:
          description: >
            A property of your API (such as request count or latency) that you
            wish to query on.

            Your chosen metric is aggregated within the specified dimensions,
            meaning that if you query 'request count by application', you'll
            receive the total number of requests each application received
            within the given time frame.
          type: array
          items:
            type: string
            enum:
              - request_count
              - request_per_minute
              - response_latency_average
              - response_size_average
              - response_size_sum
              - request_size_average
              - request_size_sum
          default:
            - request_count
          maxItems: 1
          minItems: 1
        dimensions:
          description: >
            The dimensions for the query.  A query may have up to 2 dimensions,
            including time.

            If no dimensions are provided, the report will simply return the
            provided metric aggregated across

            all available data.
          type: array
          items:
            type: string
            enum:
              - api
              - application
              - status_code
              - status_code_grouped
              - time
          default: []
          maxItems: 2
          minItems: 0
        granularity:
          description: >
            `granularity` is only valid for queries that include a time
            dimension, and it specifies the time buckets in for the returned
            data.
          type: string
          enum:
            - tenSecondly
            - thirtySecondly
            - minutely
            - fiveMinutely
            - tenMinutely
            - thirtyMinutely
            - hourly
            - twoHourly
            - twelveHourly
            - daily
            - weekly
            - trend
        time_range:
          description: The time range to query.
          default:
            type: relative
            time_range: 1h
          oneOf:
            - $ref: "#/components/schemas/RelativeTimeRangeDto"
            - $ref: "#/components/schemas/AbsoluteTimeRangeDto"
        filters:
          type: array
          items:
            oneOf:
              - $ref: "#/components/schemas/ApiFilter"
              - $ref: "#/components/schemas/ApplicationFilter"
              - $ref: "#/components/schemas/StatusCodeFilter"
              - $ref: "#/components/schemas/StatusCodeGroupedFilter"
          default: []
      additionalProperties: false
```
