Skip to content
42 changes: 39 additions & 3 deletions content/guides/04.connect/3.query-parameters.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
stableId: 2627d8eb-784f-4197-8d66-f180347d1b4d
title: Query Parameters
description: Learn about Directus query parameters - fields, filter, search, sort, limit, offset, page, aggregate, groupBy, deep, alias, and export. Understand how to customize your API requests and retrieve specific data from your collections.
description: Learn about Directus query parameters - fields, filter, search, sort, limit, offset, page, aggregate, groupBy, deep, alias, export, version, versionRaw, backlink, and meta. Understand how to customize your API requests and retrieve specific data from your collections.
---

Most Directus API endpoints can use global query parameters to alter the data that is returned.
Expand Down Expand Up @@ -554,10 +554,15 @@ Note that it is not possible to use aliases on relational fields e.g. `alias[aut

Saves the API response to a file. Valid values are `csv`, `json`, `xml`, `yaml`.

```http [GET /items/posts]
?export=type
::code-group

```http [REST]
GET /items/posts
?export=csv
```

::

## Version

Queries a version of a record by version key when [content versioning](/guides/content/content-versioning) is enabled on a collection.
Expand Down Expand Up @@ -808,3 +813,34 @@ The articles collection consists of a many-to-one relation to Users called `auth
```

::

## Meta

Returns metadata about the result set alongside the requested data. Accepts `total_count`, `filter_count`, a comma-separated combination of the two, or `*` for both.

| Value | Description |
| -------------- | --------------------------------------------------------- |
| `total_count` | Total number of items in the collection, ignoring filters |
| `filter_count` | Number of items matching the current filter/search |

::code-group

```http [REST]
GET /items/posts
?meta=total_count,filter_count
```

```graphql [GraphQL]
# Not available. Use the collection's aggregated query instead:
query {
posts_aggregated {
countAll
}
}
```

```js [SDK]
// Not yet supported by the SDK: https://github.com/directus/directus/issues/22640
```

::
Loading