Pagination
List endpoints use page-number pagination.
| Parameter | Type | Default | Allowed |
|---|---|---|---|
page | integer | 1 | >= 1 |
per_page | integer | 25 | 1–100 |
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"const apiKey = process.env.NUELINK_API_KEY;
const response = await fetch('https://app.nuelink.com/api/public/v1/brands?page=2&per_page=25', { headers: { Authorization: `Bearer ${apiKey}`, Accept: 'application/json', },});
if (!response.ok) { throw new Error(`HTTP ${response.status}: ${await response.text()}`);}
const data = await response.json();console.log(data);<?php
$apiKey = getenv('NUELINK_API_KEY');
$ch = curl_init('https://app.nuelink.com/api/public/v1/brands?page=2&per_page=25');
curl_setopt_array($ch, [ CURLOPT_HTTPHEADER => [ "Authorization: Bearer {$apiKey}", 'Accept: application/json', ], CURLOPT_RETURNTRANSFER => true,]);
$response = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);curl_close($ch);
if ($status >= 400) { throw new RuntimeException("HTTP {$status}: {$response}");}
echo $response;Response shape
Section titled “Response shape”{ "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.
Walking every page
Section titled “Walking every page”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:
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”| Surface | Page-size name |
|---|---|
| REST API | per_page |
| MCP | perPage |
| 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.