# Pagination and sorting

`pg[limit]`

Defines the maximum number of results to return. For example, `pg[limit]=100`. The default value varies with different resources.

`pg[offset]`

Defines the number of results you want to skip before getting the results you need. For example, `pg[offset]=10`. The default value for most endpoints is `0`.

`pg[sortBy]`

Defines the property by which to sort results. For example, `pg[sortBy]=id`. By default, results are usually sorted by `name` or `id`.

`pg[sortDir]`

Defines the sorting order. Use `asc` for ascending order, use `desc` for descending order. The default ordering direction is usually ascending.

**Example:**

Let’s say we want to retrieve data stores that belong to the team with ID 212.

{% stepper %}
{% step %}
The request URL with the default pagination settings looks as follows:

```
{zone_url}/api/v2/data-stores?teamId=212
```

Where `zone_url` is the URL of your Make zone. For example: `https://eu1.make.com`
{% endstep %}

{% step %}
Add the pagination parameters.

In this case, we want to skip the first 10 results, limit the results to 50 data stores and sort them in ascending order. Use the following query parameters:

```
&pg%5Boffset%5D=10&pg%5BsortDir%5D=asc&pg%5Blimit%5D=50
```

{% endstep %}

{% step %}
The full request URL looks like this:

```
{base_url}/data-stores?teamId=212&pg%5Boffset%5D=10&pg%5BsortDir%5D=asc&pg%5Blimit%5D=50
```

Where `base_url` is `https://eu1.make.com/api/v2`
{% endstep %}
{% endstepper %}
