> For a complete page index of the Captain API documentation, fetch https://docs.captain.dev/llms.txt?excludeSpec=true

# List Filters

GET https://acme.captain.dev/v1/indexes/{index}/filters

List the fields a search can filter on, with the operators each accepts, and whether each can be faceted, sorted or grouped.

Reference: https://docs.captain.dev/reference/product-search/indexes/list-filters

## Authentication

- `Authorization` header (bearer token, required) — A search key, issued by Captain. Sent as Authorization: Bearer \<key>.
- `Authorization` header (bearer token, required) — A scoped key for one end user, minted from an issuer key that Captain issues. Sent as Authorization: Bearer \<key>.

## Request

### Path parameters

- `index` (string, required) — index name

## Response

### 200

fields

- `fields` (list of V1IndexesIndexFiltersGetResponsesContentApplicationJsonSchemaFieldsItems, required)

## Types

### V1IndexesIndexFiltersGetResponsesContentApplicationJsonSchemaFieldsItems

- `name` (string, required) — the field; a children field is \<children>.\<field> (ANY child matches)
- `type` (string, required) — keyword, enum, identifier, number, date, geo, bool, text or url
- `filter` (boolean, required) — the field can be named in a filter
- `operators` (list of enum, required) — the filter operators this field accepts, as the filter parser checks them: number and date take all but WITHIN; keyword, enum, identifier, text and bool take = != IN NOT IN EXISTS; geo takes WITHIN and EXISTS. Empty when filter is false. On an index without typed fields: = and IN, through the filters object
  - Allowed values: `=`, `!=`, `<`, `<=`, `>`, `>=`, `BETWEEN`, `IN`, `NOT IN`, `WITHIN`, `EXISTS`
- `facet` (boolean, required)
- `sort` (boolean, required)
- `group` (boolean, required) — can be group_by.field
- `unit` (string, optional) — present when the field has one, such as usd or lb

## Examples

**Response**

```json
{
  "fields": [
    {
      "name": "brand",
      "type": "keyword",
      "filter": true,
      "operators": [
        "=",
        "!=",
        "IN",
        "NOT IN",
        "EXISTS"
      ],
      "facet": true,
      "sort": false,
      "group": true
    },
    {
      "name": "category",
      "type": "keyword",
      "filter": true,
      "operators": [
        "=",
        "!=",
        "IN",
        "NOT IN",
        "EXISTS"
      ],
      "facet": true,
      "sort": false,
      "group": false
    },
    {
      "name": "price",
      "type": "number",
      "filter": true,
      "operators": [
        "=",
        "!=",
        "<",
        "<=",
        ">",
        ">=",
        "BETWEEN",
        "IN",
        "NOT IN",
        "EXISTS"
      ],
      "facet": true,
      "sort": true,
      "group": false,
      "unit": "usd"
    },
    {
      "name": "in_stock",
      "type": "bool",
      "filter": true,
      "operators": [
        "=",
        "!=",
        "EXISTS"
      ],
      "facet": false,
      "sort": false,
      "group": false
    }
  ]
}
```

**SDK Code**

```python Python REST
import json
import requests

BASE_URL = "https://acme.captain.dev"
API_KEY = "your_search_key"
INDEX = "products"

headers = {
    "Authorization": f"Bearer {API_KEY}",
}

response = requests.get(
    f"{BASE_URL}/v1/indexes/{INDEX}/filters",
    headers=headers,
    timeout=30.0,
)

print(json.dumps(response.json(), indent=2))
```

```typescript TypeScript REST
const BASE_URL = "https://acme.captain.dev";
const API_KEY = "your_search_key";
const index = "products";

const response = await fetch(`${BASE_URL}/v1/indexes/${index}/filters`, {
  method: "GET",
  headers: {
    Authorization: `Bearer ${API_KEY}`,
  },
});

const result = await response.json();
console.log(JSON.stringify(result, null, 2));
```