Overview
Search endpoints return paginated results. The SDK providesPaginatedResult<T> which implements AsyncIterable, letting you iterate through all items across all pages without manual page management.
Basic usage
Collecting results
UsetoArray() to collect all items into an array:
Page cap
Auto-pagination stops aftermaxAutoPages pages (default 100). If pages remain at that point, iteration and toArray() throw PaginationLimitError rather than return a partial result. At the API’s default perPage of 10, that cap is 1,000 items. Set the cap with the second argument to search():
PaginationLimitError carries pagesFetched, maxAutoPages, itemsFetched, and total. A toArray({ limit }) that is reached within the cap does not throw.
Accessing page metadata
The initial response includes pagination metadata:Controlling page size
perPage above your tier’s maximum is lowered to that maximum, not rejected. Read results.meta.perPage to see the size you actually got.
Example: export all Brooklyn rentals
Rate limit awareness
Auto-pagination respects your tier’s rate limits. If you hit a rate limit during pagination, the SDK automatically retries with backoff. Each page is one request against your monthly quota, and running out of quota throwsQuotaExceededError, which is not retried. For large exports, use a larger perPage value to reduce the number of requests.