# Cursor Pagination

Some of our endpoints provide cursor-based pagination. A cursor is a random string which points to a specific item in a list of data. A string pointed to an element can be changed in future. Therefore, your app should not store cursors.

```bash
curl "https://graph.whisk.com/v1/products/autocomplete?language=en&limit=5&after=eyJpZCI6IlBPUksgQkFCWSBCQUNLIFJJQiIsImluZGV4Ijo5fQ==" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <Access-Token>"
```

A result will contain segment with pagination which includes cursors to the first and the last item in the result. Reference will be empty if there are no elements before or after cursor.

Example of a segment with cursors:

```javascript
{
  "after": "eyJpZCI6IkNISUEgU0VFRFMiLCJpbmRleCI6MTR9",
  "before": "eyJpZCI6IkdSQU5PTEEiLCJpbmRleCI6MTB9"
}
```

###

### FinitePaging

| ATTRIBUTE | TYPE    | DESCRIPTION |
| --------- | ------- | ----------- |
| cursors\* | Cursors |             |
| total\*   | integer |             |

### Cursors

| ATTRIBUTE | TYPE   | DESCRIPTION |
| --------- | ------ | ----------- |
| after     | string |             |
| before    | string |             |
|           |        |             |


---

# 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.whisk.com/resources/cursor-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.
