# Paginated queries

In this section, you'll see how to paginate queries:

> You can try this directly in our [**alphanet indexer's playground**](https://indexer-alphanet.ternoa.dev/) or our [**mainnet indexer's playground**](https://indexer-mainnet.ternoa.network/)

You can paginate all the requests using regular “first” and “offset” parameters. Here is an example with the first basic query:

### Query paginated NFTs (first page)

```graphql
query {
	nftEntities(
		filter: { listedForSale: { equalTo: true } }
		first: 10
		offset: 0
	) {
		totalCount
		nodes {
			nftId
			owner
			collectionId
			offchainData
		}
	}
}
```

This request fetches the first page with 10 items. For the next page you need to put an offset. For example in our case, we add an offset of 10 to get the next 10 NFTs listed.

### Query paginated NFTs (second page)

```graphql
query {
	nftEntities(
		filter: { listedForSale: { equalTo: true } }
		first: 10
		offset: 10
	) {
		totalCount
		nodes {
			nftId
			owner
			collectionId
			offchainData
		}
	}
}
```

### Query paginated NFTs (third page)

Again to get the third page, you need to **increase** the offset. Here we increase by 10 (20 in total) to get the next 10 NFTs listed.

```graphql
query {
	nftEntities(
		filter: { listedForSale: { equalTo: true } }
		first: 10
		offset: 20
	) {
		totalCount
		nodes {
			nftId
			owner
			collectionId
			offchainData
		}
	}
}
```


---

# 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.ternoa.network/build-1/javascript/indexer/global-requests/paginated-queries.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.
