---
title: "GET /api/database/views/grid/{view_id}/aggregation/{field_id}/"
method: GET
path: "/api/database/views/grid/{view_id}/aggregation/{field_id}/"
tags: ["Database table grid view"]
---

# GET /api/database/views/grid/{view_id}/aggregation/{field_id}/

`GET /api/database/views/grid/{view_id}/aggregation/{field_id}/`

Computes the aggregation of all the values for a specified field from the selected grid view. You must select the aggregation type by setting the `type` GET parameter. If filters are configured for the selected view, the aggregation is calculated only on filtered rows. You need to have read permissions on the view to request an aggregation.

## Path parameters

- `field_id` integer, required
- `view_id` integer, required

## Query parameters

- `include` string
- `type` string

## Response `200`

- object
  - `value` union, required
    - number — The aggregation result for the specified field.
    - string — The aggregation result for the specified field.
    - unknown[] — The aggregation result for the specified field.
      - unknown
    - object — The aggregation result for the specified field.
  - `total` integer — The total value count. Only returned if `include=total` is specified as GET parameter.

## Other responses

- `400`
- `404`

---

[API](https://skmtc.dev/baserow/apis/baserow-api-spec.md) · [All operations](https://skmtc.dev/baserow/apis/baserow-api-spec/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/baserow/baserow-api-spec/revisions/f3396317d932/schema)
