Paginate results
View as MarkdownCursor-based pagination on v1 list endpoints with limit and marker.
Overview
List endpoints return paginated results using cursor-based pagination. Use pagination to walk large result sets without hitting rate limits from parallel requests. The most common paginated endpoint is list domains.
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.
# 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:
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.
Agent & Automation Notes
Any scope that allows list operations — e.g. domains.domain:read for GET /v1/domainsRelated
Concepts
Last updated on
How is this guide?