Pagination
List endpoints return results in fixed-size pages. You control the page with two
query parameters, limit and offset, and every list response wraps its
results in a consistent envelope.
Parameters
| Parameter | Type | Default | Maximum | Description |
|---|---|---|---|---|
limit | integer | 20 | 300 | Number of items to return in this page. |
offset | integer | 0 | — | Number of items to skip before the first returned. |
curl --request GET \
--url 'https://pro-api.houzz.com/api/v1/projects?limit=50&offset=100' \
--header 'Authorization: Bearer eyJhbGciOi...'
Response envelope
List endpoints return an object with the page of results plus the paging metadata:
{
"data": [
{ "id": 12345, "name": "Maple Street Remodel" },
{ "id": 12346, "name": "Oak Ave Kitchen" }
],
"limit": 20,
"offset": 0,
"total": 137
}
| Field | Description |
|---|---|
data | The array of items for this page. Always present (may be empty). |
limit | The page size that was applied. |
offset | The offset that was applied. |
total | The total number of items matching the request, across all pages. |
To page through everything, keep increasing offset by limit until
offset + data.length >= total (or until data comes back empty).
Single-resource responses (get, create, update) return { "data": { ... } },
and delete responses return { "deleted": true }. Only list endpoints use the
limit/offset/total envelope described here.
Looping through all results
Request pages until you have collected total items. Use the largest limit
your workload can handle (up to 300) to minimize round trips.
Node (fetch)
async function listAllProjects(accessToken) {
const limit = 300;
let offset = 0;
const all = [];
while (true) {
const url = new URL('https://pro-api.houzz.com/api/v1/projects');
url.searchParams.set('limit', String(limit));
url.searchParams.set('offset', String(offset));
const res = await fetch(url, {
headers: { Authorization: `Bearer ${accessToken}` },
});
if (!res.ok) {
throw new Error(`List failed: ${res.status}`);
}
const { data, total } = await res.json();
all.push(...data);
offset += data.length;
if (data.length === 0 || offset >= total) {
break;
}
}
return all;
}
When paging through a dataset that is changing underneath you, items can shift
between pages as records are created or deleted. If you need a stable snapshot,
page quickly and de-duplicate on id.