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

# Pagination

> Every list is newest first, in pages, with a cursor.

Every list endpoint answers the same way:

```json theme={null}
{
  "data": [{ "id": "rul_01j9…", "key": "morning-regular" }],
  "has_more": true,
  "next_cursor": "eyJ…"
}
```

* `limit` is how many items to return: 1 to 200, 50 if you leave it out.
* `cursor` is the `next_cursor` of the page before. Leave it out for the first page.
* `has_more` says whether there are older items, and `next_cursor` is `null` on the last page.
* A cursor is opaque. Do not build one or read one.
* Some lists also count: for example `GET /v1/users?include=total` adds `total`, how many match across every page. It is only made when you ask.

Most lists are newest first. Items made while you page may appear on a page you already read; do not rely on "everything, exactly once" for a list that is changing.

```bash curl theme={null}
curl "https://api.getlurk.com/v1/rules?status=live&limit=100" -H "Authorization: Bearer $LURK_KEY"
curl "https://api.getlurk.com/v1/rules?status=live&limit=100&cursor=eyJ…" -H "Authorization: Bearer $LURK_KEY"
```

```typescript TypeScript theme={null}
import { Lurk, paginate } from "@getlurk/sdk";

const lurk = new Lurk();

for await (const rule of paginate(lurk.rules.list, { status: "live" })) {
  console.log(rule.key);
}
```

```python Python theme={null}
from getlurk import Lurk

lurk = Lurk()

for rule in lurk.paginate("rules.list", {"status": "live"}):
    print(rule["key"])
```

The helpers ask for the next page only when your loop wants it, and stop when `has_more` is false. They pass your options (a cancel signal, a timeout) to every page.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.