nenoDevelopers
⌘K
v1

Concepts

Pagination

List endpoints return results a page at a time. You move between pages with a cursor.

How it works

Set the page size with limit, from 1 to 100. The default is 25. Each response has a hasMore flag and, when there’s another page, a nextCursor. Pass that value as cursor to fetch the next page.

Cursors are opaque. Don’t parse them or build them yourself.

Reading every page

JavaScript
let cursor = null;
do {
const url = new URL("https://api.neno.co/public/v1/invoices");
url.searchParams.set("limit", "100");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, {
headers: { Authorization: "Bearer " + process.env.NENO_API_KEY },
});
const page = await res.json();
for (const invoice of page.data) await save(invoice);
cursor = page.hasMore ? page.nextCursor : null;
} while (cursor);