---
title: "Get Matches (*)"
method: GET
path: "/matches/{pattern}"
tags: ["Matches"]
---

# Get Matches (*)

`GET /matches/{pattern}`

Retrieve matches from the database matching the given pattern, in descending `slot_no` order. Results are streamed to the client for more efficiency.
See [Patterns](#section/Patterns) for more information about constructing patterns.

## Path parameters

- `pattern` union, required
  - '*'
  - union — A Cardano address or stake address.
    - unknown
    - unknown
    - unknown
    - unknown
  - string — ``` ┏━━━━━━━━━━━┓ ╭───╮ ┏━━━━━━━━━━━━┓ ╾─┫ POLICY_ID ┣─┤ . ├─┫ ASSET_NAME ┣─╼ ┗━━━━━━━━━━━┛ ╰───╯ ┗━━━━━━━━━━━━┛ ``` A policy id (base16-encoded) and an optional asset name (base16-encoded), dot-separated. Examples: - `1220099e5e430475c219518179efc7e6c8289db028904834025d5b086.*` - `1220099e5e430475c219518179efc7e6c8289db028904834025d5b086.08661220099e`
  - string — ``` ┏━━━━━━━━━━━━━━┓ ╭───╮ ┏━━━━━━━━━━━━━━━━┓ ╾─┫ OUTPUT_INDEX ┣─┤ @ ├─┫ TRANSACTION_ID ┣─╼ ┗━━━━━━━━━━━━━━┛ ╰───╯ ┗━━━━━━━━━━━━━━━━┛ ``` An (optional) output index and transaction id (base16-encoded), separated by a `@`. Examples: - `42@35d8340cd6a5d31bf9d09706b92adedf9b1b632e682fdab9fc8865ee3de14e09` - `*@35d8340cd6a5d31bf9d09706b92adedf9b1b632e682fdab9fc8865ee3de14e09`

## Query parameters

- `order` 'most_recent_first' | 'oldest_first' — Order results by their location on-chain. By default, most recent results are returned first (i.e. by descending `created_at.slot_no`). Within a same slot, results are ordered in function of their position in the block (i.e. `transaction_index`).
- `created_after` union
  - integer — Only fetch results that were created at and after the given slot.
  - string — Only fetch results that were created at and after the given point. This fails if the provided point doesn't exist. It is handy to fetch a collection of results by pages while ensuring that the collection isn't being altered to due alternative chain forks being adopted. The last known fetch point can be used as starting point for the next range. Points are defined in the usual format (same as the command-line): ``` ┏━━━━━━━━━━━━━┓ ╭───╮ ┏━━━━━━━━━━━━━┓ POINT = ╾─┫ SLOT-NUMBER ┣─┤ . ├─┫ HEADER-HASH ┣─╼ ┗━━━━━━━━━━━━━┛ ╰───╯ ┗━━━━━━━━━━━━━┛ ┏━━━━━━━━━━━┓ HEADER-HASH = ╾─┫ 64 HEXDIG ┣───────────────────╼ ┗━━━━━━━━━━━┛ ┏━━━━━━━━━━┓ SLOT-NUMBER = ╾─┫ 1* DIGIT ┣────────────────────╼ ┗━━━━━━━━━━┛ ``` For example: `5999990.dca1e44765b9f80c8b18105e17de90d4a07e4d5a83de533e53fee32e0502d17e`
- `spent_after` union
  - integer — Only fetch results that were spent at and after the given slot.
  - string — Only fetch results that were spent at and after the given point. This fails if the provided point doesn't exist. It is handy to fetch a collection of results by pages while ensuring that the collection isn't being altered to due alternative chain forks being adopted. The last known fetch point can be used as starting point for the next range. Points are defined in the usual format (same as the command-line): ``` ┏━━━━━━━━━━━━━┓ ╭───╮ ┏━━━━━━━━━━━━━┓ POINT = ╾─┫ SLOT-NUMBER ┣─┤ . ├─┫ HEADER-HASH ┣─╼ ┗━━━━━━━━━━━━━┛ ╰───╯ ┗━━━━━━━━━━━━━┛ ┏━━━━━━━━━━━┓ HEADER-HASH = ╾─┫ 64 HEXDIG ┣───────────────────╼ ┗━━━━━━━━━━━┛ ┏━━━━━━━━━━┓ SLOT-NUMBER = ╾─┫ 1* DIGIT ┣────────────────────╼ ┗━━━━━━━━━━┛ ``` For example: `5999990.dca1e44765b9f80c8b18105e17de90d4a07e4d5a83de533e53fee32e0502d17e`
- `created_before` union
  - integer — Only fetch results that were created at and before the given slot.
  - string — Only fetch results that were created at and before the given point. This fails if the provided point doesn't exist. It is handy to fetch a collection of results by pages while ensuring that the collection isn't being altered to due alternative chain forks being adopted. The last known fetch point can be used as starting point for the next range. Points are defined in the usual format (same as the command-line): ``` ┏━━━━━━━━━━━━━┓ ╭───╮ ┏━━━━━━━━━━━━━┓ POINT = ╾─┫ SLOT-NUMBER ┣─┤ . ├─┫ HEADER-HASH ┣─╼ ┗━━━━━━━━━━━━━┛ ╰───╯ ┗━━━━━━━━━━━━━┛ ┏━━━━━━━━━━━┓ HEADER-HASH = ╾─┫ 64 HEXDIG ┣───────────────────╼ ┗━━━━━━━━━━━┛ ┏━━━━━━━━━━┓ SLOT-NUMBER = ╾─┫ 1* DIGIT ┣────────────────────╼ ┗━━━━━━━━━━┛ ``` For example: `5999990.dca1e44765b9f80c8b18105e17de90d4a07e4d5a83de533e53fee32e0502d17e`
- `spent_before` union
  - integer — Only fetch results that were spent at and before the given slot.
  - string — Only fetch results that were spent at and before the given point. This fails if the provided point doesn't exist. It is handy to fetch a collection of results by pages while ensuring that the collection isn't being altered to due alternative chain forks being adopted. The last known fetch point can be used as starting point for the next range. Points are defined in the usual format (same as the command-line): ``` ┏━━━━━━━━━━━━━┓ ╭───╮ ┏━━━━━━━━━━━━━┓ POINT = ╾─┫ SLOT-NUMBER ┣─┤ . ├─┫ HEADER-HASH ┣─╼ ┗━━━━━━━━━━━━━┛ ╰───╯ ┗━━━━━━━━━━━━━┛ ┏━━━━━━━━━━━┓ HEADER-HASH = ╾─┫ 64 HEXDIG ┣───────────────────╼ ┗━━━━━━━━━━━┛ ┏━━━━━━━━━━┓ SLOT-NUMBER = ╾─┫ 1* DIGIT ┣────────────────────╼ ┗━━━━━━━━━━┛ ``` For example: `5999990.dca1e44765b9f80c8b18105e17de90d4a07e4d5a83de533e53fee32e0502d17e`
- `policy_id` string
- `asset_name` string
- `transaction_id` string — A blake2b-256 hash digest of a transaction body.
- `output_index` integer — Restrict results to a particular output index of a transaction. This parameter can't be used alone and must be provided alongside a `transaction_id`.

## Response `200`

OK

## Other responses

- `304` — Not Modified Returned when a `If-None-Match` request header matches the current `ETag` for the response. This is meant to provide efficient caching and polling. The `ETag` corresponds to the most recent block header hash processed by Kupo.
- `400` — Bad Request

---

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