# Pagination

All results returned are paginated by default.&#x20;

```javascript
{
    "meta": {
        "next": "xqErdcgltHGs",
        "previous": null,
        "total_count": 39
    },
    "results": [
        {
            "created_at": "2021-05-06T07:00:21Z",
            "description": "Test",
            "favorite": false,
            "id": "f2eb2dab-a861-4960-b5f4-d54c61552f7d",
            "name": "Test project",
            "self": "http://localhost:4000/api/v1/projects/f2eb2dab-a861-4960-b5f4-d54c61552f7d",
            "templates": "http://localhost:4000/api/v1/projects/f2eb2dab-a861-4960-b5f4-d54c61552f7d/templates",
            "updated_at": "2021-05-06T07:00:21Z"
        },
        ...
    ]
}
```

`meta` field contains the pagination metadata and `result` field contains the limited result set.

### Querying for next set of result

Append `after` query string with the value from `next` metadata field.

```javascript
https://api.usestencil.com/v1/projects?after=xqErdcgltHGs
```

### Querying for previous set of result

Append `before` query string with the value from `previous` metadata field.

```javascript
https://api.usestencil.com/v1/projects?before=xqErdcgltHGs
```

### Limiting result

Append `limit=<integer>` to limit the results set

```javascript
https://api.usestencil.com/v1/projects?limit=10
```

{% hint style="info" %}
You can combine `limit` with either `after` and `before`
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usestencil.com/api/pagination.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
