> For the complete documentation index, see [llms.txt](https://docs.underdogprotocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.underdogprotocol.com/guides/pagination.md).

# Pagination

By default, all responses limit results to ten. However, you can go as high as 100 by adding a `limit` parameter to your requests.

When an API response returns a list of objects, no matter the amount, pagination is supported. In paginated responses, objects are nested in a `results` attribute and include four attributes to determine whether you have reach the end of the last page.&#x20;

* `limit`
* `page`
* `totalPages`
* `totalResults`

You can use the `limit` and `page` query parameters to browse pages.

## Example using cursors

In this example, we request the first page with at most one result. As a result, we get a list of one Collection and can tell by the `totalResults` and `totalPages` attributes that we have one more page of results.&#x20;

`limit` integer

Limit the number of items returned.

`page` integer

The page number to return.&#x20;

{% code title="Manual pagination using cURL" %}

```bash
curl "https://api.underdogprotocol.com/v1/collections?limit=1&page=1" \
        -H "Authorization: Bearer {token}"
```

{% endcode %}

{% code title="Paginated response" %}

```json
{
    "results":[{
        "mintAddress":"FrvZAJ1qZ2vhV17nFdEmw66N3FW5QiHFt6HdqsEh8QNq",
        "name":"NBA",
        "description":"",
        "image":"https://arweave.net/57PrJ_-S-m2BXOSkaUN2t5ibsjbSrCjElSVUQXXyCq0",
        "attributes":[],
        "uri":"https://arweave.net/DnftYIM2sNZQBXm7qzRiFoUP0S7QtN4q_GkmIcv1UJ8",
        "collectionDetails":{},
        "ownerAddress":"EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp"
    }],
    "page": 1,
    "limit": 1,
    "totalPages": 1,
    "totalResults": 2
}
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.underdogprotocol.com/guides/pagination.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
