> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blnkfinance.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Filtering Results

> Learn how to use the filter_by parameter to refine search results with precise conditions

## Overview

The `filter_by` parameter refines your search results based on specific field values. Use filters to narrow down large datasets and find exactly what you're looking for.

Filters work with any search query, including the wildcard `*`, and support various operators for different data types.

***

## Quick start

Here's a basic filter that demonstrates the most common pattern:

<CodeGroup>
  ```bash cURL theme={"system"}
  curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
    -H "X-Blnk-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "q": "*",
      "filter_by": "status:=APPLIED && currency:=USD"
    }'
  ```

  ```json Response theme={"system"}
  {
    "found": 15,
    "hits": [
      {
        "document": {
          "amount": 1500,
          "currency": "USD",
          "status": "APPLIED",
          "created_at": 1720363463,
          "source": "bln_28f25ef6-2e0d-4fa6-891c-37fc409d654e",
          "destination": "bln_86ba7976-499d-4282-955e-a7c2abf5db12"
        }
      }
    ]
  }
  ```
</CodeGroup>

***

## Filter operators

### Exact match (`:=`)

Match field values exactly:

```bash theme={"system"}
curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
  -H "X-Blnk-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "*",
    "filter_by": "status:=APPLIED && currency:=USD"
  }'
```

### Partial match (`:`)

Match fields containing the value:

```bash theme={"system"}
curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
  -H "X-Blnk-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "*",
    "filter_by": "description:payment && reference:ref_001"
  }'
```

### Comparison operators

Compare numeric values and dates:

| Operator | Meaning               | Example                  |
| :------- | :-------------------- | :----------------------- |
| `>`      | Greater than          | `amount:>1000`           |
| `>=`     | Greater than or equal | `balance:>=5000`         |
| `<`      | Less than             | `created_at:<1720396800` |
| `<=`     | Less than or equal    | `balance:<=50000`        |

```bash theme={"system"}
curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
  -H "X-Blnk-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "*",
    "filter_by": "amount:>1000 && balance:<=50000"
  }'
```

### Range operator (`[min..max]`)

Filter values within a range:

```bash theme={"system"}
curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/balances" \
  -H "X-Blnk-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "*",
    "filter_by": "balance:[1000..50000] && created_at:[1720310400..1720396800]"
  }'
```

<Info>
  Use Unix timestamps for date ranges. The example above filters for July 7-8, 2024.
</Info>

### IN operator (`[value1, value2]`)

Match any value from a list:

```bash theme={"system"}
curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
  -H "X-Blnk-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "*",
    "filter_by": "status:[APPLIED, INFLIGHT] && currency:[USD, EUR]"
  }'
```

### AND operator (`&&`)

Combine multiple conditions where ALL must be true:

```bash theme={"system"}
curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
  -H "X-Blnk-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "*",
    "filter_by": "status:=APPLIED && currency:=USD && amount:>1000"
  }'
```

### Partial match (`:`)

Match fields containing the value:

```bash theme={"system"}
curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
  -H "X-Blnk-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "*",
    "filter_by": "description:payment && reference:ref_001"
  }'
```

### Not equal (`:!=`)

Exclude specific values:

```bash theme={"system"}
curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
  -H "X-Blnk-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "*",
    "filter_by": "currency:!=USD && status:!=REJECTED"
  }'
```

***

## Common patterns

<Steps>
  <Step title="Filter by transaction status">
    Find all successful and pending transactions.

    ```bash theme={"system"}
    curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
      -H "X-Blnk-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "q": "*",
        "filter_by": "status:[APPLIED, INFLIGHT]"
      }'
    ```
  </Step>

  <Step title="Filter transactions by amount range">
    Find USD transactions between \$1,000 and \$10,000.

    ```bash theme={"system"}
    curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
      -H "X-Blnk-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "q": "*",
        "filter_by": "amount:[1000..10000] && currency:=USD"
      }'
    ```
  </Step>

  <Step title="Filter by creation date">
    Find transactions created within a specific date range using Unix timestamps.

    ```bash theme={"system"}
    curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/transactions" \
      -H "X-Blnk-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "q": "*",
        "filter_by": "created_at:[1720310400..1720396800]"
      }'
    ```
  </Step>

  <Step title="Filter by multiple currencies">
    Find balances in major currencies with positive amounts.

    ```bash theme={"system"}
    curl -X POST "http://YOUR_BLNK_INSTANCE_URL/search/balances" \
      -H "X-Blnk-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "q": "*",
        "filter_by": "currency:[USD, EUR, GBP] && balance:>0"
      }'
    ```
  </Step>
</Steps>

***

## Best practices

* **Use exact matches** (`:=`) for IDs, statuses, and currencies
* **Combine with AND** (`&&`) for precise filtering
* **Use ranges** for amounts and dates instead of multiple comparisons
* **Test complex filters** with simple queries first

***

## Need help?

We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool.

To ask questions or discuss issues, please [contact us](mailto:support@blnkfinance.com) or [join our Discord community](https://discord.gg/7WNv94zPpx).

***

<Tip>
  **Tip:** Connect to Blnk Cloud to see your Core data.

  You can view your transactions, manage identities, create custom reports, invite other team members to collaborate, and perform operations on your Core — all in one dashboard.

  [Check out Blnk Cloud →](https://www.blnkfinance.com/products/cloud)
</Tip>
