> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hypastack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination

> Cursor-based pagination for list endpoints.

Lists are paged with a cursor. Ask for up to 100 at a time; the response tells you whether there's more and how to get it. There are no page numbers or offsets, because rows created while you page would make those skip or repeat items.

```js theme={null}
let cursor = null

do {
  const url = new URL("https://api.hypastack.com/v3/files")
  url.searchParams.set("limit", "100")
  if (cursor) url.searchParams.set("cursor", cursor)

  const res = await fetch(url, {
    headers: { authorization: `Bearer ${process.env.HYPASTACK_API_KEY}` },
  })
  const page = await res.json()

  for (const file of page.data) console.log(file.name)
  cursor = page.next_cursor
} while (cursor)
```

| Param    | Type    | Description                                                      |
| -------- | ------- | ---------------------------------------------------------------- |
| `limit`  | integer | How many to return. Default 50, maximum 100.                     |
| `cursor` | string  | The `next_cursor` from a previous page. Omit for the first page. |
