Skip to content

Pagination

List endpoints that can return a lot of rows take two query parameters:

  • limit: how many rows to return in this page.
  • offset: how many rows to skip first.
GET /v1/jobs/3f6c1b2e-8d4a-4e7b-9a10-5c2d7e8f9b01/results?limit=250&offset=500

Page sizes

Endpoint Default limit Maximum Supports offset Returns total and has_more
GET /v1/jobs/{id}/results 100 1000 Yes Yes
GET /v1/usage 100 1000 Yes Yes
GET /v1/jobs 50 500 Yes No
GET /v1/webhooks/{id}/deliveries 50 200 No, newest first No

A limit above the maximum is lowered to the maximum.

The meta block

Job results and usage records describe the page in meta:

{
"data": [ ... ],
"meta": {
"count": 250,
"total": 1312,
"limit": 250,
"offset": 500,
"has_more": true
},
"request_id": "b81e47c0..."
}
  • count is the number of rows in this page.
  • total is the number of rows overall. It can be null if the total isn’t known, in which case has_more is false.
  • has_more tells you whether to ask for another page.

Add count to offset for the next request and stop when has_more is false.

GET /v1/jobs returns only limit and offset in meta. Keep paging until a page comes back with fewer rows than you asked for.

Example loop

const API = "https://api.zillodata.com";
const headers = { Authorization: `Bearer ${process.env.ZILLODATA_KEY}` };
async function allResults(jobId) {
const rows = [];
let offset = 0;
while (true) {
const res = await fetch(
`${API}/v1/jobs/${jobId}/results?limit=1000&offset=${offset}`,
{ headers },
);
const page = await res.json();
rows.push(...page.data);
if (!page.meta.has_more) return rows;
offset += page.meta.count;
}
}

Large exports

For big result sets, ask for NDJSON or CSV with ?format=ndjson or ?format=csv. You still page with limit and offset, but each page is a plain stream of rows that can go straight into a file or a warehouse load. CSV responses also carry an X-Total-Count header when the total is known. See Output formats.