Pagination and filters
Lists come in pages, and feeds are read in order with a cursor.
Lists#
Lists take ?limit= and ?offset=, and answer { "data": […], "meta": {…} }.
# The second page of 50 links
curl "https://api.yourbrand.com/api/links?limit=50&offset=50" -H 'Authorization: Bearer nl_live_…' Read every page in a loop:
let offset = 0, all = [];
while (true) {
const res = await fetch(`${BASE}/api/links?limit=100&offset=${offset}`, { headers });
const { data } = await res.json();
all.push(...data);
if (data.length < 100) break;
offset += 100;
} Feeds#
Feeds (/api/partner/clicks, /api/partner/events, /api/site/clicks) are read oldest first with ?after_id=: pass meta.next_after_id (or the last id you got) as after_id on the next call.
let after = loadSavedCursor() || 0;
const res = await fetch(`${BASE}/api/partner/clicks?after_id=${after}&limit=500`, { headers });
const { data, meta } = await res.json();
process(data);
saveCursor(meta.next_after_id ?? after); Save the cursor after each batch. If your job stops, it carries on from the same place, with nothing missed or read twice.
Common filters#
| Filter | On | Example |
|---|---|---|
?domain_id= | Links | Only links on one domain |
?search= | Clients | Name or email contains |
?external_id= | Clients | Find by your own ID |
?client= | Partner lists | One client’s items |
?days= | Stats | The last N days |
?from=&to= | Stats | A range, in Unix seconds |
Filters combine: ?client=ext:user_42&days=7.


