# Pagination & filtering

> Narrow, page through, and project Shoplazza CLI result sets using search filter flags, paging flags, the --fields projection, and jq expressions.

How to narrow, page through, and project result sets across Shoplazza CLI commands.

## Filtering with shortcuts

Search shortcuts accept named filter flags. For example, `customers +search`:

```shell
shoplazza customers +search --email test@example.com
shoplazza customers +search --since 2026-01-01 --until 2026-01-31
```

Each domain exposes its own filters — run `shoplazza <topic> +search --help` to see them. Discover what a leaf command accepts with schema introspection:

```shell
shoplazza schema orders.list --view request
```

## Paging

Shortcuts use page-size flags where supported:

```shell
shoplazza customers +search --page-limit 50
```

Some API and app commands use offset/limit instead:

```shell
shoplazza app versions --offset 0 --limit 20
```

Always check whether a response reports more pages before assuming a list is complete, and page until it is exhausted.

## Projecting fields

Trim output columns with `--fields` (shortcuts) and pair it with `--format table`:

```shell
shoplazza orders +search --fields "id,status,total_price" --format table
```

## Filtering output with --jq

Post-filter any JSON output with a jq expression:

```shell
# IDs only
shoplazza products list --jq '.data.products[].id'

# Selected fields
shoplazza orders list --jq '.data.orders[] | {id, status, total_price}'

# Count
shoplazza products list --jq '.data.products | length'
```

`--fields` limits what the API returns; `--jq` transforms what you already received. Use `--fields` to reduce payload, `--jq` to reshape it.

## See also

* [Output formats](./output-formats)
* [Shortcuts](./shortcuts)
* [schema command](../commands/schema)
