Pagination
Endpoints that return lists use `offset`/`limit` pagination via query params.
Parameters
offset— number of items to skip (defaults to 0).limit— page size (defaults to 30, max 100).
curl
curl "https://api.lueira.com/api/v1/customers?offset=30&limit=30" \
-H "Authorization: Bearer luk_..."Response headers
Every paginated response includes:
X-Total-Count— total number of items matching the filter.Link— URL of the next page withrel="next", present only if there are more results.
Walking every page
Node.js
async function* eachCustomer(apiKey) {
let url = "https://api.lueira.com/api/v1/customers?limit=100";
while (url) {
const res = await fetch(url, {
headers: { Authorization: `Bearer ${apiKey}` },
});
const { data } = await res.json();
for (const c of data) yield c;
url = parseNextLink(res.headers.get("Link"));
}
}When the
Link header is absent, you've reached the last page.