---
title: "POST /indices/statistics"
method: POST
path: "/indices/statistics"
---

# POST /indices/statistics

`POST /indices/statistics`

Returns the count, average, sum, minimum, maximum, sum of squares, variance, and standard deviation for the specified aggregated field. If the aggregation field is of type `String`, only the count statistic is returned.

Requires permission to access the [GetStatistics](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) action.

## Request body

- object
  - `indexName` string — The name of the index to search. The default value is <code>AWS_Things</code>.
  - `queryString` string, required — The query used to search. You can specify "*" for the query string to get the count of all indexed things in your Amazon Web Services account.
  - `aggregationField` string — The aggregation field name.
  - `queryVersion` string — The version of the query used to search.

## Response `200`

Success

- GetStatisticsResponse
  - `statistics` object — The statistics returned by the Fleet Indexing service based on the query and aggregation field.
    - `count` integer — The count of things that match the query string criteria and contain a valid aggregation field value.
    - `average` number, double — The average of the aggregated field values.
    - `sum` number, double — The sum of the aggregated field values.
    - `minimum` number, double — The minimum aggregated field value.
    - `maximum` number, double — The maximum aggregated field value.
    - `sumOfSquares` number, double — The sum of the squares of the aggregated field values.
    - `variance` number, double — The variance of the aggregated field values.
    - `stdDeviation` number, double — The standard deviation of the aggregated field values.

## Other responses

- `480` — InvalidRequestException
- `481` — ThrottlingException
- `482` — UnauthorizedException
- `483` — ServiceUnavailableException
- `484` — InternalFailureException
- `485` — ResourceNotFoundException
- `486` — InvalidQueryException
- `487` — InvalidAggregationException
- `488` — IndexNotReadyException

---

[API](https://skmtc.net/aws/apis/iot.md) · [All operations](https://skmtc.net/aws/apis/iot/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/iot/revisions/deef5c4b09f0/schema)
