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

# Get query count

> Returns the number of queries in each status. Filter the counts by workspace, the user who
ran the queries, and cluster.

Both date parameters are optional, in UTC, and use the format `YYYY-MM-DD HH:MM:SS`.
If `from_date` is omitted, the latest 100 records are fetched. If `to_date` is omitted,
the current time is used as the end time.




## OpenAPI

````yaml /openapi/query-history.yaml post /endpoints/v1/query-history/get-query-count/
openapi: 3.1.0
info:
  title: Query history API
  version: '1.0'
  description: >
    The query history API returns query counts grouped by status for your e6data
    account.

    Responses are JSON.


    You need your e6data subdomain (provided during sign-up), a personal access
    token, the workspace

    name, and one or more cluster names from that workspace.
servers:
  - url: https://{subdomain}.e6data.com
    description: Your e6data account endpoint.
    variables:
      subdomain:
        default: your-subdomain
        description: The subdomain provided during sign-up.
security:
  - bearerAuth: []
tags:
  - name: Query history
    description: Query volume and status counts.
paths:
  /endpoints/v1/query-history/get-query-count/:
    post:
      tags:
        - Query history
      summary: Get query count
      description: >
        Returns the number of queries in each status. Filter the counts by
        workspace, the user who

        ran the queries, and cluster.


        Both date parameters are optional, in UTC, and use the format
        `YYYY-MM-DD HH:MM:SS`.

        If `from_date` is omitted, the latest 100 records are fetched. If
        `to_date` is omitted,

        the current time is used as the end time.
      operationId: getQueryCount
      parameters:
        - name: from_date
          in: query
          required: false
          description: >
            Start of the time range, in UTC, formatted as `YYYY-MM-DD HH:MM:SS`
            (for example `2024-05-03 18:30:30`).

            If omitted, the latest 100 records are fetched.
          schema:
            type: string
          example: '2024-05-03 18:30:30'
        - name: to_date
          in: query
          required: false
          description: >
            End of the time range, in UTC, formatted as `YYYY-MM-DD HH:MM:SS`
            (for example `2024-05-03 18:30:30`).

            If omitted, the current time is used.
          schema:
            type: string
          example: '2024-05-03 18:30:30'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_name:
                  type: string
                  description: Name of the workspace in your e6data account.
                run_by:
                  type: string
                  description: Email address of the user who ran the queries.
                cluster_name:
                  type: array
                  description: Names of clusters in the workspace.
                  items:
                    type: string
            example:
              workspace_name: <WORKSPACE_NAME>
              run_by: <USER_EMAIL_ID>
              cluster_name:
                - <CLUSTER_NAME1>
                - <CLUSTER_NAME2>
      responses:
        '200':
          description: Query counts by status.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        status:
                          type: string
                          description: Query status.
                          enum:
                            - Success
                            - Failed
                            - Cancelled
                            - Timedout
                            - Parsing failed
                            - Executing
                            - Planning
                            - Queued
                        count:
                          type: integer
                          description: Number of queries with this status.
              example:
                result:
                  - status: Success
                    count: 17235
                  - status: Failed
                    count: 54476
                  - status: Cancelled
                    count: 0
                  - status: Timedout
                    count: 0
                  - status: Parsing failed
                    count: 1
                  - status: Executing
                    count: 1
                  - status: Planning
                    count: 0
                  - status: Queued
                    count: 0
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <ACCESS_TOKEN>` using a personal access
        token.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.