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

# Searching

> Search for data

## Overview

Some endpoints will have a query parameter called `search` *(array\[\[string]])* which allows you to specify multiple search terms. These terms will be combined using an **AND** operator. At the moment, there is no support for other logical operators.

An API endpoint that supports searching will specify in its documentation which fields are searchable. The description will list all the fields that can be used with the search parameter, such as 'email', 'phone', 'name', etc.

This **GET** Contacts endpoint supports searching for *email*, *phone*, and *name*.

## Syntax

The basic syntax for a search term is:

```plaintext theme={"dark"}
search=\[field name\]\[operator\]\[value\]
```

The following operators are supported:

| Operator | Description           |
| -------- | --------------------- |
| :        | Equals                |
| :!       | Not equal to          |
| :>       | Greater than          |
| :>=      | Greater than or equal |
| :\<      | Less than             |
| :\<=     | Less than or equal    |

#### Wildcards

When searching for string values, the wildcard character `*` can be used:

| Example term | Description                                               |
| ------------ | --------------------------------------------------------- |
| john\*       | Will search the field for values *starting* with 'john'   |
| \*john       | Will search the field for values *ending* with 'john'     |
| \*john\*     | Will search the field for values *containing* with 'john' |

<Info>
  All string searches are case insensitive so searching for 'john' will also match with 'John'
</Info>

#### Examples

If you wanted to search for a contact whose name contains 'Steele' the query would be:

```plaintext theme={"dark"}
GET ./contacts?search=name:\*Steele\*
```

If you wanted to find results where the name contains 'Steele' but not 'Hunter' the query would be:

```plaintext theme={"dark"}
GET ./contacts?search=name:\*Steele\*&search=name:!\*Hunter\*
```

<Info>
  The search terms are combined with the AND operator by default and can not be changed at this time.
</Info>
