---
title: "Query statistics"
method: POST
path: "/api/v1/statistics/query"
tags: ["Finance Management.Statistic", "ENTERPRISE"]
---

# Query statistics

`POST /api/v1/statistics/query`

By querying the statistics endpoint, an API customer can select the specific types of data to access. The statistics query should be posted in the request body and you can specify any of the properties available to filter the result set. Defining multiple properties will yield an `AND` operation, and specifying multiple values of a property will yield an `OR` operation.

Transfers and upcoming transactions are always excluded from statistics calculations.

Additionally statistics can be generated on further filtered set of  transactions. They can be filtered using tags that should be provided in tags field in request payload. When defining multiple tags they are treated as a logical expression with OR operator e.g. `["Cinema", "Theater"]` would be treated as Cinema OR Theater. If no tags are provided there is no filtering.

__Note:__ Monthly statistics will be calculated only with the resolution that the user has in the user settings (`MONTHLY`, `MONTHLY_ADJUSTED`), and not for both. 
__Note:__ `YEARLY` resolution is aggregated based on the resolution that the user has in the user settings. With `MONTHLY` it will be the calendar year and with `MONTHLY_ADJUSTED` it will be adjusted based on the users' `periodbreakday`.

### Statistics types

| Type                                      | Value of description field       | Description of type                                                                                                                                                                                                                                              | Available resolutions                                                       |
|-------------------------------------------|----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| `balances-by-account`                     | Identifier of an account         | Balances over time by each account                                                                                                                                                                                                                               | `DAILY` `MONTHLY` `MONTHLY_ADJUSTED`                                        |
| `balances-by-account-type-group`          | The type group name              | Balances over time by each account group. `CHECKING`, `CREDIT_CARD` and `OTHER` account type will map to `CARDS_AND_ACCOUNTS`. `MORTGAGE` and `LOAN` map to `LOANS`.  `INVESTMENT`, `PENSION` and `SAVINGS` map to `SAVINGS`                                     | `DAILY` `WEEKLY` `MONTHLY` `MONTHLY_ADJUSTED`                               |
| `carbon-by-category`                      | Identifier of a category         | Sum of carbon footprints per period in each category. <em>Note: This feature is not enabled by default. Speak to your account manager for more information.</em>                                                                                                 | `MONTHLY` `MONTHLY_ADJUSTED` `DAILY` `WEEKLY` `QUARTERLY`                   |
| `carbon-by-primary-category`              | Identifier of a primary category | Combined sum of all carbon footprints of child-categories per period in each primary category. <em>Note: This feature is not enabled by default. Speak to your account manager for more information.</em>                                                        | `MONTHLY` `MONTHLY_ADJUSTED` `DAILY` `WEEKLY` `QUARTERLY`                   |
| `carbon-by-tag`                           | Carbon tag                       | Combined sum of all carbon footprints grouped by tags placed in the transaction notes field. <em>Note: This feature is not enabled by default. Speak to your account manager for more information.</em>                                                          | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY` `WEEKLY` `DAILY`          |
| `expenses-by-brand`                       | Identifier of a brand            | The sum of expenses by brand <em>Note: This feature is not enabled by default. Speak to your account manager for more information.</em>                                                                                                                          | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY` `WEEKLY` `DAILY`          |
| `expenses-by-brand/by-count`              | Identifier of a brand            | The amount of expenses by brand  <em>Note: This feature is not enabled by default. Speak to your account manager for more information.</em>                                                                                                                      | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY` `WEEKLY` `DAILY`          |
| `expenses-by-brand/by-category`           | Identifier of a category         | The amount of expenses by brand in each category <em>Note: This feature is not enabled by default. Speak to your account manager for more information.</em>                                                                                                      | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY` `WEEKLY` `DAILY`          |
| `expenses-by-brand-by-category/by-count`  | Identifier of a category         | Count of expenses per brand in each category  <em>Note: This feature is not enabled by default. Speak to your account manager for more information.</em>                                                                                                         | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY` `WEEKLY` `DAILY`          |
| `expenses-by-category`                    | Identifier of a category         | Sum of expenses per period in each category                                                                                                                                                                                                                      | `MONTHLY` `MONTHLY_ADJUSTED` `YEARLY` `DAILY` `WEEKLY` `QUARTERLY`          |
| `expenses-by-category/by-count`           | Identifier of a category         | Count of expenses per period in each category                                                                                                                                                                                                                    | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `DAILY` `WEEKLY` `QUARTERLY`          |
| `expenses-by-cost-structure`              | The type of expense              | The sum of expenses per period in each cost type  <em>Note: This feature is not enabled by default. Speak to your account manager for more information.</em>                                                                                                     | `DAILY, MONTHLY, MONTHLY_ADJUSTED`                                          |
| `expenses-by-primary-category`            | Identifier of a primary category | Combined sum of all expenses of child-categories per period in each primary category                                                                                                                                                                             | `MONTHLY` `MONTHLY_ADJUSTED` `YEARLY` `DAILY` `WEEKLY` `QUARTERLY`          |
| `expenses-by-primary-category/by-count`   | Identifier of a primary category | Combined count of all expenses of child-categories per period in each primary category                                                                                                                                                                           | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `DAILY` `WEEKLY` `QUARTERLY`          |
| `expenses-by-tag`                         | Category tag                     | Combined sum of all expenses grouped by tags placed in the transaction notes field                                                                                                                                                                               | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY` `WEEKLY` `DAILY`          |
| `expenses-by-tag/by-count`                | Category tag                     | Count of all expenses grouped by tags placed in the transaction notes field                                                                                                                                                                                      | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY` `WEEKLY` `DAILY`          |
| `expenses-by-subscription`                | Identifier of a subscription     | Sum of the expenses by subscription  <em>Note: This feature is not enabled by default. Speak to your account manager for more information.</em>                                                                                                                  | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY`                           |
| `expenses-by-subscription/average`        | Identifier of a subscription     | Average amount of the expenses by subscription  <em>Note: This feature is not enabled by default. Speak to your account manager for more information.</em>                                                                                                       | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY`                           |
| `income-by-category`                      | Identifier of a category         | Sum of Incomes per period in each category                                                                                                                                                                                                                       | `YEARLY` `QUARTERLY` `MONTHLY` `MONTHLY_ADJUSTED` `WEEKLY` `DAILY`          |
| `income-by-category/by-count`             | Identifier of a category         | Count of all Incomes per period in each category <em>Note: This feature is not enabled by default. Speak to your account manager for more information.</em>                                                                                                      | `YEARLY` `QUARTERLY` `MONTHLY` `MONTHLY_ADJUSTED` `WEEKLY` `DAILY`          |
| `income-and-expenses`                     | Identifier of type               | Sum of transactions per period for category type                                                                                                                                                                                                                 | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `DAILY`                               |
| `income-by-tag`                           | Category tag                     | Combined sum of all incomes grouped by tags placed in the transaction notes field                                                                                                                                                                                | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY` `WEEKLY` `DAILY`          |
| `income-by-tag/by-count`                  | Category tag                     | Count of all incomes grouped by tags placed in the transaction notes field                                                                                                                                                                                       | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY` `WEEKLY` `DAILY`          |
| `incoming-transfers-by-category`          | Identifier of a category         | Sum of incoming transfers per period in each category                                                                                                                                                                                                            | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY` `WEEKLY` `DAILY`          |
| `incoming-transfers-by-category/by-count` | Identifier of a category         | Count of incoming transfers per period in each category                                                                                                                                                                                                          | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY` `WEEKLY` `DAILY`          |
| `left-to-spend`                           | The date                         | What is left of income minus expenses in a monthly period, to a minimum of 0                                                                                                                                                                                     | `DAILY`  `MONTHLY` `MONTHLY_ADJUSTED`                                       |
| `left-to-spend-average`                   | The date                         | Average left to spend on the day of the month for the last 6 monthly periods. If a requested day doesn't exist in a month it defaults to the last day of that month. For example: if the requested day is 31 it returns the left to spend for day 28 in February | `MONTHLY` `MONTHLY_ADJUSTED`                                                |
| `outgoing-transfers-by-category`          | Identifier of a category         | Sum of outgoing transfers per period in each category                                                                                                                                                                                                            | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY` `WEEKLY` `DAILY`          |
| `outgoing-transfers-by-category/by-count` | Identifier of a category         | Count of outgoing transfers per period in each category                                                                                                                                                                                                          | `YEARLY` `MONTHLY` `MONTHLY_ADJUSTED` `QUARTERLY` `WEEKLY` `DAILY`          |
| `safe-to-spend`                           | Day of the period                | What is left of income minus expenses - including past and future recurring transactions for that month period  <em>Note: This feature is not enabled by default. Speak to your account manager for more information.</em>                                       | `DAILY`  `MONTHLY` `MONTHLY_ADJUSTED`                                       |

## Request body

- Finance20ManagementStatisticQuery — unresolved $ref

## Response `200`

Successful operation.

- Finance20ManagementStatistic[] — unresolved $ref

## Other responses

- `400` — The payload does not pass validation.
- `401` — If the user is not authorized.

---

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