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

# Get share viewaggregations

> Get share view aggregations



## OpenAPI

````yaml /swagger.json get /share/{shareId}/view/aggregations
openapi: 3.0.0
info:
  version: 1.0.0
  title: Teable App
  description: Manage Data as easy as drink a cup of tea
  x-logo:
    backgroundColor: '#F0F0F0'
    altText: Teable logo
servers:
  - url: https://app.teable.ai/api
security: []
tags:
  - name: base
    x-group: project
  - name: base node
    x-group: project node
  - name: base-share
    x-group: project-share
paths:
  /share/{shareId}/view/aggregations:
    get:
      tags:
        - share
      description: Get share view aggregations
      parameters:
        - schema:
            type: string
          required: true
          name: shareId
          in: path
        - schema:
            type: string
            example: '{field} = ''Completed'' AND {field} > 5'
            deprecated: true
          required: false
          name: filterByTql
          in: query
        - schema:
            type: string
            description: >-
              A filter object for complex query conditions based on fields,
              operators, and values. Use our visual query builder at
              https://app.teable.ai/developer/tool/query-builder to build
              filters.
          required: false
          description: >-
            A filter object for complex query conditions based on fields,
            operators, and values. Use our visual query builder at
            https://app.teable.ai/developer/tool/query-builder to build filters.
          name: filter
          in: query
        - schema:
            anyOf:
              - type: array
                items:
                  type: string
                minItems: 1
                maxItems: 1
              - type: array
                items:
                  type: string
                minItems: 2
                maxItems: 2
              - type: array
                items:
                  anyOf:
                    - type: string
                    - anyOf:
                        - type: string
                        - type: boolean
                minItems: 3
                maxItems: 3
            default:
              - searchValue
              - fieldIdOrName
              - false
            description: Search for records that match the specified field and value
          required: false
          description: Search for records that match the specified field and value
          name: search
          in: query
        - schema:
            anyOf:
              - type: array
                items:
                  type: string
                minItems: 2
                maxItems: 2
              - type: string
            example:
              - fldXXXXXXX
              - recXXXXXXX
            description: >-
              Filter out the records that can be selected by a given link cell
              from the relational table. For example, if the specified field is
              one to many or one to one relationship, recordId for which the
              field has already been selected will not appear.
          required: false
          description: >-
            Filter out the records that can be selected by a given link cell
            from the relational table. For example, if the specified field is
            one to many or one to one relationship, recordId for which the field
            has already been selected will not appear.
          name: filterLinkCellCandidate
          in: query
        - schema:
            anyOf:
              - type: array
                items:
                  type: string
                minItems: 2
                maxItems: 2
              - type: string
            example:
              - fldXXXXXXX
              - recXXXXXXX
            description: >-
              Filter out selected records based on this link cell from the
              relational table. Note that viewId, filter, and orderBy will not
              take effect in this case because selected records has it own
              order. Ignoring recordId gets all the selected records for the
              field
          required: false
          description: >-
            Filter out selected records based on this link cell from the
            relational table. Note that viewId, filter, and orderBy will not
            take effect in this case because selected records has it own order.
            Ignoring recordId gets all the selected records for the field
          name: filterLinkCellSelected
          in: query
        - schema:
            type: array
            items:
              type: string
            description: Filter selected records by record ids
          required: false
          description: Filter selected records by record ids
          name: selectedRecordIds
          in: query
        - schema:
            type: string
            description: >-
              An array of group objects that specifies how the records should be
              grouped.
          required: false
          description: >-
            An array of group objects that specifies how the records should be
            grouped.
          name: groupBy
          in: query
        - schema:
            type: object
            properties:
              count:
                type: array
                items:
                  type: string
              empty:
                type: array
                items:
                  type: string
              filled:
                type: array
                items:
                  type: string
              unique:
                type: array
                items:
                  type: string
              max:
                type: array
                items:
                  type: string
              min:
                type: array
                items:
                  type: string
              sum:
                type: array
                items:
                  type: string
              average:
                type: array
                items:
                  type: string
              checked:
                type: array
                items:
                  type: string
              unChecked:
                type: array
                items:
                  type: string
              percentEmpty:
                type: array
                items:
                  type: string
              percentFilled:
                type: array
                items:
                  type: string
              percentUnique:
                type: array
                items:
                  type: string
              percentChecked:
                type: array
                items:
                  type: string
              percentUnChecked:
                type: array
                items:
                  type: string
              earliestDate:
                type: array
                items:
                  type: string
              latestDate:
                type: array
                items:
                  type: string
              dateRangeOfDays:
                type: array
                items:
                  type: string
              dateRangeOfMonths:
                type: array
                items:
                  type: string
              totalAttachmentSize:
                type: array
                items:
                  type: string
          required: false
          name: field
          in: query
      responses:
        '200':
          description: Returns aggregations list of share view.
          content:
            application/json:
              schema:
                type: object
                properties:
                  aggregations:
                    type: array
                    items:
                      type: object
                      properties:
                        fieldId:
                          type: string
                          description: The id of the field.
                        total:
                          type: object
                          nullable: true
                          properties:
                            value:
                              anyOf:
                                - type: string
                                - type: number
                                - nullable: true
                            aggFunc:
                              type: string
                              enum:
                                - count
                                - empty
                                - filled
                                - unique
                                - max
                                - min
                                - sum
                                - average
                                - checked
                                - unChecked
                                - percentEmpty
                                - percentFilled
                                - percentUnique
                                - percentChecked
                                - percentUnChecked
                                - earliestDate
                                - latestDate
                                - dateRangeOfDays
                                - dateRangeOfMonths
                                - totalAttachmentSize
                          required:
                            - value
                            - aggFunc
                          description: Aggregations by all data in field
                        group:
                          type: object
                          nullable: true
                          additionalProperties:
                            type: object
                            properties:
                              value:
                                anyOf:
                                  - type: string
                                  - type: number
                                  - nullable: true
                              aggFunc:
                                type: string
                                enum:
                                  - count
                                  - empty
                                  - filled
                                  - unique
                                  - max
                                  - min
                                  - sum
                                  - average
                                  - checked
                                  - unChecked
                                  - percentEmpty
                                  - percentFilled
                                  - percentUnique
                                  - percentChecked
                                  - percentUnChecked
                                  - earliestDate
                                  - latestDate
                                  - dateRangeOfDays
                                  - dateRangeOfMonths
                                  - totalAttachmentSize
                            required:
                              - value
                              - aggFunc
                          description: Aggregations by grouped data in field
                      required:
                        - fieldId
                        - total
      security: []
      x-codeSamples:
        - lang: Shell
          source: |-
            curl --request GET \
              --url 'https://app.teable.ai/api/share/%7BshareId%7D/view/aggregations?filterByTql=%7Bfield%7D+%3D+%27Completed%27+AND+%7Bfield%7D+%3E+5&filter=SOME_STRING_VALUE&search=SOME_ARRAY_VALUE&filterLinkCellCandidate=fldXXXXXXX&filterLinkCellCandidate=recXXXXXXX&filterLinkCellSelected=fldXXXXXXX&filterLinkCellSelected=recXXXXXXX&selectedRecordIds=SOME_ARRAY_VALUE&groupBy=SOME_STRING_VALUE&field=SOME_OBJECT_VALUE'
        - lang: JavaScript
          source: >-
            const url =
            'https://app.teable.ai/api/share/%7BshareId%7D/view/aggregations?filterByTql=%7Bfield%7D+%3D+%27Completed%27+AND+%7Bfield%7D+%3E+5&filter=SOME_STRING_VALUE&search=SOME_ARRAY_VALUE&filterLinkCellCandidate=fldXXXXXXX&filterLinkCellCandidate=recXXXXXXX&filterLinkCellSelected=fldXXXXXXX&filterLinkCellSelected=recXXXXXXX&selectedRecordIds=SOME_ARRAY_VALUE&groupBy=SOME_STRING_VALUE&field=SOME_OBJECT_VALUE';

            const options = {method: 'GET'};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: Node.js
          source: |-
            const http = require('https');

            const options = {
              method: 'GET',
              hostname: 'app.teable.ai',
              port: null,
              path: '/api/share/%7BshareId%7D/view/aggregations?filterByTql=%7Bfield%7D+%3D+%27Completed%27+AND+%7Bfield%7D+%3E+5&filter=SOME_STRING_VALUE&search=SOME_ARRAY_VALUE&filterLinkCellCandidate=fldXXXXXXX&filterLinkCellCandidate=recXXXXXXX&filterLinkCellSelected=fldXXXXXXX&filterLinkCellSelected=recXXXXXXX&selectedRecordIds=SOME_ARRAY_VALUE&groupBy=SOME_STRING_VALUE&field=SOME_OBJECT_VALUE',
              headers: {}
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on('data', function (chunk) {
                chunks.push(chunk);
              });

              res.on('end', function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: Python
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("app.teable.ai")


            conn.request("GET",
            "/api/share/%7BshareId%7D/view/aggregations?filterByTql=%7Bfield%7D+%3D+%27Completed%27+AND+%7Bfield%7D+%3E+5&filter=SOME_STRING_VALUE&search=SOME_ARRAY_VALUE&filterLinkCellCandidate=fldXXXXXXX&filterLinkCellCandidate=recXXXXXXX&filterLinkCellSelected=fldXXXXXXX&filterLinkCellSelected=recXXXXXXX&selectedRecordIds=SOME_ARRAY_VALUE&groupBy=SOME_STRING_VALUE&field=SOME_OBJECT_VALUE")


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))

````

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