---
title: "Query transactions"
method: POST
path: "/api/v1/search"
tags: ["Data v1.Search"]
---

# Query transactions

`POST /api/v1/search`

Queries transactions based on multiple parameters and returns a response containing transactions and their corresponding statistics matching the query. The query contains both fixed parameters and parameters parsed from the free text `queryString`. All the commands below are typically applied per word in the query and if multiple commands are found, they are concatenated with an `AND` operation (`OR` does not exist).

### Query string commands

Type |  Description | Keywords
---- | ----------------- | -----------------
Tags | Searches specifically for transactions with tags.| Words starting with '#'.
Amount Span | Searches for transactions within the given amount span. Keywords here depend on the locality of the user. | `over`, `under`, `more than`, `less than`, `around`
Date/Time Span | Searches for transactions within the given date/time span. Keywords here depend on the locality of the user. | `weekdays`, `weekends`, `today`, `yesterday`, `this week/month/year`, `last week/month/year`, `week #`.
Category | Searches specifically for transactions with the specified category. Keywords here depend on the locality of the user. | `Restaurant`, `Bar`

## Request body

- SearchQuery — The search query.
  - `accounts` string[] — A list of account IDs to filter by.
  - `categories` string[] — A list of category IDs to filter by. Could either be leaf node categories, such as the category ID corresponding to `expenses:food.restaurants`, or groups of categories, such as the category ID corresponding to `expenses:food`.
  - `endDate` string, date-time — The end date of the result.
  - `externalIds` string[] — A list of external IDs to filter by.
  - `includeUpcoming` boolean — Indicates if result should include upcoming transactions.
  - `limit` integer — The limit for the result, used for paging. Defaults to 50 if not set or set to 0.
  - `maxAmount` number, double — Maximum amount to filter the results. Negative values can be set for expenses.
  - `minAmount` number, double — Minimum amount to filter the results. Negative values can be set for expenses.
  - `offset` integer — The offset for the result, used for paging.
  - `order` 'ASC' | 'DESC' — The order of the result.
  - `queryString` string — The string query.
  - `sort` 'SCORE' | 'DATE' | 'ACCOUNT' | 'DESCRIPTION' | 'AMOUNT' | 'CATEGORY' — The sort order of the result.
  - `startDate` string, date-time — The start date of the result.

## Response `200`

Successful operation.

## Other responses

- `400` — The payload does not pass validation.

---

[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)
