# Categories

> List the category facets of your catalog

- Page: https://tbit.app/docs/api/categories
- Base URL: `https://rest-api.tbit.app/v1`
- Authentication: `X-API-Key` header with your key on every request (the examples read it from the `TBIT_API_KEY` environment variable)

## Overview

Categories are facets derived from the category_tags of your active products. Each category includes the number of products tagged with it. Use the category name as the tag parameter when listing products.

## Endpoints

| Method | Path | Description |
| --- | --- | --- |
| `GET` | `/v1/categories` | List category facets |

## List Categories

`GET /v1/categories`

```bash
curl "https://rest-api.tbit.app/v1/categories" \
  -H "X-API-Key: $TBIT_API_KEY"
```

## Response Format

Categories with their product counts, plus the total number of active items in the catalog:

```json
{
  "data": {
    "categories": [
      { "name": "fiestas", "count": 42 },
      { "name": "infantil", "count": 27 },
      { "name": "decoracion", "count": 18 }
    ],
    "total_items": 134
  }
}
```
