# How to use pagination

Many of the endpoints are paged. This means that sequential requests are required, each one specifying a different page number, to retrieve all the available data. Pagination ensures that the volume of the data returned in the response does not overwhelm the Sesame Data servers, or your own servers.&#x20;

{% hint style="info" %}
**Sending a request without pagination will cause partial data to be retrieved.**&#x20;
{% endhint %}

Sesame Data pagination endpoints are Zero index-based, which means the first page is `0` and the second page is `1`.&#x20;

While doing an integration, users will need to use the below metadata fields to ensure that all elements in the response are retrieved:

* `totalElements`: The total number of items in the response
* `size`: The number of records per page of the response

Alternatively, it's possible to wrap the calls inside a `While loop`  that keep requesting pages until the parameter `last` is equals to `true`.

```
{
   "content": [ /*DATA HERE*/ ]
   "totalPages": 3,
   "totalElements": 270,
   "last": false,
   "size": 100,
   "first": true,
   "number": 0,
   "numberOfElements": 100,
   "empty": false
}
```


---

# 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.landytech.com/tutorials-recipes/how-to-use-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.
