# Paginate results (https://developer.godaddy.com/en/docs/api-users/pagination)



## Overview

List endpoints return paginated results using cursor-based pagination. Use pagination to walk large result sets without hitting [rate limits](https://developer.godaddy.com/docs/api-users/rate-limits) from parallel requests. The most common paginated endpoint is [list domains](https://developer.godaddy.com/docs/api-users/manage-domains/list).

## v1 cursor pagination

`GET /v1/domains` accepts two pagination query parameters:

| Parameter | Default        | Description                                     | Note                                                          |
| --------- | -------------- | ----------------------------------------------- | ------------------------------------------------------------- |
| `limit`   | Server default | Maximum number of items to return in this page. |                                                               |
| `marker`  | None           | Cursor pointing to the start of the next page.  | Set to the last item's identifier from the previous response. |

To page through all results, repeat the request with `marker` set to the last item's domain name from the previous page until the response array is shorter than `limit`.

```bash
# First page
curl -s "https://api.godaddy.com/v1/domains?limit=100" \
  -H "Authorization: Bearer $GODADDY_PAT"

# Subsequent pages — marker is the last domain from the previous page
curl -s "https://api.godaddy.com/v1/domains?limit=100&marker=last-domain-from-previous-page.com" \
  -H "Authorization: Bearer $GODADDY_PAT"
```

### Looping example

This pattern walks every page until the response is shorter than `limit`:

```js
const PAGE_SIZE = 100;
let marker = "";
const all = [];

while (true) {
  const url = new URL("https://api.godaddy.com/v1/domains");
  url.searchParams.set("limit", PAGE_SIZE);
  if (marker) url.searchParams.set("marker", marker);

  const res = await fetch(url, {
    headers: {
      Authorization: "Bearer " + process.env.GODADDY_PAT,
    },
  });
  const page = await res.json();
  all.push(...page);

  if (page.length < PAGE_SIZE) break; // last page
  marker = page[page.length - 1].domain;
}
```

## v2 list endpoints

v2 list endpoints (for example, domain forwarding lists, action lists) return the full collection in a single response and do not support `limit` or `marker` parameters.

## Pagination and retries

Cursor pagination is safe to interrupt and resume. The `marker` value remains valid as long as the underlying domain still exists in the account. If a request fails mid-walk, retry the same `(limit, marker)` pair.
