Skip to content

Pagination

List endpoints use page-number pagination.

ParameterTypeDefaultAllowed
pageinteger1>= 1
per_pageinteger251–100
Terminal window
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $NUELINK_API_KEY" \
-H "Accept: application/json" \
"https://app.nuelink.com/api/public/v1/brands?page=2&per_page=25"
{
"status": "success",
"data": [],
"pagination": {
"currentPage": 2,
"perPage": 25,
"total": 82,
"lastPage": 4,
"nextPageUrl": "https://app.nuelink.com/api/public/v1/brands?page=3",
"prevPageUrl": "https://app.nuelink.com/api/public/v1/brands?page=1"
}
}

Use currentPage < lastPage, or nextPageUrl != null, to decide whether another page exists.

GET /schedule is the one read that isn’t paginated: it returns the whole week in one response.

Keep your filters and page size on each request, and stop on nextPageUrl.

The example reads the base URL from the environment, the same way the Quick Start sets it up:

Terminal window
export NUELINK_API_BASE="https://app.nuelink.com/api/public/v1"
const base = process.env.NUELINK_API_BASE;
const apiKey = process.env.NUELINK_API_KEY;
async function listAll(pathname, params = {}) {
const items = [];
let page = 1;
for (;;) {
const qs = new URLSearchParams({ ...params, page: String(page), per_page: '100' });
const response = await fetch(`${base}${pathname}?${qs}`, {
headers: { Authorization: `Bearer ${apiKey}`, Accept: 'application/json' },
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
const body = await response.json();
items.push(...body.data);
if (body.pagination.nextPageUrl === null) return items;
page += 1;
}
}

Two things this guards against. per_page: 100 keeps the request count down, which matters against the 30-per-minute resource limit. And stopping on nextPageUrl rather than on a short page is the only correct termination test.

Post lists also take server-side filters such as view, status, and created_from, so you can often fetch one filtered page instead of walking everything. See Endpoints.

The page-size parameter is spelled three ways

Section titled “The page-size parameter is spelled three ways”
SurfacePage-size name
REST APIper_page
MCPperPage
CLI--per-page

The REST API uses snake_case throughout its paths and query strings; the MCP tools use camelCase and the server translates. If you’re moving code between surfaces, this is the first thing to check.