# Pagination

Every response includes a `next` field - a ready-made relative URL for the next page. You never build paging parameters yourself.

## The loop

1. Send your first request.
2. Fetch the results from the `records` array.
3. Append `next` to `https://api.webz.io` and call it.
4. Repeat until `moreResultsAvailable` reaches `0` or `next` is `null`.

```json
{
  "records": [ ... ],
  "next": "/nhi?token=YOUR_TOKEN&domain=example.com&next=CURSOR",
  "moreResultsAvailable": 5
}
```

The cursor encodes the sort position and the result count, so keep `sort_by`, `order_by`, and filters unchanged while paging a result set. A cursor from a different query returns `400`.

> [!WARNING]
> Each page is a new request and consumes a credit - including a request that returns 0 records. See [Errors, Rate Limits & Credits](nhi-errors-limits).
