# Querying Data (Filtering & Sorting)

> Pagination parameters, sorting directives, field equality filters, and batch ID retrieval.

- **Category:** REST API
- **Canonical Guide:** https://pottr.tangble.com/docs/querying-data

---

>
Pagination parameters, sorting directives, field equality filters, and batch ID retrieval.

## Query Parameters Reference

<table class="docs-table">
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>`limit`</td>
<td>Integer</td>
<td>`20`</td>
<td>Number of entries to return. Maximum value is `100`.</td>
</tr>
<tr>
<td>`offset`</td>
<td>Integer</td>
<td>`0`</td>
<td>Number of entries to skip for pagination.</td>
</tr>
<tr>
<td>`order_by`</td>
<td>String</td>
<td>`created_at`</td>
<td>Sort field: `created_at`, `updated_at`, or any custom schema field key.</td>
</tr>
<tr>
<td>`order`</td>
<td>String</td>
<td>`DESC`</td>
<td>Sort direction: `ASC` (ascending) or `DESC` (descending).</td>
</tr>
<tr>
<td>`filter[key]`</td>
<td>String</td>
<td>—</td>
<td>Equality filter on any schema field (e.g. `filter[status]=active`). The long form `filter[status][value]=active` is equivalent. Unknown field keys are ignored.</td>
</tr>
<tr>
<td>`where[key]`</td>
<td>String</td>
<td>—</td>
<td>Alias for `filter[key]`.</td>
</tr>
<tr>
<td>`format`</td>
<td>String</td>
<td>—</td>
<td>`standard` returns the uniform response envelope. See [API Overview](/pottr/docs/api-overview).</td>
</tr>
<tr>
<td>`ids`</td>
<td>String</td>
<td>—</td>
<td>Comma-separated list of entry IDs to fetch directly (e.g. `?ids=1,2,5`).</td>
</tr>
<tr>
<td>`expand`</td>
<td>String</td>
<td>—</td>
<td>Relation field key. The related entry is inlined one level deep; deeper relations are not followed.</td>
</tr>
</tbody>
</table>

## Filtering Examples

Multiple filters combine automatically with boolean `AND`. A bare field query such as `?status=active` also works as a filter, as long as the name is not a reserved parameter (`limit`, `offset`, `order_by`, `order`, `expand`, `ids`, `filter`, `where`, `format`):

**File: `cURL Query Example`**

```bash
# Filter active projects, sorted by updated date, page 2:
curl -H "Authorization: Bearer pk_live_..." \
  "https://example.com/wp-json/pottr/v1/collections/project?filter\[status\]=active&filter\[category\]=design&order_by=updated_at&order=DESC&limit=10&offset=10"
```

## Batch ID Lookups

To fetch specific entries without manual iterative loops, pass `?ids=101,102,105`. Batch queries maintain full row-level security for user-owned collections.
